VTK-m  2.2
TransportTagWholeArrayInOut.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_cont_arg_TransportTagWholeArrayInOut_h
11 #define vtk_m_cont_arg_TransportTagWholeArrayInOut_h
12 
13 #include <vtkm/Deprecated.h>
14 #include <vtkm/Types.h>
15 
16 #include <vtkm/cont/ArrayHandle.h>
17 
19 
20 namespace vtkm
21 {
22 namespace cont
23 {
24 namespace arg
25 {
26 
38 {
39 };
40 
41 template <typename ContObjectType, typename Device>
42 struct Transport<vtkm::cont::arg::TransportTagWholeArrayInOut, ContObjectType, Device>
43 {
44  // MSVC will issue deprecation warnings here if this template is instantiated with
45  // a deprecated class even if the template is used from a section of code where
46  // deprecation warnings are suppressed. This is annoying behavior since this template
47  // has no control over what class it is used with. To get around it, we have to
48  // suppress all deprecation warnings here.
49 #ifdef VTKM_MSVC
51 #endif
52 
53  // If you get a compile error here, it means you tried to use an object that
54  // is not an array handle as an argument that is expected to be one.
55  VTKM_IS_ARRAY_HANDLE(ContObjectType);
56 
57  using ValueType = typename ContObjectType::ValueType;
58  using StorageTag = typename ContObjectType::StorageTag;
59 
60  using ExecObjectType = typename ContObjectType::WritePortalType;
61 
62  template <typename InputDomainType>
63  VTKM_CONT ExecObjectType operator()(ContObjectType& array,
64  const InputDomainType&,
65  vtkm::Id,
66  vtkm::Id,
67  vtkm::cont::Token& token) const
68  {
69  // Note: we ignore the size of the domain because the randomly accessed
70  // array might not have the same size depending on how the user is using
71  // the array.
72 
73  return array.PrepareForInPlace(Device{}, token);
74  }
75 
76 #ifdef VTKM_MSVC
78 #endif
79 };
80 }
81 }
82 } // namespace vtkm::cont::arg
83 
84 #endif //vtk_m_cont_arg_TransportTagWholeArrayInOut_h
ArrayHandle.h
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
Types.h
vtkm::cont::arg::Transport< vtkm::cont::arg::TransportTagWholeArrayInOut, ContObjectType, Device >::ExecObjectType
typename ContObjectType::WritePortalType ExecObjectType
Definition: TransportTagWholeArrayInOut.h:60
vtkm::cont::arg::Transport< vtkm::cont::arg::TransportTagWholeArrayInOut, ContObjectType, Device >::operator()
ExecObjectType operator()(ContObjectType &array, const InputDomainType &, vtkm::Id, vtkm::Id, vtkm::cont::Token &token) const
Definition: TransportTagWholeArrayInOut.h:63
vtkm::cont::arg::TransportTagWholeArrayInOut
Transport tag for in-place arrays with random access.
Definition: TransportTagWholeArrayInOut.h:37
vtkm::cont::arg::Transport< vtkm::cont::arg::TransportTagWholeArrayInOut, ContObjectType, Device >::StorageTag
typename ContObjectType::StorageTag StorageTag
Definition: TransportTagWholeArrayInOut.h:58
VTKM_DEPRECATED_SUPPRESS_END
#define VTKM_DEPRECATED_SUPPRESS_END
Definition: Deprecated.h:123
vtkm::cont::Token
A token to hold the scope of an ArrayHandle or other object.
Definition: Token.h:35
VTKM_IS_ARRAY_HANDLE
#define VTKM_IS_ARRAY_HANDLE(T)
Checks that the given type is a vtkm::cont::ArrayHandle.
Definition: ArrayHandle.h:137
vtkm::cont::arg::Transport< vtkm::cont::arg::TransportTagWholeArrayInOut, ContObjectType, Device >::ValueType
typename ContObjectType::ValueType ValueType
Definition: TransportTagWholeArrayInOut.h:57
VTKM_CONT
#define VTKM_CONT
Definition: ExportMacros.h:57
vtkm::Id
vtkm::Int64 Id
Base type to use to index arrays.
Definition: Types.h:227
Transport.h
VTKM_DEPRECATED_SUPPRESS_BEGIN
#define VTKM_DEPRECATED_SUPPRESS_BEGIN
Definition: Deprecated.h:122
Deprecated.h
vtkm::cont::arg::Transport
Class for transporting from the control to the execution environment.
Definition: Transport.h:38