Allow runtime construction of DeviceAdapterId

When need some way to convert user input such as an integer or
string to a device adapter id. This allows for integer to
device adapter id.
This commit is contained in:
Robert Maynard 2018-10-03 13:42:34 -04:00
parent 5a25131aa1
commit a512cd495e

@ -63,6 +63,8 @@ struct DeviceAdapterId
DeviceAdapterNameType GetName() const;
protected:
friend DeviceAdapterId make_DeviceAdapterId(vtkm::Int8 id);
constexpr explicit DeviceAdapterId(vtkm::Int8 id)
: Value(id)
{
@ -72,6 +74,11 @@ private:
vtkm::Int8 Value;
};
DeviceAdapterId make_DeviceAdapterId(vtkm::Int8 id)
{
return DeviceAdapterId(id);
}
template <typename DeviceAdapter>
struct DeviceAdapterTraits;
}