Viskores  1.0
Public Member Functions | Protected Member Functions | Private Attributes | Friends | List of all members
viskores::cont::DeviceAdapterId Struct Reference

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

#include <DeviceAdapterTag.h>

Inheritance diagram for viskores::cont::DeviceAdapterId:
viskores::cont::DeviceAdapterTagAny viskores::cont::DeviceAdapterTagCuda viskores::cont::DeviceAdapterTagKokkos viskores::cont::DeviceAdapterTagOpenMP viskores::cont::DeviceAdapterTagSerial viskores::cont::DeviceAdapterTagTBB viskores::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 viskores::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 (viskores::Int8 id)
 

Private Attributes

viskores::Int8 Value
 

Friends

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

Detailed Description

An object used to specify a device.

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

Constructor & Destructor Documentation

◆ DeviceAdapterId()

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

Member Function Documentation

◆ GetName()

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

Return a name representing the device.

The string returned from this method is stored in a type named viskores::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 viskores::Int8 viskores::cont::DeviceAdapterId::GetValue ( ) const
inlineconstexpr

Returns the numeric value of the index.

◆ IsValueValid()

constexpr bool viskores::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 Viskores build configuration.

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

◆ operator!=()

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

◆ operator<()

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

◆ operator==()

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

Friends And Related Function Documentation

◆ make_DeviceAdapterId

DeviceAdapterId make_DeviceAdapterId ( viskores::Int8  id)
friend

Construct a device adapter id a viskores::Int8.

The mapping of integer value to devices are:

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

Member Data Documentation

◆ Value

viskores::Int8 viskores::cont::DeviceAdapterId::Value
private

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