VTK-m  2.0
FetchTagArrayDirectOut.h
Go to the documentation of this file.
1 //============================================================================
2 // Copyright (c) Kitware, Inc.
3 // All rights reserved.
4 // See LICENSE.txt for details.
5 //
6 // This software is distributed WITHOUT ANY WARRANTY; without even
7 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8 // PURPOSE. See the above copyright notice for more information.
9 //============================================================================
10 #ifndef vtk_m_exec_arg_FetchTagArrayDirectOut_h
11 #define vtk_m_exec_arg_FetchTagArrayDirectOut_h
12 
14 #include <vtkm/exec/arg/Fetch.h>
15 
16 namespace vtkm
17 {
18 namespace exec
19 {
20 namespace arg
21 {
22 
30 {
31 };
32 
33 template <typename ExecObjectType>
36  ExecObjectType>
37 {
39  template <typename ThreadIndicesType>
40  VTKM_EXEC auto Load(const ThreadIndicesType&, const ExecObjectType&) const ->
41  typename ExecObjectType::ValueType
42  {
43  // Load is a no-op for this fetch.
44  using ValueType = typename ExecObjectType::ValueType;
45  return ValueType();
46  }
47 
49  template <typename ThreadIndicesType, typename T>
50  VTKM_EXEC void Store(const ThreadIndicesType& indices,
51  const ExecObjectType& arrayPortal,
52  const T& value) const
53  {
54  using ValueType = typename ExecObjectType::ValueType;
55  arrayPortal.Set(indices.GetOutputIndex(), static_cast<ValueType>(value));
56  }
57 };
58 }
59 }
60 } // namespace vtkm::exec::arg
61 
62 #endif //vtk_m_exec_arg_FetchTagArrayDirectOut_h
VTKM_EXEC
#define VTKM_EXEC
Definition: ExportMacros.h:51
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
vtkm::exec::arg::Fetch< vtkm::exec::arg::FetchTagArrayDirectOut, vtkm::exec::arg::AspectTagDefault, ExecObjectType >::Store
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_EXEC void Store(const ThreadIndicesType &indices, const ExecObjectType &arrayPortal, const T &value) const
Definition: FetchTagArrayDirectOut.h:50
vtkm::exec::arg::FetchTagArrayDirectOut
Fetch tag for setting array values with direct indexing.
Definition: FetchTagArrayDirectOut.h:29
vtkm::exec::arg::Fetch::ValueType
typename ExecObjectType::ValueType ValueType
The type of value to load and store.
Definition: Fetch.h:58
vtkm::exec::arg::Fetch
Class for loading and storing values in thread instance.
Definition: Fetch.h:49
Fetch.h
AspectTagDefault.h
vtkm::exec::arg::AspectTagDefault
Aspect tag to use for default load/store of data.
Definition: AspectTagDefault.h:22
vtkm::exec::arg::Fetch< vtkm::exec::arg::FetchTagArrayDirectOut, vtkm::exec::arg::AspectTagDefault, ExecObjectType >::Load
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_EXEC auto Load(const ThreadIndicesType &, const ExecObjectType &) const -> typename ExecObjectType::ValueType
Definition: FetchTagArrayDirectOut.h:40
VTKM_SUPPRESS_EXEC_WARNINGS
#define VTKM_SUPPRESS_EXEC_WARNINGS
Definition: ExportMacros.h:53