18 #ifndef viskores_cont_internal_DeviceAdapterListHelpers_h
19 #define viskores_cont_internal_DeviceAdapterListHelpers_h
33 struct ExecuteIfValidDeviceTag
36 template <
typename DeviceAdapter>
37 using EnableIfValid = std::enable_if<DeviceAdapter::IsEnabled>;
39 template <
typename DeviceAdapter>
40 using EnableIfInvalid = std::enable_if<!DeviceAdapter::IsEnabled>;
42 template <
typename DeviceAdapter,
typename Functor,
typename... Args>
43 typename EnableIfValid<DeviceAdapter>::type operator()(
51 f(device, std::forward<Args>(args)...);
56 template <
typename DeviceAdapter,
typename... Args>
57 typename EnableIfInvalid<DeviceAdapter>::type operator()(DeviceAdapter, Args&&...)
const
64 template <
typename DeviceList,
typename Functor,
typename... Args>
65 VISKORES_CONT void ForEachValidDevice(DeviceList devices, Functor&& functor, Args&&... args)
69 ExecuteIfValidDeviceTag{}, devices, functor, tracker, std::forward<Args>(args)...);
75 #endif // viskores_cont_internal_DeviceAdapterListHelpers_h