18 #ifndef viskores_cont_Invoker_h
19 #define viskores_cont_Invoker_h
34 using scatter_or_mask = std::integral_constant<bool,
35 viskores::worklet::internal::is_mask<T>::value ||
36 viskores::worklet::internal::is_scatter<T>::value>;
72 template <
typename Worklet,
75 typename std::enable_if<detail::scatter_or_mask<T>::value,
int>::type* =
nullptr>
76 inline void operator()(Worklet&& worklet, T&& scatterOrMask, Args&&... args)
const
78 using WorkletType = viskores::internal::remove_cvref<Worklet>;
79 using DispatcherType =
typename WorkletType::template Dispatcher<WorkletType>;
81 DispatcherType dispatcher(worklet, scatterOrMask);
82 dispatcher.SetDevice(this->
DeviceId);
83 dispatcher.Invoke(std::forward<Args>(args)...);
96 typename std::enable_if<detail::scatter_or_mask<T>::value && detail::scatter_or_mask<U>::value,
97 int>::type* =
nullptr>
101 Args&&... args)
const
103 using WorkletType = viskores::internal::remove_cvref<Worklet>;
104 using DispatcherType =
typename WorkletType::template Dispatcher<WorkletType>;
106 DispatcherType dispatcher(worklet, scatterOrMaskA, scatterOrMaskB);
107 dispatcher.SetDevice(this->
DeviceId);
108 dispatcher.Invoke(std::forward<Args>(args)...);
115 template <
typename Worklet,
118 typename std::enable_if<!detail::scatter_or_mask<T>::value,
int>::type* =
nullptr>
119 inline void operator()(Worklet&& worklet, T&& t, Args&&... args)
const
121 using WorkletType = viskores::internal::remove_cvref<Worklet>;
122 using DispatcherType =
typename WorkletType::template Dispatcher<WorkletType>;
124 DispatcherType dispatcher(worklet);
125 dispatcher.SetDevice(this->
DeviceId);
126 dispatcher.Invoke(std::forward<T>(t), std::forward<Args>(args)...);