VTK-m
2.2
|
Class for transporting from the control to the execution environment. More...
#include <Transport.h>
Public Types | |
using | ExecObjectType = typename ContObjectType::ReadPortalType |
The type used in the execution environment. More... | |
Public Member Functions | |
template<typename InputDomainType > | |
VTKM_CONT ExecObjectType | operator() (const ContObjectType contData, const InputDomainType &inputDomain vtkm::Id outputSize) const |
Send data to the execution environment. More... | |
Class for transporting from the control to the execution environment.
The Transport
class is used to transport data of a certain type from the control environment to the execution environment. It is used internally in VTK-m's dispatch mechanism.
Transport
is a templated class with three arguments. The first argument is a tag declaring the mechanism of transport. The second argument is the type of data to transport. The third argument is device adapter tag for the device to move the data to.
There is no generic implementation of Transport
. There are partial specializations of Transport
for each mechanism supported. If you get a compiler error about an incomplete type for Transport
, it means you used an invalid TransportTag
or it is an invalid combination of data type or device adapter.
using vtkm::cont::arg::Transport< TransportTag, ContObjectType, DeviceAdapterTag >::ExecObjectType = typename ContObjectType::ReadPortalType |
The type used in the execution environment.
All Transport
specializations are expected to declare a type named ExecObjectType
that is the object type used in the execution environment. For example, for an ArrayHandle
, the ExecObjectType
is the portal used in the execution environment.
VTKM_CONT ExecObjectType vtkm::cont::arg::Transport< TransportTag, ContObjectType, DeviceAdapterTag >::operator() | ( | const ContObjectType | contData, |
const InputDomainType &inputDomain vtkm::Id | outputSize | ||
) | const |
Send data to the execution environment.
All Transport
specializations are expected to have a constant parenthesis operator that takes the data in the control environment and returns an object that is accessible in the execution environment. The second argument of the operator is a reference to the input domain argument. This might be useful for checking the sizes of input data. The third argument is the size of the output domain, which can be used, for example, to allocate data for an output array. The transport might ignore either or both of the second two arguments.