Viskores  1.0
WorkIndex.h
Go to the documentation of this file.
1 //============================================================================
2 // The contents of this file are covered by the Viskores license. See
3 // LICENSE.txt for details.
4 //
5 // By contributing to this file, all contributors agree to the Developer
6 // Certificate of Origin Version 1.1 (DCO 1.1) as stated in DCO.txt.
7 //============================================================================
8 
9 //============================================================================
10 // Copyright (c) Kitware, Inc.
11 // All rights reserved.
12 // See LICENSE.txt for details.
13 //
14 // This software is distributed WITHOUT ANY WARRANTY; without even
15 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
16 // PURPOSE. See the above copyright notice for more information.
17 //============================================================================
18 #ifndef viskores_exec_arg_WorkIndex_h
19 #define viskores_exec_arg_WorkIndex_h
20 
23 
24 namespace viskores
25 {
26 namespace exec
27 {
28 namespace arg
29 {
30 
37 {
38 };
39 
48 {
49  // The index does not really matter because the fetch is going to ignore it.
50  // However, it still has to point to a valid parameter in the
51  // ControlSignature because the templating is going to grab a fetch tag
52  // whether we use it or not. 1 should be guaranteed to be valid since you
53  // need at least one argument for the input domain.
54  static constexpr viskores::IdComponent INDEX = 1;
56 };
57 
58 template <typename FetchTag, typename ExecObjectType>
59 struct Fetch<FetchTag, viskores::exec::arg::AspectTagWorkIndex, ExecObjectType>
60 {
62 
63  template <typename ThreadIndicesType>
64  VISKORES_EXEC viskores::Id Load(const ThreadIndicesType& indices, const ExecObjectType&) const
65  {
66  return indices.GetThreadIndex();
67  }
68 
69  template <typename ThreadIndicesType>
70  VISKORES_EXEC void Store(const ThreadIndicesType&, const ExecObjectType&, const ValueType&) const
71  {
72  // Store is a no-op.
73  }
74 };
75 }
76 }
77 } // namespace viskores::exec::arg
78 
79 #endif //viskores_exec_arg_WorkIndex_h
viskores::exec::arg::Fetch< FetchTag, viskores::exec::arg::AspectTagWorkIndex, ExecObjectType >::ValueType
viskores::Id ValueType
Definition: WorkIndex.h:61
viskores::exec::arg::Fetch< FetchTag, viskores::exec::arg::AspectTagWorkIndex, ExecObjectType >::Store
void Store(const ThreadIndicesType &, const ExecObjectType &, const ValueType &) const
Definition: WorkIndex.h:70
viskores::IdComponent
viskores::Int32 IdComponent
Base type to use to index small lists.
Definition: Types.h:202
ExecutionSignatureTagBase.h
viskores::Id
viskores::Int64 Id
Base type to use to index arrays.
Definition: Types.h:235
viskores::exec::arg::Fetch
Class for loading and storing values in thread instance.
Definition: Fetch.h:57
viskores
Groups connected points that have the same field value.
Definition: Atomic.h:27
viskores::exec::arg::WorkIndex::INDEX
static constexpr viskores::IdComponent INDEX
Definition: WorkIndex.h:54
Fetch.h
viskores::exec::arg::ExecutionSignatureTagBase
The base class for all tags used in an ExecutionSignature.
Definition: ExecutionSignatureTagBase.h:45
viskores::exec::arg::Fetch< FetchTag, viskores::exec::arg::AspectTagWorkIndex, ExecObjectType >::Load
viskores::Id Load(const ThreadIndicesType &indices, const ExecObjectType &) const
Definition: WorkIndex.h:64
VISKORES_EXEC
#define VISKORES_EXEC
Definition: ExportMacros.h:59
viskores::exec::arg::AspectTagWorkIndex
Aspect tag to use for getting the work index.
Definition: WorkIndex.h:36
viskores::exec::arg::WorkIndex
The ExecutionSignature tag to use to get the work index.
Definition: WorkIndex.h:47