VTK-m  2.0
Public Types | Public Member Functions | Private Member Functions | Static Private Attributes | List of all members
vtkm::cont::AtomicArray< T > Class Template Reference

A type list containing types that can be used with an AtomicArray. More...

#include <AtomicArray.h>

Inheritance diagram for vtkm::cont::AtomicArray< T >:

Public Types

using ValueType = T

Public Member Functions

VTKM_CONT AtomicArray ()
VTKM_CONT AtomicArray (vtkm::cont::ArrayHandle< T > handle)
VTKM_CONT vtkm::exec::AtomicArrayExecutionObject< T > PrepareForExecution (vtkm::cont::DeviceAdapterId device, vtkm::cont::Token &token) const

Private Member Functions

 VTKM_STATIC_ASSERT_MSG (ValueTypeIsValid, "AtomicArray used with unsupported ValueType.")

Static Private Attributes

static constexpr bool ValueTypeIsValid = vtkm::ListHas<AtomicArrayTypeList, T>::value

Detailed Description

template<typename T>
class vtkm::cont::AtomicArray< T >

A type list containing types that can be used with an AtomicArray.

A class that can be used to atomically operate on an array of values safely across multiple instances of the same worklet. This is useful when you have an algorithm that needs to accumulate values in parallel, but writing out a value per worklet might be memory prohibitive.

To construct an AtomicArray you will need to pass in an vtkm::cont::ArrayHandle that is used as the underlying storage for the AtomicArray

Supported Operations: get / add / compare and swap (CAS). See AtomicArrayExecutionObject for details.

Supported Types: 32 / 64 bit signed/unsigned integers.

Member Typedef Documentation

◆ ValueType

template<typename T >
using vtkm::cont::AtomicArray< T >::ValueType = T

Constructor & Destructor Documentation

◆ AtomicArray() [1/2]

template<typename T >
VTKM_CONT vtkm::cont::AtomicArray< T >::AtomicArray ( )

◆ AtomicArray() [2/2]

template<typename T >
VTKM_CONT vtkm::cont::AtomicArray< T >::AtomicArray ( vtkm::cont::ArrayHandle< T >  handle)

Member Function Documentation

◆ PrepareForExecution()

template<typename T >
VTKM_CONT vtkm::exec::AtomicArrayExecutionObject<T> vtkm::cont::AtomicArray< T >::PrepareForExecution ( vtkm::cont::DeviceAdapterId  device,
vtkm::cont::Token token 
) const


template<typename T >
vtkm::cont::AtomicArray< T >::VTKM_STATIC_ASSERT_MSG ( ValueTypeIsValid  ,
"AtomicArray< T > used with unsupported ValueType."   

Member Data Documentation

◆ ValueTypeIsValid

template<typename T >
constexpr bool vtkm::cont::AtomicArray< T >::ValueTypeIsValid = vtkm::ListHas<AtomicArrayTypeList, T>::value

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