VTK-m  1.6
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | List of all members
vtkm::cont::ArrayHandle< T, StorageTag_ > Class Template Reference

Manages an array-worth of data. More...

#include <ArrayHandle.h>

Inheritance diagram for vtkm::cont::ArrayHandle< T, StorageTag_ >:
vtkm::cont::ArrayHandleCartesianProduct< AxisIndexArrayCells, AxisIndexArrayCells, AxisIndexArrayCells > vtkm::cont::ArrayHandleCartesianProduct< AxisIndexArrayPoints, AxisIndexArrayPoints, AxisIndexArrayPoints > vtkm::cont::ArrayHandleImplicit< detail::PhiloxFunctor > vtkm::cont::ArrayHandleCartesianProduct< FirstHandleType, SecondHandleType, ThirdHandleType > vtkm::cont::ArrayHandleDecorator< DecoratorImplT, ArrayTs > vtkm::cont::ArrayHandleDiscard< ValueType_ > vtkm::cont::ArrayHandleImplicit< FunctorType > vtkm::cont::ArrayHandleZip< FirstHandleType, SecondHandleType >

Public Types

using ValueType = T
 
using StorageTag = StorageTag_
 
using StorageType = vtkm::cont::internal::Storage< ValueType, StorageTag >
 
using ReadPortalType = typename StorageType::ReadPortalType
 
using WritePortalType = typename StorageType::WritePortalType
 
using instead = WritePortalType
 
using instead = ReadPortalType
 

Public Member Functions

template<typename Device >
struct VTKM_DEPRECATED (1.6, "Use ReadPortalType and WritePortalType.") ExecutionTypes
 
VTKM_CONT ArrayHandle ()
 Constructs an empty ArrayHandle. More...
 
VTKM_CONT ArrayHandle (const vtkm::cont::ArrayHandle< ValueType, StorageTag > &src)
 Copy constructor. More...
 
VTKM_CONT ArrayHandle (vtkm::cont::ArrayHandle< ValueType, StorageTag > &&src) noexcept
 Move constructor. More...
 
VTKM_CONT ~ArrayHandle ()
 Destructs an empty ArrayHandle. More...
 
VTKM_CONT vtkm::cont::ArrayHandle< ValueType, StorageTag > & operator= (const vtkm::cont::ArrayHandle< ValueType, StorageTag > &src)
 Copies an ArrayHandle. More...
 
VTKM_CONT vtkm::cont::ArrayHandle< ValueType, StorageTag > & operator= (vtkm::cont::ArrayHandle< ValueType, StorageTag > &&src) noexcept
 Move and Assignment of an ArrayHandle. More...
 
VTKM_CONT bool operator== (const ArrayHandle< ValueType, StorageTag > &rhs) const
 Like a pointer, two ArrayHandles are considered equal if they point to the same location in memory. More...
 
VTKM_CONT bool operator!= (const ArrayHandle< ValueType, StorageTag > &rhs) const
 
template<typename VT , typename ST >
VTKM_CONT bool operator== (const ArrayHandle< VT, ST > &) const
 
template<typename VT , typename ST >
VTKM_CONT bool operator!= (const ArrayHandle< VT, ST > &) const
 
VTKM_CONT StorageType GetStorage () const
 Get the storage. More...
 
