VTK-m  2.2
Public Member Functions | Private Attributes | List of all members
vtkm::cont::Invoker Struct Reference

Allows launching any worklet without a dispatcher. More...

#include <Invoker.h>

Public Member Functions

 Invoker ()
 Constructs an Invoker that will try to launch worklets on any device that is enabled. More...
 
 Invoker (vtkm::cont::DeviceAdapterId device)
 Constructs an Invoker that will try to launch worklets only on the provided device adapter. More...
 
template<typename Worklet , typename T , typename... Args, typename std::enable_if< detail::scatter_or_mask< T >::value, int >::type * = nullptr>
void operator() (Worklet &&worklet, T &&scatterOrMask, Args &&... args) const
 Launch the worklet that is provided as the first parameter. More...
 
template<typename Worklet , typename T , typename U , typename... Args, typename std::enable_if< detail::scatter_or_mask< T >::value &&detail::scatter_or_mask< U >::value, int >::type * = nullptr>
void operator() (Worklet &&worklet, T &&scatterOrMaskA, U &&scatterOrMaskB, Args &&... args) const
 Launch the worklet that is provided as the first parameter. More...
 
template<typename Worklet , typename T , typename... Args, typename std::enable_if<!detail::scatter_or_mask< T >::value, int >::type * = nullptr>
void operator() (Worklet &&worklet, T &&t, Args &&... args) const
 Launch the worklet that is provided as the first parameter. More...
 
vtkm::cont::DeviceAdapterId GetDevice () const
 Get the device adapter that this Invoker is bound too. More...
 

Private Attributes

vtkm::cont::DeviceAdapterId DeviceId
 

Detailed Description

Allows launching any worklet without a dispatcher.

Invoker is a generalized Dispatcher that is able to automatically determine how to properly launch/invoke any worklet that is passed to it. When an Invoker is constructed it is provided the desired device adapter that all worklets invoked by it should be launched on.

Invoker is designed to not only reduce the verbosity of constructing multiple dispatchers inside a block of logic, but also makes it easier to make sure all worklets execute on the same device.

Constructor & Destructor Documentation

◆ Invoker() [1/2]

vtkm::cont::Invoker::Invoker ( )
inlineexplicit

Constructs an Invoker that will try to launch worklets on any device that is enabled.

◆ Invoker() [2/2]

vtkm::cont::Invoker::Invoker ( vtkm::cont::DeviceAdapterId  device)
inlineexplicit

Constructs an Invoker that will try to launch worklets only on the provided device adapter.

Member Function Documentation

◆ GetDevice()

vtkm::cont::DeviceAdapterId vtkm::cont::Invoker::GetDevice ( ) const
inline

Get the device adapter that this Invoker is bound too.

◆ operator()() [1/3]

template<typename Worklet , typename T , typename... Args, typename std::enable_if< detail::scatter_or_mask< T >::value, int >::type * = nullptr>
void vtkm::cont::Invoker::operator() ( Worklet &&  worklet,
T &&  scatterOrMask,
Args &&...  args 
) const
inline

Launch the worklet that is provided as the first parameter.

Optional second parameter is either the scatter or mask type associated with the worklet. Any additional parameters are the ControlSignature arguments for the worklet.

◆ operator()() [2/3]

template<typename Worklet , typename T , typename U , typename... Args, typename std::enable_if< detail::scatter_or_mask< T >::value &&detail::scatter_or_mask< U >::value, int >::type * = nullptr>
void vtkm::cont::Invoker::operator() ( Worklet &&  worklet,
T &&  scatterOrMaskA,
U &&  scatterOrMaskB,
Args &&...  args 
) const
inline

Launch the worklet that is provided as the first parameter.

Optional second parameter is either the scatter or mask type associated with the worklet. Optional third parameter is either the scatter or mask type associated with the worklet. Any additional parameters are the ControlSignature arguments for the worklet.

◆ operator()() [3/3]

template<typename Worklet , typename T , typename... Args, typename std::enable_if<!detail::scatter_or_mask< T >::value, int >::type * = nullptr>
void vtkm::cont::Invoker::operator() ( Worklet &&  worklet,
T &&  t,
Args &&...  args 
) const
inline

Launch the worklet that is provided as the first parameter.

Optional second parameter is either the scatter or mask type associated with the worklet. Any additional parameters are the ControlSignature arguments for the worklet.

Member Data Documentation

◆ DeviceId

vtkm::cont::DeviceAdapterId vtkm::cont::Invoker::DeviceId
private

The documentation for this struct was generated from the following file: