VTK-m  2.0
Classes | Namespaces | Macros | Typedefs | Functions
DeviceAdapterTag.h File Reference
#include <vtkm/StaticAssert.h>
#include <vtkm/Types.h>
#include <vtkm/internal/Configure.h>
#include <vtkm/internal/ExportMacros.h>
#include <vtkm/cont/vtkm_cont_export.h>
#include <string>

Go to the source code of this file.

Classes

struct  vtkm::cont::DeviceAdapterId
 
struct  vtkm::cont::DeviceAdapterTraits< DeviceAdapter >
 

Namespaces

 vtkm
 Groups connected points that have the same field value.
 
 vtkm::cont
 VTK-m Control Environment.
 

Macros

#define VTKM_DEVICE_ADAPTER_UNDEFINED   -1
 
#define VTKM_DEVICE_ADAPTER_SERIAL   1
 
#define VTKM_DEVICE_ADAPTER_CUDA   2
 
#define VTKM_DEVICE_ADAPTER_TBB   3
 
#define VTKM_DEVICE_ADAPTER_OPENMP   4
 
#define VTKM_DEVICE_ADAPTER_KOKKOS   5
 
#define VTKM_MAX_DEVICE_ADAPTER_ID   8
 
#define VTKM_DEVICE_ADAPTER_ANY   127
 
#define VTKM_VALID_DEVICE_ADAPTER(Name, Id)
 Creates a tag named vtkm::cont::DeviceAdapterTagName and associated MPL structures to use this tag. More...
 
#define VTKM_INVALID_DEVICE_ADAPTER(Name, Id)
 Marks the tag named vtkm::cont::DeviceAdapterTagName and associated structures as invalid to use. More...
 
#define VTKM_IS_DEVICE_ADAPTER_TAG(tag)
 Checks that the argument is a proper device adapter tag. More...
 

Typedefs

using vtkm::cont::DeviceAdapterNameType = std::string
 

Functions

VTKM_CONT_EXPORT DeviceAdapterId vtkm::cont::make_DeviceAdapterId (const DeviceAdapterNameType &name)
 Construct a device adapter id from a runtime string The string is case-insensitive. More...
 
DeviceAdapterId vtkm::cont::make_DeviceAdapterId (vtkm::Int8 id)
 Construct a device adapter id a vtkm::Int8. More...
 

Macro Definition Documentation

◆ VTKM_DEVICE_ADAPTER_ANY

#define VTKM_DEVICE_ADAPTER_ANY   127

◆ VTKM_DEVICE_ADAPTER_CUDA

#define VTKM_DEVICE_ADAPTER_CUDA   2

◆ VTKM_DEVICE_ADAPTER_KOKKOS

#define VTKM_DEVICE_ADAPTER_KOKKOS   5

◆ VTKM_DEVICE_ADAPTER_OPENMP

#define VTKM_DEVICE_ADAPTER_OPENMP   4

◆ VTKM_DEVICE_ADAPTER_SERIAL

#define VTKM_DEVICE_ADAPTER_SERIAL   1

◆ VTKM_DEVICE_ADAPTER_TBB

#define VTKM_DEVICE_ADAPTER_TBB   3

◆ VTKM_DEVICE_ADAPTER_UNDEFINED

#define VTKM_DEVICE_ADAPTER_UNDEFINED   -1

◆ VTKM_INVALID_DEVICE_ADAPTER

#define VTKM_INVALID_DEVICE_ADAPTER (   Name,
  Id 
)
Value:
namespace vtkm \
{ \
namespace cont \
{ \
struct VTKM_ALWAYS_EXPORT DeviceAdapterTag##Name : DeviceAdapterId \
{ \
constexpr DeviceAdapterTag##Name() \
: DeviceAdapterId(Id) \
{ \
} \
static constexpr bool IsEnabled = false; \
}; \
template <> \
struct DeviceAdapterTraits<vtkm::cont::DeviceAdapterTag##Name> \
{ \
static DeviceAdapterNameType GetName() { return DeviceAdapterNameType(#Name); } \
}; \
} \
}

Marks the tag named vtkm::cont::DeviceAdapterTagName and associated structures as invalid to use.

Always use this macro (in the base namespace) when creating a device adapter.

◆ VTKM_IS_DEVICE_ADAPTER_TAG

#define VTKM_IS_DEVICE_ADAPTER_TAG (   tag)
Value:
static_assert(std::is_base_of<vtkm::cont::DeviceAdapterId, tag>::value && \
!std::is_same<vtkm::cont::DeviceAdapterId, tag>::value, \
"Provided type is not a valid VTK-m device adapter tag.")

Checks that the argument is a proper device adapter tag.

This is a handy concept check for functions and classes to make sure that a template argument is actually a device adapter tag. (You can get weird errors elsewhere in the code when a mistake is made.)

◆ VTKM_MAX_DEVICE_ADAPTER_ID

#define VTKM_MAX_DEVICE_ADAPTER_ID   8

◆ VTKM_VALID_DEVICE_ADAPTER

#define VTKM_VALID_DEVICE_ADAPTER (   Name,
  Id 
)
Value:
namespace vtkm \
{ \
namespace cont \
{ \
struct VTKM_ALWAYS_EXPORT DeviceAdapterTag##Name : DeviceAdapterId \
{ \
constexpr DeviceAdapterTag##Name() \
: DeviceAdapterId(Id) \
{ \
} \
static constexpr bool IsEnabled = true; \
}; \
template <> \
struct DeviceAdapterTraits<vtkm::cont::DeviceAdapterTag##Name> \
{ \
static DeviceAdapterNameType GetName() { return DeviceAdapterNameType(#Name); } \
}; \
} \
}

Creates a tag named vtkm::cont::DeviceAdapterTagName and associated MPL structures to use this tag.

Always use this macro (in the base namespace) when creating a device adapter.

vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
vtkm::Id
vtkm::Int32 Id
Represents an ID (index into arrays).
Definition: Types.h:191
vtkm::cont::DeviceAdapterNameType
std::string DeviceAdapterNameType
Definition: DeviceAdapterTag.h:50
VTKM_ALWAYS_EXPORT
#define VTKM_ALWAYS_EXPORT
Definition: ExportMacros.h:92