Merge topic 'hide_devid_constructor'
024a75821 Make DeviceAdapterId constructor protected. Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Robert Maynard <robert.maynard@kitware.com> Merge-request: !1380
This commit is contained in:
commit
5a26f66bba
@ -31,7 +31,7 @@ namespace internal
|
||||
|
||||
DeviceAdapterId ExecutionArrayInterfaceBasic<DeviceAdapterTagCuda>::GetDeviceId() const
|
||||
{
|
||||
return DeviceAdapterId(VTKM_DEVICE_ADAPTER_CUDA);
|
||||
return DeviceAdapterTagCuda{};
|
||||
}
|
||||
|
||||
void ExecutionArrayInterfaceBasic<DeviceAdapterTagCuda>::Allocate(TypelessExecutionArray& execArray,
|
||||
|
@ -44,11 +44,6 @@ namespace cont
|
||||
|
||||
struct DeviceAdapterId
|
||||
{
|
||||
constexpr explicit DeviceAdapterId(vtkm::Int8 id)
|
||||
: Value(id)
|
||||
{
|
||||
}
|
||||
|
||||
constexpr bool operator==(DeviceAdapterId other) const { return this->Value == other.Value; }
|
||||
constexpr bool operator!=(DeviceAdapterId other) const { return this->Value != other.Value; }
|
||||
constexpr bool operator<(DeviceAdapterId other) const { return this->Value < other.Value; }
|
||||
@ -60,6 +55,12 @@ struct DeviceAdapterId
|
||||
|
||||
constexpr vtkm::Int8 GetValue() const { return this->Value; }
|
||||
|
||||
protected:
|
||||
constexpr explicit DeviceAdapterId(vtkm::Int8 id)
|
||||
: Value(id)
|
||||
{
|
||||
}
|
||||
|
||||
private:
|
||||
vtkm::Int8 Value;
|
||||
};
|
||||
|
@ -28,7 +28,7 @@ namespace internal
|
||||
|
||||
DeviceAdapterId ExecutionArrayInterfaceBasic<DeviceAdapterTagOpenMP>::GetDeviceId() const
|
||||
{
|
||||
return DeviceAdapterId(VTKM_DEVICE_ADAPTER_OPENMP);
|
||||
return DeviceAdapterTagOpenMP{};
|
||||
}
|
||||
|
||||
} // namespace internal
|
||||
|
@ -27,7 +27,7 @@ namespace internal
|
||||
{
|
||||
DeviceAdapterId ExecutionArrayInterfaceBasic<DeviceAdapterTagSerial>::GetDeviceId() const
|
||||
{
|
||||
return DeviceAdapterId(VTKM_DEVICE_ADAPTER_SERIAL);
|
||||
return DeviceAdapterTagSerial{};
|
||||
}
|
||||
|
||||
} // namespace internal
|
||||
|
@ -27,7 +27,7 @@ namespace internal
|
||||
{
|
||||
DeviceAdapterId ExecutionArrayInterfaceBasic<DeviceAdapterTagTBB>::GetDeviceId() const
|
||||
{
|
||||
return DeviceAdapterId(VTKM_DEVICE_ADAPTER_TBB);
|
||||
return DeviceAdapterTagTBB{};
|
||||
}
|
||||
|
||||
} // namespace internal
|
||||
|
@ -131,7 +131,7 @@ struct ExecutionArrayInterfaceBasic<DeviceAdapterTagTestAlgorithmGeneral>
|
||||
using ExecutionArrayInterfaceBasicShareWithControl::ExecutionArrayInterfaceBasicShareWithControl;
|
||||
|
||||
VTKM_CONT
|
||||
DeviceAdapterId GetDeviceId() const final { return DeviceAdapterId(7); }
|
||||
DeviceAdapterId GetDeviceId() const final { return DeviceAdapterTagTestAlgorithmGeneral{}; }
|
||||
};
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user