Commit Graph

15 Commits

Author SHA1 Message Date
Kenneth Moreland
e11f612add Deprecate ArrayHandleVirtual
Virtual methods in the execution environment are going away the next
major release of VTK-m, so deprecate their use in preparation for that.
2020-09-04 22:52:45 -06:00
Kitware Robot
cf0cdcf7d1 clang-format: reformat the repository with clang-format-9 2020-08-24 14:01:08 -04:00
Kenneth Moreland
ec34cb56c4 Use new ways to get array portal in control environment
Also fix deadlocks that occur when portals are not destroyed
in time.
2020-02-26 13:10:46 -07:00
Kenneth Moreland
ad0a53af71 Convert execution preparation to use tokens
Marked the old versions of PrepareFor* that do not use tokens as
deprecated and moved all of the code to use the new versions that
require a token. This makes the scope of the execution object more
explicit so that it will be kept while in use and can potentially be
reclaimed afterward.
2020-02-25 09:39:19 -07:00
Kenneth Moreland
76ce9c87f0 Support using Token calling PrepareForExecution in ExecutionObject
The old version of ExecutionObject (that only takes a device) is still
supported, but you will get a deprecated warning if that is what is
defined.

Supporing this also included sending vtkm::cont::Token through the
vtkm::cont::arg::Transport mechanism, which was a change that propogated
through a lot of code.
2020-02-25 07:41:39 -07:00
Kenneth Moreland
6592e52880 Fix IsWritableArrayHandle for portals that exist but cannot be written
Previously, IsWriteableArrayHandle just checked to see if an
ArrayHandle's portal has a ValueType of void* because we had coded the
special read-only array handles to have fake portals for writing.
However, we recently removed that because it was more trouble than it
was worth. Now IsWritableArrayHandle checks for the existance of the Set
method. If it does not exist, then the portal is considered read-only.

Also corrected spelling (writeable -> writable).
2019-07-19 20:33:58 -06:00
Robert Maynard
3a4bffe538 Make sure methods that are used by multiple TU's are inline.
These methods need to be marked inline as they are used by multiple
TU's. When they aren't marked as inline we see random failures in
downstream VTK-m users generally when CUDA is enabled due to ODR
violations.
2019-05-22 15:24:57 -04:00
nadavi
fbcea82e78 conslidate the license statement 2019-04-17 10:57:13 -06:00
Robert Maynard
46843ff4ee CellSetExplicit has no dependency on default vtk-m device
The default vtk-m device is an outdated concept and this is the
first step of removing it from VTK-m.
2019-04-10 14:28:30 -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
0ff83e94bf Properly handle conditions when VirtualStorage is null
If an ArrayHandleVirtual is constructed without an underlying concrete
array handle, then the Storage<T, StorageTagVirtual> holds a
StorageVirtual pointer that is null. Generally, a null
ArrayHandleVirtual cannot do much, but its operations should still be
correct. There were a few places where the Storage would blindly try to
use its StorageVirtual pointer without checking it first. This adds some
conditions that should correct the behavior when StorageVirtual is null.
2019-03-01 15:50:16 -07:00
Kenneth Moreland
0571c6335d Add missing allocation methods to ArrayHandleVirtual 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
Robert Maynard
a9d092efac Optimize TransferInfo / VirtualObjectTransfer for shared memory systems 2019-01-01 15:58:57 -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