Viskores  1.0
AtomicArray.h
Go to the documentation of this file.
1 //============================================================================
2 // The contents of this file are covered by the Viskores license. See
3 // LICENSE.txt for details.
4 //
5 // By contributing to this file, all contributors agree to the Developer
6 // Certificate of Origin Version 1.1 (DCO 1.1) as stated in DCO.txt.
7 //============================================================================
8 
9 //============================================================================
10 // Copyright (c) Kitware, Inc.
11 // All rights reserved.
12 // See LICENSE.txt for details.
13 //
14 // This software is distributed WITHOUT ANY WARRANTY; without even
15 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
16 // PURPOSE. See the above copyright notice for more information.
17 //============================================================================
18 #ifndef viskores_cont_AtomicArray_h
19 #define viskores_cont_AtomicArray_h
20 
21 #include <viskores/List.h>
22 #include <viskores/StaticAssert.h>
27 
28 namespace viskores
29 {
30 namespace cont
31 {
32 
36 using AtomicArrayTypeList = viskores::List<viskores::UInt32,
43 
44 
60 template <typename T>
62 {
64  VISKORES_STATIC_ASSERT_MSG(ValueTypeIsValid, "AtomicArray used with unsupported ValueType.");
65 
66 
67 public:
68  using ValueType = T;
69 
72  : Handle(viskores::cont::ArrayHandle<T>())
73  {
74  }
75 
77  : Handle(handle)
78  {
79  }
80 
83  viskores::cont::Token& token) const
84  {
85  return viskores::exec::AtomicArrayExecutionObject<T>(this->Handle, device, token);
86  }
87 
88 private:
92 };
93 }
94 } // namespace viskores::exec
95 
96 #endif //viskores_cont_AtomicArray_h
ArrayHandle.h
viskores::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:596
viskores::cont::ArrayHandle
Manages an array-worth of data.
Definition: ArrayHandle.h:313
viskores::cont::AtomicArray
A type list containing types that can be used with an AtomicArray.
Definition: AtomicArray.h:61
viskores::cont::AtomicArray::AtomicArray
AtomicArray()
Definition: AtomicArray.h:71
viskores::List
A template used to hold a list of types.
Definition: List.h:47
viskores::Int64
signed long long Int64
Base type to use for 64-bit signed integer numbers.
Definition: Types.h:212
DeviceAdapter.h
AtomicArrayExecutionObject.h
VISKORES_CONT
#define VISKORES_CONT
Definition: ExportMacros.h:65
viskores
Groups connected points that have the same field value.
Definition: Atomic.h:27
viskores::cont::AtomicArray::AtomicArray
AtomicArray(viskores::cont::ArrayHandle< T > handle)
Definition: AtomicArray.h:76
viskores::Float32
float Float32
Base type to use for 32-bit floating-point numbers.
Definition: Types.h:165
viskores::cont::AtomicArray::ValueType
T ValueType
Definition: AtomicArray.h:68
VISKORES_STATIC_ASSERT_MSG
#define VISKORES_STATIC_ASSERT_MSG(condition, message)
Definition: StaticAssert.h:26
viskores::UInt64
unsigned long long UInt64
Base type to use for 64-bit signed integer numbers.
Definition: Types.h:215
viskores::cont::DeviceAdapterId
An object used to specify a device.
Definition: DeviceAdapterTag.h:66
viskores::Int32
int32_t Int32
Base type to use for 32-bit signed integer numbers.
Definition: Types.h:189
viskores::cont::AtomicArray::PrepareForExecution
viskores::exec::AtomicArrayExecutionObject< T > PrepareForExecution(viskores::cont::DeviceAdapterId device, viskores::cont::Token &token) const
Definition: AtomicArray.h:81
StaticAssert.h
viskores::exec::AtomicArrayExecutionObject
An object passed to a worklet when accessing an atomic array.
Definition: AtomicArrayExecutionObject.h:96
viskores::Float64
double Float64
Base type to use for 64-bit floating-point numbers.
Definition: Types.h:169
ExecutionObjectBase.h
viskores::cont::Token
A token to hold the scope of an ArrayHandle or other object.
Definition: Token.h:43
viskores::cont::ExecutionObjectBase
Base ExecutionObjectBase for execution objects to inherit from so that you can use an arbitrary objec...
Definition: ExecutionObjectBase.h:39
viskores::cont::AtomicArray::ValueTypeIsValid
static constexpr bool ValueTypeIsValid
Definition: AtomicArray.h:63
viskores::UInt32
uint32_t UInt32
Base type to use for 32-bit unsigned integer numbers.
Definition: Types.h:193
List.h