VTK-m  1.8
TransportTagWholeArrayOut.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_TransportTagWholeArrayOut_h
11 #define vtk_m_cont_arg_TransportTagWholeArrayOut_h
12 
13 #include <vtkm/Types.h>
14 
15 #include <vtkm/cont/ArrayHandle.h>
16 
18 
20 
21 namespace vtkm
22 {
23 namespace cont
24 {
25 namespace arg
26 {
27 
39 {
40 };
41 
42 template <typename ContObjectType, typename Device>
43 struct Transport<vtkm::cont::arg::TransportTagWholeArrayOut, ContObjectType, Device>
44 {
45  // MSVC will issue deprecation warnings here if this template is instantiated with
46  // a deprecated class even if the template is used from a section of code where
47  // deprecation warnings are suppressed. This is annoying behavior since this template
48  // has no control over what class it is used with. To get around it, we have to
49  // suppress all deprecation warnings here.
50 #ifdef VTKM_MSVC
52 #endif
53 
54  // If you get a compile error here, it means you tried to use an object that
55  // is not an array handle as an argument that is expected to be one.
56  VTKM_IS_ARRAY_HANDLE(ContObjectType);
57 
58  using ValueType = typename ContObjectType::ValueType;
59  using StorageTag = typename ContObjectType::StorageTag;
60 
62 
63  template <typename InputDomainType>
64  VTKM_CONT ExecObjectType operator()(ContObjectType& array,
65  const InputDomainType&,
66  vtkm::Id,
67  vtkm::Id,
68  vtkm::cont::Token& token) const
69  {
70  // Note: we ignore the size of the domain because the randomly accessed
71  // array might not have the same size depending on how the user is using
72  // the array.
73 
74  return ExecObjectType(array, array.GetNumberOfValues(), Device{}, token);
75  }
76 
77 #ifdef VTKM_MSVC
79 #endif
80 };
81 }
82 }
83 } // namespace vtkm::cont::arg
84 
85 #endif //vtk_m_cont_arg_TransportTagWholeArrayOut_h
vtkm::cont::arg::Transport::ExecObjectType
typename ContObjectType::ReadPortalType ExecObjectType
The type used in the execution environment.
Definition: Transport.h:48
ArrayHandle.h
vtkm
VTKM_NO_DEPRECATED_VIRTUAL.
Definition: Algorithms.h:18
Types.h
vtkm::cont::arg::Transport< vtkm::cont::arg::TransportTagWholeArrayOut, ContObjectType, Device >::StorageTag
typename ContObjectType::StorageTag StorageTag
Definition: TransportTagWholeArrayOut.h:59
ExecutionWholeArray.h
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::Token
A token to hold the scope of an ArrayHandle or other object.
Definition: Token.h:35
vtkm::cont::arg::TransportTagWholeArrayOut
Transport tag for in-place arrays with random access.
Definition: TransportTagWholeArrayOut.h:38
VTKM_IS_ARRAY_HANDLE
#define VTKM_IS_ARRAY_HANDLE(T)
Definition: ArrayHandle.h:133
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::TransportTagWholeArrayOut, ContObjectType, Device >::operator()
VTKM_CONT ExecObjectType operator()(ContObjectType &array, const InputDomainType &, vtkm::Id, vtkm::Id, vtkm::cont::Token &token) const
Definition: TransportTagWholeArrayOut.h:64
vtkm::cont::arg::Transport
Class for transporting from the control to the execution environment.
Definition: Transport.h:38
vtkm::cont::arg::Transport< vtkm::cont::arg::TransportTagWholeArrayOut, ContObjectType, Device >::ValueType
typename ContObjectType::ValueType ValueType
Definition: TransportTagWholeArrayOut.h:58
vtkm::exec::ExecutionWholeArray
The following classes have been sort of deprecated and are meant to be used internally only.
Definition: ExecutionWholeArray.h:33