VTK-m  2.2
AtomicArray.h
Go to the documentation of this file.
1 //============================================================================
2 // Copyright (c) Kitware, Inc.
3 // All rights reserved.
4 // See LICENSE.txt for details.
5 //
6 // This software is distributed WITHOUT ANY WARRANTY; without even
7 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8 // PURPOSE. See the above copyright notice for more information.
9 //============================================================================
10 #ifndef vtk_m_cont_AtomicArray_h
11 #define vtk_m_cont_AtomicArray_h
12 
13 #include <vtkm/List.h>
14 #include <vtkm/StaticAssert.h>
15 #include <vtkm/cont/ArrayHandle.h>
19 
20 namespace vtkm
21 {
22 namespace cont
23 {
24 
28 using AtomicArrayTypeList =
31 
32 
48 template <typename T>
50 {
52  VTKM_STATIC_ASSERT_MSG(ValueTypeIsValid, "AtomicArray used with unsupported ValueType.");
53 
54 
55 public:
56  using ValueType = T;
57 
58  VTKM_CONT
60  : Handle(vtkm::cont::ArrayHandle<T>())
61  {
62  }
63 
65  : Handle(handle)
66  {
67  }
68 
71  vtkm::cont::Token& token) const
72  {
73  return vtkm::exec::AtomicArrayExecutionObject<T>(this->Handle, device, token);
74  }
75 
76 private:
80 };
81 }
82 } // namespace vtkm::exec
83 
84 #endif //vtk_m_cont_AtomicArray_h
vtkm::cont::AtomicArray::PrepareForExecution
vtkm::exec::AtomicArrayExecutionObject< T > PrepareForExecution(vtkm::cont::DeviceAdapterId device, vtkm::cont::Token &token) const
Definition: AtomicArray.h:69
vtkm::cont::ArrayHandle
Manages an array-worth of data.
Definition: ArrayHandle.h:300
ArrayHandle.h
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
vtkm::cont::AtomicArray::AtomicArray
AtomicArray()
Definition: AtomicArray.h:59
DeviceAdapter.h
vtkm::cont::Token
A token to hold the scope of an ArrayHandle or other object.
Definition: Token.h:35
AtomicArrayExecutionObject.h
vtkm::cont::AtomicArray::ValueType
T ValueType
Definition: AtomicArray.h:56
vtkm::cont::AtomicArray::ValueTypeIsValid
static constexpr bool ValueTypeIsValid
Definition: AtomicArray.h:51
vtkm::ListHas
typename detail::ListHasImpl< List, T >::type ListHas
Checks to see if the given T is in the list pointed to by List.
Definition: List.h:577
VTKM_STATIC_ASSERT_MSG
#define VTKM_STATIC_ASSERT_MSG(condition, message)
Definition: StaticAssert.h:18
VTKM_CONT
#define VTKM_CONT
Definition: ExportMacros.h:57
vtkm::cont::ExecutionObjectBase
Base ExecutionObjectBase for execution objects to inherit from so that you can use an arbitrary objec...
Definition: ExecutionObjectBase.h:31
vtkm::cont::DeviceAdapterId
An object used to specify a device.
Definition: DeviceAdapterTag.h:58
StaticAssert.h
vtkm::List
A template used to hold a list of types.
Definition: List.h:39
vtkm::exec::AtomicArrayExecutionObject
An object passed to a worklet when accessing an atomic array.
Definition: AtomicArrayExecutionObject.h:88
ExecutionObjectBase.h
vtkm::cont::AtomicArray
A type list containing types that can be used with an AtomicArray.
Definition: AtomicArray.h:49
vtkm::cont::AtomicArray::AtomicArray
AtomicArray(vtkm::cont::ArrayHandle< T > handle)
Definition: AtomicArray.h:64
List.h