VTK-m  2.0
TransportTagWholeArrayIn.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_TransportTagWholeArrayIn_h
11 #define vtk_m_cont_arg_TransportTagWholeArrayIn_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 
36 {
37 };
38 
39 template <typename ContObjectType, typename Device>
40 struct Transport<vtkm::cont::arg::TransportTagWholeArrayIn, ContObjectType, Device>
41 {
42  // MSVC will issue deprecation warnings here if this template is instantiated with
43  // a deprecated class even if the template is used from a section of code where
44  // deprecation warnings are suppressed. This is annoying behavior since this template
45  // has no control over what class it is used with. To get around it, we have to
46  // suppress all deprecation warnings here.
47 #ifdef VTKM_MSVC
49 #endif
50 
51  // If you get a compile error here, it means you tried to use an object that
52  // is not an array handle as an argument that is expected to be one.
53  VTKM_IS_ARRAY_HANDLE(ContObjectType);
54 
55  using ValueType = typename ContObjectType::ValueType;
56  using StorageTag = typename ContObjectType::StorageTag;
57 
58  using ExecObjectType = typename ContObjectType::ReadPortalType;
59 
60  template <typename InputDomainType>
61  VTKM_CONT ExecObjectType operator()(ContObjectType& array,
62  const InputDomainType&,
63  vtkm::Id,
64  vtkm::Id,
65  vtkm::cont::Token& token) const
66  {
67  // Note: we ignore the size of the domain because the randomly accessed
68  // array might not have the same size depending on how the user is using
69  // the array.
70 
71  return array.PrepareForInput(Device{}, token);
72  }
73 
74 #ifdef VTKM_MSVC
76 #endif
77 };
78 }
79 }
80 } // namespace vtkm::cont::arg
81 
82 #endif //vtk_m_cont_arg_TransportTagWholeArrayIn_h
vtkm::cont::arg::Transport< vtkm::cont::arg::TransportTagWholeArrayIn, ContObjectType, Device >::operator()
VTKM_CONT ExecObjectType operator()(ContObjectType &array, const InputDomainType &, vtkm::Id, vtkm::Id, vtkm::cont::Token &token) const
Definition: TransportTagWholeArrayIn.h:61
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::TransportTagWholeArrayIn, ContObjectType, Device >::ExecObjectType
typename ContObjectType::ReadPortalType ExecObjectType
Definition: TransportTagWholeArrayIn.h:58
vtkm::Id
vtkm::Int32 Id
Represents an ID (index into arrays).
Definition: Types.h:191
VTKM_DEPRECATED_SUPPRESS_END
#define VTKM_DEPRECATED_SUPPRESS_END
Definition: Deprecated.h:123
vtkm::cont::arg::TransportTagWholeArrayIn
Transport tag for in-place arrays with random access.
Definition: TransportTagWholeArrayIn.h:35
vtkm::cont::Token
A token to hold the scope of an ArrayHandle or other object.
Definition: Token.h:35
vtkm::cont::arg::Transport< vtkm::cont::arg::TransportTagWholeArrayIn, ContObjectType, Device >::ValueType
typename ContObjectType::ValueType ValueType
Definition: TransportTagWholeArrayIn.h:55
VTKM_IS_ARRAY_HANDLE
#define VTKM_IS_ARRAY_HANDLE(T)
Definition: ArrayHandle.h:132
VTKM_CONT
#define VTKM_CONT
Definition: ExportMacros.h:57
Transport.h
VTKM_DEPRECATED_SUPPRESS_BEGIN
#define VTKM_DEPRECATED_SUPPRESS_BEGIN
Definition: Deprecated.h:122
vtkm::cont::arg::Transport< vtkm::cont::arg::TransportTagWholeArrayIn, ContObjectType, Device >::StorageTag
typename ContObjectType::StorageTag StorageTag
Definition: TransportTagWholeArrayIn.h:56
Deprecated.h
vtkm::cont::arg::Transport
Class for transporting from the control to the execution environment.
Definition: Transport.h:38