VTK-m  2.2
Public Member Functions | Private Attributes | List of all members
vtkm::exec::arg::ThreadIndicesBasic Class Reference

Basic container for thread indices in a worklet invocation. More...

#include <ThreadIndicesBasic.h>

Inheritance diagram for vtkm::exec::arg::ThreadIndicesBasic:
vtkm::exec::arg::ThreadIndicesBasic3D vtkm::exec::arg::ThreadIndicesReduceByKey vtkm::exec::arg::ThreadIndicesTopologyMap< ConnectivityType, ScatterAndMaskMode >

Public Member Functions

 ThreadIndicesBasic (vtkm::Id threadIndex, vtkm::Id inIndex, vtkm::IdComponent visitIndex, vtkm::Id outIndex)
 
vtkm::Id GetThreadIndex () const
 The index of the thread or work invocation. More...
 
vtkm::Id GetInputIndex () const
 The index into the input domain. More...
 
vtkm::Id3 GetInputIndex3D () const
 The 3D index into the input domain. More...
 
vtkm::Id GetOutputIndex () const
 The index into the output domain. More...
 
vtkm::IdComponent GetVisitIndex () const
 The visit index. More...
 

Private Attributes

vtkm::Id ThreadIndex
 
vtkm::Id InputIndex
 
vtkm::Id OutputIndex
 
vtkm::IdComponent VisitIndex
 

Detailed Description

Basic container for thread indices in a worklet invocation.

During the execution of a worklet function in an execution environment thread, VTK-m has to manage several indices. To simplify this management and to provide a single place to store them (so that they do not have to be recomputed), WorkletInvokeFunctor creates a ThreadIndices object. This object gets passed to Fetch operations to help them load data.

All ThreadIndices classes should implement the functions provided in the ThreadIndicesBasic class. (It is in fact a good idea to subclass it.) Other ThreadIndices classes may provide additional indices if appropriate for the scheduling.

Constructor & Destructor Documentation

◆ ThreadIndicesBasic()

vtkm::exec::arg::ThreadIndicesBasic::ThreadIndicesBasic ( vtkm::Id  threadIndex,
vtkm::Id  inIndex,
vtkm::IdComponent  visitIndex,
vtkm::Id  outIndex 
)
inline

Member Function Documentation

◆ GetInputIndex()

vtkm::Id vtkm::exec::arg::ThreadIndicesBasic::GetInputIndex ( ) const
inline

The index into the input domain.

This index refers to the input element (array value, cell, etc.) that this thread is being invoked for. This is the typical index used during Fetch::Load.

◆ GetInputIndex3D()

vtkm::Id3 vtkm::exec::arg::ThreadIndicesBasic::GetInputIndex3D ( ) const
inline

The 3D index into the input domain.

This index refers to the input element (array value, cell, etc.) that this thread is being invoked for. If the input domain has 2 or 3 dimensional indexing, this result will preserve that. If the domain indexing is just one dimensional, the result will have the index in the first component with the remaining components set to 0.

◆ GetOutputIndex()

vtkm::Id vtkm::exec::arg::ThreadIndicesBasic::GetOutputIndex ( ) const
inline

The index into the output domain.

This index refers to the output element (array value, cell, etc.) that this thread is creating. This is the typical index used during Fetch::Store.

◆ GetThreadIndex()

vtkm::Id vtkm::exec::arg::ThreadIndicesBasic::GetThreadIndex ( ) const
inline

The index of the thread or work invocation.

This index refers to which instance of the worklet is being invoked. Every invocation of the worklet has a unique thread index. This is also called the work index depending on the context.

◆ GetVisitIndex()

vtkm::IdComponent vtkm::exec::arg::ThreadIndicesBasic::GetVisitIndex ( ) const
inline

The visit index.

When multiple output indices have the same input index, they are distinguished using the visit index.

Member Data Documentation

◆ InputIndex

vtkm::Id vtkm::exec::arg::ThreadIndicesBasic::InputIndex
private

◆ OutputIndex

vtkm::Id vtkm::exec::arg::ThreadIndicesBasic::OutputIndex
private

◆ ThreadIndex

vtkm::Id vtkm::exec::arg::ThreadIndicesBasic::ThreadIndex
private

◆ VisitIndex

vtkm::IdComponent vtkm::exec::arg::ThreadIndicesBasic::VisitIndex
private

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