Go to the documentation of this file.
10 #ifndef vtk_m_cont_DeviceAdapterTag_h
11 #define vtk_m_cont_DeviceAdapterTag_h
22 #ifdef VTKM_DEVICE_ADAPTER
26 #error The VTKM_DEVICE_ADAPTER define is no longer obeyed and needs to be removed
28 #ifdef VTKM_DEFAULT_DEVICE_ADAPTER_TAG
32 #error The VTKM_DEFAULT_DEVICE_ADAPTER_TAG define is no longer required and needs to be removed
35 #define VTKM_DEVICE_ADAPTER_UNDEFINED -1
36 #define VTKM_DEVICE_ADAPTER_SERIAL 1
37 #define VTKM_DEVICE_ADAPTER_CUDA 2
38 #define VTKM_DEVICE_ADAPTER_TBB 3
39 #define VTKM_DEVICE_ADAPTER_OPENMP 4
40 #define VTKM_DEVICE_ADAPTER_KOKKOS 5
42 #define VTKM_MAX_DEVICE_ADAPTER_ID 8
43 #define VTKM_DEVICE_ADAPTER_ANY 127
121 template <
typename DeviceAdapter>
129 #define VTKM_VALID_DEVICE_ADAPTER(Name, Id) \
134 struct VTKM_ALWAYS_EXPORT DeviceAdapterTag##Name : DeviceAdapterId \
136 constexpr DeviceAdapterTag##Name() \
137 : DeviceAdapterId(Id) \
140 static constexpr bool IsEnabled = true; \
143 struct DeviceAdapterTraits<vtkm::cont::DeviceAdapterTag##Name> \
145 static DeviceAdapterNameType GetName() { return DeviceAdapterNameType(#Name); } \
153 #define VTKM_INVALID_DEVICE_ADAPTER(Name, Id) \
158 struct VTKM_ALWAYS_EXPORT DeviceAdapterTag##Name : DeviceAdapterId \
160 constexpr DeviceAdapterTag##Name() \
161 : DeviceAdapterId(Id) \
164 static constexpr bool IsEnabled = false; \
167 struct DeviceAdapterTraits<vtkm::cont::DeviceAdapterTag##Name> \
169 static DeviceAdapterNameType GetName() { return DeviceAdapterNameType(#Name); } \
194 #define VTKM_IS_DEVICE_ADAPTER_TAG(tag) \
195 static_assert(std::is_base_of<vtkm::cont::DeviceAdapterId, tag>::value && \
196 !std::is_same<vtkm::cont::DeviceAdapterId, tag>::value, \
197 "Provided type is not a valid VTK-m device adapter tag.")
199 #endif //vtk_m_cont_DeviceAdapterTag_h
Definition: DeviceAdapterTag.h:122
#define VTKM_DEVICE_ADAPTER_ANY
Definition: DeviceAdapterTag.h:43
DeviceAdapterNameType GetName() const
Return a name representing the device.
Groups connected points that have the same field value.
Definition: Atomic.h:19
constexpr vtkm::Int8 GetValue() const
Returns the numeric value of the index.
Definition: DeviceAdapterTag.h:79
constexpr bool operator<(DeviceAdapterId other) const
Definition: DeviceAdapterTag.h:62
DeviceAdapterId make_DeviceAdapterId(const DeviceAdapterNameType &name)
Construct a device adapter id from a runtime string The string is case-insensitive.
constexpr bool IsValueValid() const
Return whether this object represents a valid type of device.
Definition: DeviceAdapterTag.h:73
constexpr bool operator!=(DeviceAdapterId other) const
Definition: DeviceAdapterTag.h:61
int8_t Int8
Base type to use for 8-bit signed integer numbers.
Definition: Types.h:165
#define VTKM_CONT_EXPORT
Definition: vtkm_cont_export.h:44
std::string DeviceAdapterNameType
Definition: DeviceAdapterTag.h:50
An object used to specify a device.
Definition: DeviceAdapterTag.h:58
constexpr bool operator==(DeviceAdapterId other) const
Definition: DeviceAdapterTag.h:60
#define VTKM_MAX_DEVICE_ADAPTER_ID
Definition: DeviceAdapterTag.h:42
#define VTKM_VALID_DEVICE_ADAPTER(Name, Id)
Creates a tag named vtkm::cont::DeviceAdapterTagName and associated MPL structures to use this tag.
Definition: DeviceAdapterTag.h:129
#define VTKM_INVALID_DEVICE_ADAPTER(Name, Id)
Marks the tag named vtkm::cont::DeviceAdapterTagName and associated structures as invalid to use.
Definition: DeviceAdapterTag.h:153
friend DeviceAdapterId make_DeviceAdapterId(vtkm::Int8 id)
Construct a device adapter id a vtkm::Int8.
Definition: DeviceAdapterTag.h:116
constexpr DeviceAdapterId(vtkm::Int8 id)
Definition: DeviceAdapterTag.h:93
vtkm::Int8 Value
Definition: DeviceAdapterTag.h:99
#define VTKM_DEVICE_ADAPTER_UNDEFINED
Definition: DeviceAdapterTag.h:35