Commit Graph

10 Commits

Author SHA1 Message Date
Sujin Philip
dae779b9f8 ArrayHandleVirtual bugfixes
After the change to `ArrayHandleVirtual` where it became a subclass of
`vtkm::cont::ArrayHandle`, a few extra changes are required.

1. Functions with `ArrayHandleVirtual` as parameters will not be callable
with the superclass `ArrayHandle`. This is fixed by changing the argument
types to the superclass.
2. Add Serialization classes specializations for the superclass, as "is-a"
relation is not considered for class template parameters.
2019-04-08 15:42:53 -04:00
Kenneth Moreland
db0f5c31b9 Add a Transfer object for ArrayHandleVirtual
Previously, ArrayHandleVirtual was using the default Transfer object.
This was problematic because it would copy/allocate things in the
execution environment independently from the array that it was wrapped
around. This caused several negative effects, particularly for CUDA
devices. First, if the data were already on the device (or the array is
implicit), a second copy of the data would be made. Second, the copy to
the device is likely less efficient. Third (and worst of all), the data
did not always get pulled back to the original array correctly.

This commit also contains instantiations of ArrayHandleVirtual and its
components for the most common types.
2019-03-01 15:50:16 -07:00
Kenneth Moreland
0b32831afd Make ArrayHandleVirtual conform with other ArrayHandle structure
Previously, ArrayHandleVirtual was defined as a specialization of
ArrayHandle with the virtual storage tag. This was because the storage
object was polymorphic and needed to be handled special. These changes
moved the existing storage definition to an internal class, and then
managed the pointer to that implementation class in a Storage object
that can be managed like any other storage object.

Also moved the implementation of StorageAny into the implementation of
the internal storage object.
2019-03-01 15:50:14 -07:00
Allison Vacanti
d1db4ef8b3 Clarify intent of TypeString and TypeName functions.
TypeName is used for logging, and is now TypeToString.

TypeString is used for serialization, and is now SerializableTypeString.
2019-03-01 11:47:53 -05:00
Robert Maynard
ad98d818ce VTK-m now doesn't clobber external DIY installations
Fixes #334
2019-02-05 13:05:14 -05:00
Robert Maynard
61b1b51577 Make IsType and Cast not error at compile time when given bad types
Previously these two functions would give compile errors when asked to
compare against an Array with a different value type. This makes it easier
to write generic code that compares virtual handles.
2018-12-31 13:03:42 -05:00
Robert Maynard
3445047f9e Refactor vtkm::cont::ArrayHandleAny into vtkm::cont::ArrayHandleVirtual
ArrayHandleVirtual can automatically be constructed from any ArrayHandle.
In the cases where the input ArrayHandle doesn't derived from ArrayHandleVirtual,
it will automatically construct StorageAny to hold the array.
2018-12-27 15:42:03 -05:00
Robert Maynard
acf825b279 Correct IsType and Cast on ArrayHandleVirtual to work on OSX. 2018-12-27 14:35:56 -05:00
Robert Maynard
8deb661409 Add serialization support to ArrayHandle Virtual, Any, and Variant. 2018-12-27 14:35:56 -05:00
Robert Maynard
6e1cbaa16a Add StorageVirtual and ArrayHandleVirtual to vtkm::cont 2018-12-27 14:35:56 -05:00