VTK-m  2.2
Public Member Functions | Protected Member Functions | Private Attributes | Friends | List of all members
vtkm::cont::DeviceAdapterId Struct Reference

An object used to specify a device. More...

#include <DeviceAdapterTag.h>

Inheritance diagram for vtkm::cont::DeviceAdapterId:
vtkm::cont::DeviceAdapterTagAny vtkm::cont::DeviceAdapterTagCuda vtkm::cont::DeviceAdapterTagKokkos vtkm::cont::DeviceAdapterTagOpenMP vtkm::cont::DeviceAdapterTagSerial vtkm::cont::DeviceAdapterTagTBB vtkm::cont::DeviceAdapterTagUndefined

Public Member Functions

constexpr bool operator== (DeviceAdapterId other) const
 
constexpr bool operator!= (DeviceAdapterId other) const
 
constexpr bool operator< (DeviceAdapterId other) const
 
constexpr bool IsValueValid () const
 Return whether this object represents a valid type of device. More...
 
constexpr vtkm::Int8 GetValue () const
 Returns the numeric value of the index. More...
 
DeviceAdapterNameType GetName () const
 Return a name representing the device. More...
 

Protected Member Functions

constexpr DeviceAdapterId (vtkm::Int8 id)
 

Private Attributes

vtkm::Int8 Value
 

Friends

DeviceAdapterId make_DeviceAdapterId (vtkm::Int8 id)
 Construct a device adapter id a vtkm::Int8. More...
 

Detailed Description

An object used to specify a device.

vtkm::cont::DeviceAdapterId can be used to specify a device to use when executing some code. Each DeviceAdapterTag object inherits from vtkm::cont::DeviceAdapterId. Functions can accept a vtkm::cont::DeviceAdapterId object rather than a templated tag to select a device adapter at runtime.

Constructor & Destructor Documentation

◆ DeviceAdapterId()

constexpr vtkm::cont::DeviceAdapterId::DeviceAdapterId ( vtkm::Int8  id)
inlineexplicitconstexprprotected

Member Function Documentation

◆ GetName()

DeviceAdapterNameType vtkm::cont::DeviceAdapterId::GetName ( ) const

Return a name representing the device.

The string returned from this method is stored in a type named vtkm::cont::DeviceAdapterNameType, which is currently aliased to std::string. The device adapter name is useful for printing information about a device being used.

◆ GetValue()

constexpr vtkm::Int8 vtkm::cont::DeviceAdapterId::GetValue ( ) const
inlineconstexpr

Returns the numeric value of the index.

◆ IsValueValid()

constexpr bool vtkm::cont::DeviceAdapterId::IsValueValid ( ) const
inlineconstexpr

Return whether this object represents a valid type of device.

This method will return true if the id represents a specific, valid device. It will return true even if the device is disabled in by the runtime tracker or if the device is not supported by the VTK-m build configuration.

It should be noted that this method return false for tags that are not specific devices. This includes vtkm::cont::DeviceAdapterTagAny and vtkm::cont::DeviceAdapterTagUndefined.

◆ operator!=()

constexpr bool vtkm::cont::DeviceAdapterId::operator!= ( DeviceAdapterId  other) const
inlineconstexpr

◆ operator<()

constexpr bool vtkm::cont::DeviceAdapterId::operator< ( DeviceAdapterId  other) const
inlineconstexpr

◆ operator==()

constexpr bool vtkm::cont::DeviceAdapterId::operator== ( DeviceAdapterId  other) const
inlineconstexpr

Friends And Related Function Documentation

◆ make_DeviceAdapterId

DeviceAdapterId make_DeviceAdapterId ( vtkm::Int8  id)
friend

Construct a device adapter id a vtkm::Int8.

The mapping of integer value to devices are:

DeviceAdapterTagSerial == 1 DeviceAdapterTagCuda == 2 DeviceAdapterTagTBB == 3 DeviceAdapterTagOpenMP == 4 DeviceAdapterTagKokkos == 5

Member Data Documentation

◆ Value

vtkm::Int8 vtkm::cont::DeviceAdapterId::Value
private

The documentation for this struct was generated from the following file: