Go to the documentation of this file.
10 #ifndef vtk_m_cont_DeviceAdapterTag_h
11 #define vtk_m_cont_DeviceAdapterTag_h
15 #include <vtkm/internal/Configure.h>
18 #include <vtkm/cont/vtkm_cont_export.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
99 template <
typename DeviceAdapter>
107 #define VTKM_VALID_DEVICE_ADAPTER(Name, Id) \
112 struct VTKM_ALWAYS_EXPORT DeviceAdapterTag##Name : DeviceAdapterId \
114 constexpr DeviceAdapterTag##Name() \
115 : DeviceAdapterId(Id) \
118 static constexpr bool IsEnabled = true; \
121 struct DeviceAdapterTraits<vtkm::cont::DeviceAdapterTag##Name> \
123 static DeviceAdapterNameType GetName() { return DeviceAdapterNameType(#Name); } \
131 #define VTKM_INVALID_DEVICE_ADAPTER(Name, Id) \
136 struct VTKM_ALWAYS_EXPORT DeviceAdapterTag##Name : DeviceAdapterId \
138 constexpr DeviceAdapterTag##Name() \
139 : DeviceAdapterId(Id) \
142 static constexpr bool IsEnabled = false; \
145 struct DeviceAdapterTraits<vtkm::cont::DeviceAdapterTag##Name> \
147 static DeviceAdapterNameType GetName() { return DeviceAdapterNameType(#Name); } \
159 #define VTKM_IS_DEVICE_ADAPTER_TAG(tag) \
165 static_assert(std::is_base_of<vtkm::cont::DeviceAdapterId, tag>::value && \
166 !std::is_same<vtkm::cont::DeviceAdapterId, tag>::value, \
167 "Provided type is not a valid VTK-m device adapter tag.")
169 #endif //vtk_m_cont_DeviceAdapterTag_h
Definition: DeviceAdapterTag.h:100
#define VTKM_DEVICE_ADAPTER_ANY
Definition: DeviceAdapterTag.h:43
Groups connected points that have the same field value.
Definition: Atomic.h:19
constexpr vtkm::Int8 GetValue() const
Definition: DeviceAdapterTag.h:63
constexpr bool operator<(DeviceAdapterId other) const
Definition: DeviceAdapterTag.h:56
constexpr bool IsValueValid() const
Definition: DeviceAdapterTag.h:58
constexpr bool operator!=(DeviceAdapterId other) const
Definition: DeviceAdapterTag.h:55
int8_t Int8
Definition: Types.h:156
std::string DeviceAdapterNameType
Definition: DeviceAdapterTag.h:50
VTKM_CONT_EXPORT DeviceAdapterId make_DeviceAdapterId(const DeviceAdapterNameType &name)
Construct a device adapter id from a runtime string The string is case-insensitive.
Definition: DeviceAdapterTag.h:52
constexpr bool operator==(DeviceAdapterId other) const
Definition: DeviceAdapterTag.h:54
#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:107
#define VTKM_INVALID_DEVICE_ADAPTER(Name, Id)
Marks the tag named vtkm::cont::DeviceAdapterTagName and associated structures as invalid to use.
Definition: DeviceAdapterTag.h:131
VTKM_CONT_EXPORT DeviceAdapterNameType GetName() const
friend DeviceAdapterId make_DeviceAdapterId(vtkm::Int8 id)
Construct a device adapter id a vtkm::Int8.
Definition: DeviceAdapterTag.h:94
constexpr DeviceAdapterId(vtkm::Int8 id)
Definition: DeviceAdapterTag.h:71
vtkm::Int8 Value
Definition: DeviceAdapterTag.h:77
#define VTKM_DEVICE_ADAPTER_UNDEFINED
Definition: DeviceAdapterTag.h:35