Viskores  1.0
ThreadIndices.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_ThreadIndices_h
19 #define viskores_exec_arg_ThreadIndices_h
20 
23 
24 namespace viskores
25 {
26 namespace exec
27 {
28 namespace arg
29 {
30 
38 {
39 };
40 
53 {
54  // The index does not really matter because the fetch is going to ignore it.
55  // However, it still has to point to a valid parameter in the
56  // ControlSignature because the templating is going to grab a fetch tag
57  // whether we use it or not. 1 should be guaranteed to be valid since you
58  // need at least one argument for the input domain.
59  static constexpr viskores::IdComponent INDEX = 1;
61 };
62 
63 template <typename FetchTag, typename ExecObjectType>
64 struct Fetch<FetchTag, viskores::exec::arg::AspectTagThreadIndices, ExecObjectType>
65 {
66 
67  template <typename ThreadIndicesType>
68  VISKORES_EXEC const ThreadIndicesType& Load(const ThreadIndicesType& indices,
69  const ExecObjectType&) const
70  {
71  return indices;
72  }
73 
74  template <typename ThreadIndicesType>
75  VISKORES_EXEC void Store(const ThreadIndicesType&,
76  const ExecObjectType&,
77  const ThreadIndicesType&) const
78  {
79  // Store is a no-op.
80  }
81 };
82 }
83 }
84 } // namespace viskores::exec::arg
85 
86 #endif //viskores_exec_arg_ThreadIndices_h
viskores::exec::arg::ThreadIndices
The ExecutionSignature tag to use to get the thread indices.
Definition: ThreadIndices.h:52
viskores::IdComponent
viskores::Int32 IdComponent
Base type to use to index small lists.
Definition: Types.h:202
viskores::exec::arg::ThreadIndices::INDEX
static constexpr viskores::IdComponent INDEX
Definition: ThreadIndices.h:59
ExecutionSignatureTagBase.h
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::Fetch< FetchTag, viskores::exec::arg::AspectTagThreadIndices, ExecObjectType >::Store
void Store(const ThreadIndicesType &, const ExecObjectType &, const ThreadIndicesType &) const
Definition: ThreadIndices.h:75
viskores::exec::arg::AspectTagThreadIndices
Aspect tag to use for getting the thread indices.
Definition: ThreadIndices.h:37
Fetch.h
viskores::exec::arg::Fetch< FetchTag, viskores::exec::arg::AspectTagThreadIndices, ExecObjectType >::Load
const ThreadIndicesType & Load(const ThreadIndicesType &indices, const ExecObjectType &) const
Definition: ThreadIndices.h:68
viskores::exec::arg::ExecutionSignatureTagBase
The base class for all tags used in an ExecutionSignature.
Definition: ExecutionSignatureTagBase.h:45
VISKORES_EXEC
#define VISKORES_EXEC
Definition: ExportMacros.h:59