10 #ifndef vtk_m_cont_internal_DeviceAdapterListHelpers_h
11 #define vtk_m_cont_internal_DeviceAdapterListHelpers_h
25 struct ExecuteIfValidDeviceTag
28 template <
typename DeviceAdapter>
29 using EnableIfValid = std::enable_if<DeviceAdapter::IsEnabled>;
31 template <
typename DeviceAdapter>
32 using EnableIfInvalid = std::enable_if<!DeviceAdapter::IsEnabled>;
34 template <
typename DeviceAdapter,
typename Functor,
typename... Args>
35 typename EnableIfValid<DeviceAdapter>::type operator()(
43 f(device, std::forward<Args>(args)...);
48 template <
typename DeviceAdapter,
typename... Args>
49 typename EnableIfInvalid<DeviceAdapter>::type operator()(DeviceAdapter, Args&&...)
const
56 template <
typename DeviceList,
typename Functor,
typename... Args>
57 VTKM_CONT void ForEachValidDevice(DeviceList devices, Functor&& functor, Args&&... args)
61 ExecuteIfValidDeviceTag{}, devices, functor, tracker, std::forward<Args>(args)...);
67 #endif // vtk_m_cont_internal_DeviceAdapterListHelpers_h