VTKM_CONT VTKM_DEPRECATED (1.6, "Use ArrayHandle::WritePortal() instead. " "Note that the returned portal will lock the array while it is in scope.") VTKM_CONT VTKM_DEPRECATED(1.6
 Get the array portal of the control array. More...
 
VTKM_CONT Use ArrayHandle::ReadPortal () instead. " "Note that the returned portal will lock the array while it is in scope.") VTKM_CONT ReadPortalType ReadPortal() const
 Get an array portal that can be used in the control environment. More...
 
VTKM_CONT WritePortalType WritePortal () const
 Get an array portal that can be used in the control environment. More...
 
VTKM_CONT vtkm::Id GetNumberOfValues () const
 Returns the number of entries in the array. More...
 
 VTKM_DEPRECATED (1.6, "Use Allocate(n, vtkm::CopyFlag::On) instead of Shrink(n).") VTKM_CONT void Shrink(vtkm
 
VTKM_CONT void ReleaseResourcesExecution () const
 Releases any resources being used in the execution environment (that are not being shared by the control environment). More...
 
VTKM_CONT void ReleaseResources ()
 Releases all resources in both the control and execution environments. More...
 
VTKM_CONT ReadPortalType PrepareForInput (vtkm::cont::DeviceAdapterId device, vtkm::cont::Token &token) const
 Prepares this array to be used as an input to an operation in the execution environment. More...
 
VTKM_CONT WritePortalType PrepareForInPlace (vtkm::cont::DeviceAdapterId device, vtkm::cont::Token &token) const
 Prepares this array to be used in an in-place operation (both as input and output) in the execution environment. More...
 
VTKM_CONT WritePortalType PrepareForOutput (vtkm::Id numberOfValues, vtkm::cont::DeviceAdapterId device, vtkm::cont::Token &token)
 Prepares (allocates) this array to be used as an output from an operation in the execution environment. More...
 
VTKM_CONT VTKM_DEPRECATED (1.6, "PrepareForInput now requires a vtkm::cont::Token object.") ReadPortalType PrepareForInput(vtkm
 
VTKM_CONT ArrayHandle (const std::vector< vtkm::cont::internal::Buffer > &buffers)
 
VTKM_CONT ArrayHandle (std::vector< vtkm::cont::internal::Buffer > &&buffers) noexcept
 
VTKM_CONT ArrayHandle (const vtkm::cont::internal::Buffer *buffers)
 
VTKM_CONT void Allocate (vtkm::Id numberOfValues, vtkm::CopyFlag preserve, vtkm::cont::Token &token)
 Allocates an array large enough to hold the given number of values. More...
 
VTKM_CONT void Allocate (vtkm::Id numberOfValues, vtkm::CopyFlag preserve=vtkm::CopyFlag::Off)
 Allocates an array large enough to hold the given number of values. More...
 

Static Public Member Functions

static constexpr VTKM_CONT vtkm::IdComponent GetNumberOfBuffers ()
 

Protected Member Functions

VTKM_CONT void SetBuffer (vtkm::IdComponent index, const vtkm::cont::internal::Buffer &buffer)
 Returns true if the ArrayHandle's data is on the given device. More...
 
template<typename BufferContainer >
VTKM_CONT void SetBuffers (const BufferContainer &buffers)
 

Private Member Functions

 VTKM_STATIC_ASSERT_MSG ((internal::IsValidArrayHandle< T, StorageTag_ >::value), "Attempted to create an ArrayHandle with an invalid type/storage combination.")
 

Detailed Description

template<typename T, typename StorageTag_ = VTKM_DEFAULT_STORAGE_TAG>
class vtkm::cont::ArrayHandle< T, StorageTag_ >

Manages an array-worth of data.

ArrayHandle manages as array of data that can be manipulated by VTKm algorithms. The ArrayHandle may have up to two copies of the array, one for the control environment and one for the execution environment, although depending on the device and how the array is being used, the ArrayHandle will only have one copy when possible.

An ArrayHandle is often constructed by instantiating one of the ArrayHandle subclasses. Several basic ArrayHandle types can also be constructed directly and then allocated. The ArrayHandleBasic subclass provides mechanisms for importing user arrays into an ArrayHandle.

ArrayHandle behaves like a shared smart pointer in that when it is copied each copy holds a reference to the same array. These copies are reference counted so that when all copies of the ArrayHandle are destroyed, any allocated memory is released.

Member Typedef Documentation

◆ instead [1/2]

template<typename T , typename StorageTag_ = VTKM_DEFAULT_STORAGE_TAG>
using vtkm::cont::ArrayHandle< T, StorageTag_ >::instead = WritePortalType

◆ instead [2/2]

template<typename T , typename StorageTag_ = VTKM_DEFAULT_STORAGE_TAG>
using vtkm::cont::ArrayHandle< T, StorageTag_ >::instead = ReadPortalType

◆ ReadPortalType

template<typename T , typename StorageTag_ = VTKM_DEFAULT_STORAGE_TAG>
using vtkm::cont::ArrayHandle< T, StorageTag_ >::ReadPortalType = typename StorageType::ReadPortalType

◆ StorageTag

template<typename T , typename StorageTag_ = VTKM_DEFAULT_STORAGE_TAG>
using vtkm::cont::ArrayHandle< T, StorageTag_ >::StorageTag = StorageTag_

◆ StorageType

template<typename T , typename StorageTag_ = VTKM_DEFAULT_STORAGE_TAG>
using vtkm::cont::ArrayHandle< T, StorageTag_ >::StorageType = vtkm::cont::internal::Storage<ValueType, StorageTag>

◆ ValueType

template<typename T , typename StorageTag_ = VTKM_DEFAULT_STORAGE_TAG>
using vtkm::cont::ArrayHandle< T, StorageTag_ >::ValueType = T

◆ WritePortalType

template<typename T , typename StorageTag_ = VTKM_DEFAULT_STORAGE_TAG>
using vtkm::cont::ArrayHandle< T, StorageTag_ >::WritePortalType = typename StorageType::WritePortalType

Constructor & Destructor Documentation

◆ ArrayHandle() [1/6]

template<typename T , typename StorageTag_ = VTKM_DEFAULT_STORAGE_TAG>
VTKM_CONT vtkm::cont::ArrayHandle< T, StorageTag_ >::ArrayHandle ( )
inline

Constructs an empty ArrayHandle.

◆ ArrayHandle() [2/6]

template<typename T , typename StorageTag_ = VTKM_DEFAULT_STORAGE_TAG>
VTKM_CONT vtkm::cont::ArrayHandle< T, StorageTag_ >::ArrayHandle ( const vtkm::cont::ArrayHandle< ValueType, StorageTag > &  src)
inline

Copy constructor.

Implemented so that it is defined exclusively in the control environment. If there is a separate device for the execution environment (for example, with CUDA), then the automatically generated copy constructor could be created for all devices, and it would not be valid for all devices.

◆ ArrayHandle() [3/6]

template<typename T , typename StorageTag_ = VTKM_DEFAULT_STORAGE_TAG>
VTKM_CONT vtkm::cont::ArrayHandle< T, StorageTag_ >::ArrayHandle ( vtkm::cont::ArrayHandle< ValueType, StorageTag > &&  src)
inlinenoexcept

Move constructor.

Implemented so that it is defined exclusively in the control environment. If there is a separate device for the execution environment (for example, with CUDA), then the automatically generated move constructor could be created for all devices, and it would not be valid for all devices.

◆ ArrayHandle() [4/6]

template<typename T , typename StorageTag_ = VTKM_DEFAULT_STORAGE_TAG>
VTKM_CONT vtkm::cont::ArrayHandle< T, StorageTag_ >::ArrayHandle ( const std::vector< vtkm::cont::internal::Buffer > &  buffers)
inline

Special constructor for subclass specializations that need to set the initial state array. Used when pulling data from other sources.

◆ ArrayHandle() [5/6]

template<typename T , typename StorageTag_ = VTKM_DEFAULT_STORAGE_TAG>
VTKM_CONT vtkm::cont::ArrayHandle< T, StorageTag_ >::ArrayHandle ( std::vector< vtkm::cont::internal::Buffer > &&  buffers)
inlinenoexcept

Special constructor for subclass specializations that need to set the initial state array. Used when pulling data from other sources.

◆ ArrayHandle() [6/6]

template<typename T , typename StorageTag_ = VTKM_DEFAULT_STORAGE_TAG>
VTKM_CONT vtkm::cont::ArrayHandle< T, StorageTag_ >::ArrayHandle ( const vtkm::cont::internal::Buffer *  buffers)
inline

Special constructor for subclass specializations that need to set the initial state array. Used when pulling data from other sources.

◆ ~ArrayHandle()

template<typename T , typename StorageTag_ = VTKM_DEFAULT_STORAGE_TAG>
VTKM_CONT vtkm::cont::ArrayHandle< T, StorageTag_ >::~ArrayHandle ( )
inline

Destructs an empty ArrayHandle.

Implemented so that it is defined exclusively in the control environment. If there is a separate device for the execution environment (for example, with CUDA), then the automatically generated destructor could be created for all devices, and it would not be valid for all devices.

Member Function Documentation

◆ Allocate() [1/2]

template<typename T , typename StorageTag_ = VTKM_DEFAULT_STORAGE_TAG>
VTKM_CONT void vtkm::cont::ArrayHandle< T, StorageTag_ >::Allocate ( vtkm::Id  numberOfValues,
vtkm::CopyFlag  preserve,
vtkm::cont::Token token 
)
inline

Allocates an array large enough to hold the given number of values.

The allocation may be done on an already existing array. If so, then the data are preserved as best as possible if the preserve flag is set to vtkm::CopyFlag::On. If the preserve flag is set to vtkm::CopyFlag::Off (the default), any existing data could be wiped out.

This method can throw ErrorBadAllocation if the array cannot be allocated or ErrorBadValue if the allocation is not feasible (for example, the array storage is read-only).

◆ Allocate() [2/2]

template<typename T , typename StorageTag_ = VTKM_DEFAULT_STORAGE_TAG>
VTKM_CONT void vtkm::cont::ArrayHandle< T, StorageTag_ >::Allocate ( vtkm::Id  numberOfValues,
vtkm::CopyFlag  preserve = vtkm::CopyFlag::Off 
)
inline

Allocates an array large enough to hold the given number of values.

The allocation may be done on an already existing array. If so, then the data are preserved as best as possible if the preserve flag is set to vtkm::CopyFlag::On. If the preserve flag is set to vtkm::CopyFlag::Off (the default), any existing data could be wiped out.

This method can throw ErrorBadAllocation if the array cannot be allocated or ErrorBadValue if the allocation is not feasible (for example, the array storage is read-only).

◆ ArrayHandle::ReadPortal()

template<typename T , typename StorageTag_ = VTKM_DEFAULT_STORAGE_TAG>
VTKM_CONT Use vtkm::cont::ArrayHandle< T, StorageTag_ >::ArrayHandle::ReadPortal ( ) const
inline

Get an array portal that can be used in the control environment.

The returned array can be used in the control environment to read values from the array. (It is not possible to write to the returned portal. That is Get will work on the portal, but Set will not.)

Note: The returned portal cannot be used in the execution environment. This is because the portal will not work on some devices like GPUs. To get a portal that will work in the execution environment, use PrepareForInput.

◆ GetNumberOfBuffers()

template<typename T , typename StorageTag_ = VTKM_DEFAULT_STORAGE_TAG>
static constexpr VTKM_CONT vtkm::IdComponent vtkm::cont::ArrayHandle< T, StorageTag_ >::GetNumberOfBuffers ( )
inlinestaticconstexpr

◆ GetNumberOfValues()

template<typename T , typename StorageTag_ = VTKM_DEFAULT_STORAGE_TAG>
VTKM_CONT vtkm::Id vtkm::cont::ArrayHandle< T, StorageTag_ >::GetNumberOfValues ( ) const
inline

Returns the number of entries in the array.

◆ GetStorage()

template<typename T , typename StorageTag_ = VTKM_DEFAULT_STORAGE_TAG>
VTKM_CONT StorageType vtkm::cont::ArrayHandle< T, StorageTag_ >::GetStorage ( ) const
inline

Get the storage.

◆ operator!=() [1/2]

template<typename T , typename StorageTag_ = VTKM_DEFAULT_STORAGE_TAG>
VTKM_CONT bool vtkm::cont::ArrayHandle< T, StorageTag_ >::operator!= ( const ArrayHandle< ValueType, StorageTag > &  rhs) const
inline

◆ operator!=() [2/2]

template<typename T , typename StorageTag_ = VTKM_DEFAULT_STORAGE_TAG>
template<typename VT , typename ST >
VTKM_CONT bool vtkm::cont::ArrayHandle< T, StorageTag_ >::operator!= ( const ArrayHandle< VT, ST > &  ) const
inline

◆ operator=() [1/2]

template<typename T , typename StorageTag_ = VTKM_DEFAULT_STORAGE_TAG>
VTKM_CONT vtkm::cont::ArrayHandle<ValueType, StorageTag>& vtkm::cont::ArrayHandle< T, StorageTag_ >::operator= ( const vtkm::cont::ArrayHandle< ValueType, StorageTag > &  src)
inline

Copies an ArrayHandle.

◆ operator=() [2/2]

template<typename T , typename StorageTag_ = VTKM_DEFAULT_STORAGE_TAG>
VTKM_CONT vtkm::cont::ArrayHandle<ValueType, StorageTag>& vtkm::cont::ArrayHandle< T, StorageTag_ >::operator= ( vtkm::cont::ArrayHandle< ValueType, StorageTag > &&  src)
inlinenoexcept

Move and Assignment of an ArrayHandle.

◆ operator==() [1/2]

template<typename T , typename StorageTag_ = VTKM_DEFAULT_STORAGE_TAG>
VTKM_CONT bool vtkm::cont::ArrayHandle< T, StorageTag_ >::operator== ( const ArrayHandle< ValueType, StorageTag > &  rhs) const
inline

Like a pointer, two ArrayHandles are considered equal if they point to the same location in memory.

◆ operator==() [2/2]

template<typename T , typename StorageTag_ = VTKM_DEFAULT_STORAGE_TAG>
template<typename VT , typename ST >
VTKM_CONT bool vtkm::cont::ArrayHandle< T, StorageTag_ >::operator== ( const ArrayHandle< VT, ST > &  ) const
inline

◆ PrepareForInPlace()

template<typename T , typename StorageTag_ = VTKM_DEFAULT_STORAGE_TAG>
VTKM_CONT WritePortalType vtkm::cont::ArrayHandle< T, StorageTag_ >::PrepareForInPlace ( vtkm::cont::DeviceAdapterId  device,
vtkm::cont::Token token 
) const
inline

Prepares this array to be used in an in-place operation (both as input and output) in the execution environment.

If necessary, copies data to the execution environment. Can throw an exception if this array does not yet contain any data. Returns a portal that can be used in code running in the execution environment.

The Token object provided will be attached to this ArrayHandle. The returned portal is guaranteed to be valid while the Token is still attached and in scope. Other operations on this ArrayHandle that would invalidate the returned portal will block until the Token is released. Likewise, this method will block if another Token is already attached. This can potentially lead to deadlocks.

◆ PrepareForInput()

template<typename T , typename StorageTag_ = VTKM_DEFAULT_STORAGE_TAG>
VTKM_CONT ReadPortalType vtkm::cont::ArrayHandle< T, StorageTag_ >::PrepareForInput ( vtkm::cont::DeviceAdapterId  device,
vtkm::cont::Token token 
) const
inline

Prepares this array to be used as an input to an operation in the execution environment.

If necessary, copies data to the execution environment. Can throw an exception if this array does not yet contain any data. Returns a portal that can be used in code running in the execution environment.

The Token object provided will be attached to this ArrayHandle. The returned portal is guaranteed to be valid while the Token is still attached and in scope. Other operations on this ArrayHandle that would invalidate the returned portal will block until the Token is released. Likewise, this method will block if another Token is already attached. This can potentially lead to deadlocks.

◆ PrepareForOutput()

template<typename T , typename StorageTag_ = VTKM_DEFAULT_STORAGE_TAG>
VTKM_CONT WritePortalType vtkm::cont::ArrayHandle< T, StorageTag_ >::PrepareForOutput ( vtkm::Id  numberOfValues,
vtkm::cont::DeviceAdapterId  device,
vtkm::cont::Token token 
)
inline

Prepares (allocates) this array to be used as an output from an operation in the execution environment.

The internal state of this class is set to have valid data in the execution array with the assumption that the array will be filled soon (i.e. before any other methods of this object are called). Returns a portal that can be used in code running in the execution environment.

The Token object provided will be attached to this ArrayHandle. The returned portal is guaranteed to be valid while the Token is still attached and in scope. Other operations on this ArrayHandle that would invalidate the returned portal will block until the Token is released. Likewise, this method will block if another Token is already attached. This can potentially lead to deadlocks.

◆ ReleaseResources()

template<typename T , typename StorageTag_ = VTKM_DEFAULT_STORAGE_TAG>
VTKM_CONT void vtkm::cont::ArrayHandle< T, StorageTag_ >::ReleaseResources ( )
inline

Releases all resources in both the control and execution environments.

◆ ReleaseResourcesExecution()

template<typename T , typename StorageTag_ = VTKM_DEFAULT_STORAGE_TAG>
VTKM_CONT void vtkm::cont::ArrayHandle< T, StorageTag_ >::ReleaseResourcesExecution ( ) const
inline

Releases any resources being used in the execution environment (that are not being shared by the control environment).

◆ SetBuffer()

template<typename T , typename StorageTag_ = VTKM_DEFAULT_STORAGE_TAG>
VTKM_CONT void vtkm::cont::ArrayHandle< T, StorageTag_ >::SetBuffer ( vtkm::IdComponent  index,
const vtkm::cont::internal::Buffer &  buffer 
)
inlineprotected

Returns true if the ArrayHandle's data is on the given device.

If the data are on the given device, then preparing for that device should not require any data movement. Returns true if the ArrayHandle's data is on the host. If the data are on the given device, then calling ReadPortal or WritePortal should not require any data movement. Returns a DeviceAdapterId for a device currently allocated on. If there is no device with an up-to-date copy of the data, VTKM_DEVICE_ADAPTER_UNDEFINED is returned.

Note that in a multithreaded environment the validity of this result can change.

TODO: Deprecate this method in favor of IsOnDevice since the data can be on multiple devices at once. Synchronizes the control array with the execution array. If either the user array or control array is already valid, this method does nothing (because the data is already available in the control environment). Although the internal state of this class can change, the method is declared const because logically the data does not.

Enqueue a token for access to this ArrayHandle.

This method places the given Token into the queue of Tokens waiting for access to this ArrayHandle and then returns immediately. When this token is later used to get data from this ArrayHandle (for example, in a call to PrepareForInput), it will use this place in the queue while waiting for access.

This method is to be used to ensure that a set of accesses to an ArrayHandle that happen on multiple threads occur in a specified order. For example, if you spawn of a job to modify data in an ArrayHandle and then spawn off a job that reads that same data, you need to make sure that the first job gets access to the ArrayHandle before the second. If they both just attempt to call their respective Prepare methods, there is no guarantee which order they will occur. Having the spawning thread first call this method will ensure the order.

Warning
After calling this method it is required to subsequently call a method like one of the Prepare methods that attaches the token to this ArrayHandle. Otherwise, the enqueued token will block any subsequent access to the ArrayHandle, even if the Token is destroyed.

Deep copies the data in the array.

Takes the data that is in source and copies that data into this array. Returns the internal Buffer structures that hold the data.

◆ SetBuffers()

template<typename T , typename StorageTag_ = VTKM_DEFAULT_STORAGE_TAG>
template<typename BufferContainer >
VTKM_CONT void vtkm::cont::ArrayHandle< T, StorageTag_ >::SetBuffers ( const BufferContainer &  buffers)
inlineprotected

◆ VTKM_DEPRECATED() [1/4]

template<typename T , typename StorageTag_ = VTKM_DEFAULT_STORAGE_TAG>
VTKM_CONT vtkm::cont::ArrayHandle< T, StorageTag_ >::VTKM_DEPRECATED ( 1.  6,
"PrepareForInput now requires a vtkm::cont::Token object."   
)
inline

◆ VTKM_DEPRECATED() [2/4]

template<typename T , typename StorageTag_ = VTKM_DEFAULT_STORAGE_TAG>
vtkm::cont::ArrayHandle< T, StorageTag_ >::VTKM_DEPRECATED ( 1.  6,
"Use Allocate(n, vtkm::CopyFlag::On) instead of Shrink(n)."   
)
inline

◆ VTKM_DEPRECATED() [3/4]

template<typename T , typename StorageTag_ = VTKM_DEFAULT_STORAGE_TAG>
VTKM_CONT vtkm::cont::ArrayHandle< T, StorageTag_ >::VTKM_DEPRECATED ( 1.  6,
"Use ArrayHandle< T, StorageTag_ >::WritePortal() instead. " "Note that the returned portal will lock the array while it is in scope."   
)

Get the array portal of the control array.

Since worklet invocations are asynchronous and this routine is a synchronization point, exceptions maybe thrown for errors from previously executed worklets.

Deprecated:
Use WritePortal instead.

Get the array portal of the control array. Since worklet invocations are asynchronous and this routine is a synchronization point, exceptions maybe thrown for errors from previously executed worklets.

Deprecated:
Use ReadPortal instead.

◆ VTKM_DEPRECATED() [4/4]

template<typename T , typename StorageTag_ = VTKM_DEFAULT_STORAGE_TAG>
template<typename Device >
struct vtkm::cont::ArrayHandle< T, StorageTag_ >::VTKM_DEPRECATED ( 1.  6,
"Use ReadPortalType and WritePortalType."   
)
inline

◆ VTKM_STATIC_ASSERT_MSG()

template<typename T , typename StorageTag_ = VTKM_DEFAULT_STORAGE_TAG>
vtkm::cont::ArrayHandle< T, StorageTag_ >::VTKM_STATIC_ASSERT_MSG ( (internal::IsValidArrayHandle< T, StorageTag_ >::value)  ,
"Attempted to create an ArrayHandle< T, StorageTag_ > with an invalid type/storage combination."   
)
private

◆ WritePortal()

template<typename T , typename StorageTag_ = VTKM_DEFAULT_STORAGE_TAG>
VTKM_CONT WritePortalType vtkm::cont::ArrayHandle< T, StorageTag_ >::WritePortal ( ) const
inline

Get an array portal that can be used in the control environment.

The returned array can be used in the control environment to reand and write values to the array.

Note: The returned portal cannot be used in the execution environment. This is because the portal will not work on some devices like GPUs. To get a portal that will work in the execution environment, use PrepareForInput.


The documentation for this class was generated from the following file: