Go to the documentation of this file.
10 #ifndef vtk_m_exec_AtomicArrayExecutionObject_h
11 #define vtk_m_exec_AtomicArrayExecutionObject_h
18 #include <type_traits>
66 using type =
typename MakeUnsigned<T>::type;
92 template <
typename PortalType,
93 typename PointerType = decltype(std::declval<PortalType>().GetIteratorBegin())>
109 using PortalType = decltype(handle.PrepareForInPlace(device, token));
111 "Source portal must return a pointer from "
112 "GetIteratorBegin().");
133 using APIType =
typename detail::MakeUnsigned<ValueType>::type;
158 using APIType =
typename detail::ArithType<ValueType>::type;
161 reinterpret_cast<APIType*
>(this->
Data + index),
static_cast<APIType
>(value), order));
188 using APIType =
typename detail::MakeUnsigned<ValueType>::type;
191 reinterpret_cast<APIType*
>(this->
Data + index),
static_cast<APIType
>(value), order);
250 using APIType =
typename detail::MakeUnsigned<ValueType>::type;
253 reinterpret_cast<APIType*
>(oldValue),
254 static_cast<APIType
>(newValue),
265 #endif //vtk_m_exec_AtomicArrayExecutionObject_h
void Set(vtkm::Id index, const ValueType &value, vtkm::MemoryOrder order=vtkm::MemoryOrder::Release) const
Peform an atomic store to memory while enforcing, at minimum, "release" memory ordering.
Definition: AtomicArrayExecutionObject.h:178
Manages an array-worth of data.
Definition: ArrayHandle.h:300
T AtomicAdd(T *pointer, T operand, vtkm::MemoryOrder order=vtkm::MemoryOrder::SequentiallyConsistent)
Atomic function to add a value to a shared memory location.
Definition: Atomic.h:829
#define VTKM_EXEC
Definition: ExportMacros.h:51
Groups connected points that have the same field value.
Definition: Atomic.h:19
T AtomicLoad(T *const pointer, vtkm::MemoryOrder order=vtkm::MemoryOrder::Acquire)
Atomic function to load a value from a shared memory location.
Definition: Atomic.h:786
ValueType Add(vtkm::Id index, const ValueType &value, vtkm::MemoryOrder order=vtkm::MemoryOrder::SequentiallyConsistent) const
Peform an atomic addition with sequentially consistent memory ordering.
Definition: AtomicArrayExecutionObject.h:148
@ Release
A store operation with Release memory order will enforce that any local read or write operations list...
vtkm::Id NumberOfValues
Definition: AtomicArrayExecutionObject.h:260
ValueType * Data
Definition: AtomicArrayExecutionObject.h:259
MemoryOrder
Specifies memory order semantics for atomic operations.
Definition: Atomic.h:56
vtkm::Id GetNumberOfValues() const
Retrieve the number of values in the atomic array.
Definition: AtomicArrayExecutionObject.h:118
@ SequentiallyConsistent
An atomic with SequentiallyConsistent memory order will enforce any appropriate semantics as Acquire,...
A token to hold the scope of an ArrayHandle or other object.
Definition: Token.h:35
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 e...
Definition: ArrayHandle.h:618
#define VTKM_STATIC_ASSERT_MSG(condition, message)
Definition: StaticAssert.h:18
#define VTKM_CONT
Definition: ExportMacros.h:57
vtkm::Int64 Id
Base type to use to index arrays.
Definition: Types.h:227
signed long long Int64
Base type to use for 64-bit signed integer numbers.
Definition: Types.h:204
T ValueType
Definition: AtomicArrayExecutionObject.h:99
AtomicArrayExecutionObject()=default
An object used to specify a device.
Definition: DeviceAdapterTag.h:58
bool CompareExchange(vtkm::Id index, ValueType *oldValue, const ValueType &newValue, vtkm::MemoryOrder order=vtkm::MemoryOrder::SequentiallyConsistent) const
Perform an atomic compare and exchange operation with sequentially consistent memory ordering.
Definition: AtomicArrayExecutionObject.h:240
uint32_t UInt32
Base type to use for 32-bit unsigned integer numbers.
Definition: Types.h:185
Definition: AtomicArrayExecutionObject.h:94
float Float32
Base type to use for 32-bit floating-point numbers.
Definition: Types.h:157
unsigned long long UInt64
Base type to use for 64-bit signed integer numbers.
Definition: Types.h:207
int32_t Int32
Base type to use for 32-bit signed integer numbers.
Definition: Types.h:181
double Float64
Base type to use for 64-bit floating-point numbers.
Definition: Types.h:161
ValueType Get(vtkm::Id index, vtkm::MemoryOrder order=vtkm::MemoryOrder::Acquire) const
Perform an atomic load of the indexed element with acquire memory ordering.
Definition: AtomicArrayExecutionObject.h:128
AtomicArrayExecutionObject(vtkm::cont::ArrayHandle< T > handle, vtkm::cont::DeviceAdapterId device, vtkm::cont::Token &token)
Definition: AtomicArrayExecutionObject.h:103
bool AtomicCompareExchange(T *shared, T *expected, T desired, vtkm::MemoryOrder order=vtkm::MemoryOrder::SequentiallyConsistent)
Atomic function that replaces a value given a condition.
Definition: Atomic.h:976
@ Acquire
A load operation with Acquire memory order will enforce that any local read or write operations liste...
An object passed to a worklet when accessing an atomic array.
Definition: AtomicArrayExecutionObject.h:88
#define VTKM_SUPPRESS_EXEC_WARNINGS
Definition: ExportMacros.h:53
void AtomicStore(T *pointer, T value, vtkm::MemoryOrder order=vtkm::MemoryOrder::Release)
Atomic function to save a value to a shared memory location.
Definition: Atomic.h:800