Commit Graph

16 Commits

Author SHA1 Message Date
Robert Maynard
9213038aa2 Make sure all vtkm/cont .hxx files have header guards
Make it easier for consumer to only include hxx files a single
time.
2019-07-01 14:03:40 -04:00
Robert Maynard
674fe1fbf2 StealArray now returns the array and free function as a Pair.
This helps reduces bugs when the callers ask to steal arrays
without getting the free function, or ask for the free function
after stealing the array.
2019-05-01 09:42:57 -04:00
nadavi
fbcea82e78 conslidate the license statement 2019-04-17 10:57:13 -06:00
Robert Maynard
c66a6e480d Provided vtkm::cont::Storage with move schematics 2018-10-24 15:45:55 -04:00
Robert Maynard
707970f492 VTK-m StorageBasic is now able to give/take ownership of user allocated memory.
This fixes the three following issues with StorageBasic.

1. Memory that was allocated by VTK-m and Stolen by the user needed the
proper free function called which is generally StorageBasicAllocator::deallocate.
But that was hard for the user to hold onto. So now we provide a function
pointer to the correct free function.

2. Memory that was allocated outside of VTK-m was impossible to transfer to
VTK-m as we didn't know how to free it. This is now resolved by allowing the
user to specify a free function to be called on release.

3. When the CUDA backend allocates memory for an ArrayHandle that has no
control representation, and the location we are running on supports concurrent
managed access we want to specify that cuda managed memory as also the host memory.
This requires that StorageBasic be able to call an arbitrary new delete function
which is chosen at runtime.
2018-04-04 11:27:57 -04:00
Robert Maynard
d0a68d3266 Refactor vtk-m storage basic to generate less code
By moving all common operations to a parent class we can
significantly reduce the vtk-m library size.
2018-02-16 09:59:19 -05:00
Kenneth Moreland
c3a3184d51 Update copyright for Sandia
Sandia National Laboratories recently changed management from the
Sandia Corporation to the National Technology & Engineering Solutions
of Sandia, LLC (NTESS). The copyright statements need to be updated
accordingly.
2017-09-20 15:33:44 -06:00
Allison Vacanti
00320e5dc0 Use vtkm::UInt64 for byte sizes.
vtkm::Id could be just 32bits, which limits the number of values we
would be able to store for large arrays.
2017-09-19 09:21:14 -04:00
Matt Larsen
50956b8074 fixing triangulator and adding a fast path for 3D structured cell sets 2017-09-04 08:17:01 -07:00
Robert Maynard
c385b21acd StorageBasic is now treated like users memory after being stolen.
Previously once an ArrayHandle was stolen it was placed in an invalid state
where it could not used again by VTK-m. Now instead after being stolen it
is placed into a state where it is identical to memory allocated outside
of VTK-m and passed in.
2017-08-18 08:24:49 -04:00
David C. Lonie
b2c3e41645 Refactor array transfer logic for basic storage.
The old templated array transfer mechanism generated a lot of code
that ended up doing a simple, type-agnostic memcpy for most devices.
This patch specialized array handles for basic storage and uses a
fast-path array transfer implementation. This reduces the size of the
vtkm_cont library by 27% on gcc (from 6.2MB to 4.5MB).
2017-06-29 13:18:44 -04:00
Kitware Robot
4ade5f5770 clang-format: apply to the entire tree 2017-05-25 07:51:37 -04:00
Kenneth Moreland
726546419d ArrayHandle reallocations of 0
The basic storage has an implicit invariant that if the size of the
storage is 0 then the array is a null pointer. That invariant was broken
if the array was allocated and then Shrink or Allocate was called with
0. In that case, the array remained allocated by the size was set to 0.

This fixes the problem by making sure a Shrink(0) actually does an
Allocate(0) (to clear out the data) and that the basic storage always
frees its memory when allocating a 0 sized array.
2017-03-08 18:53:06 -05:00
Sujin Philip
a88807fd7e Catch all exceptions by reference 2017-02-23 13:25:01 -05:00
David C. Lonie
f601e38ba8 Simplify exception hierarchy.
Remove the ErrorControl class such that all subclasses now inherit from
error. Renamed all exception classes via s/ErrorControl/Error/.

See issue #57.
2017-02-07 15:42:38 -05:00
Robert Maynard
5921c8d9b8 vtkm_cont now contains explicit instantiations of common StorageBasic types. 2017-01-16 09:17:38 -05:00