Viskores  1.0
TransportTagWholeArrayIn.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_cont_arg_TransportTagWholeArrayIn_h
19 #define viskores_cont_arg_TransportTagWholeArrayIn_h
20 
21 #include <viskores/Deprecated.h>
22 #include <viskores/Types.h>
23 
25 
27 
28 namespace viskores
29 {
30 namespace cont
31 {
32 namespace arg
33 {
34 
44 {
45 };
46 
47 template <typename ContObjectType, typename Device>
48 struct Transport<viskores::cont::arg::TransportTagWholeArrayIn, ContObjectType, Device>
49 {
50  // MSVC will issue deprecation warnings here if this template is instantiated with
51  // a deprecated class even if the template is used from a section of code where
52  // deprecation warnings are suppressed. This is annoying behavior since this template
53  // has no control over what class it is used with. To get around it, we have to
54  // suppress all deprecation warnings here.
55 #ifdef VISKORES_MSVC
57 #endif
58 
59  // If you get a compile error here, it means you tried to use an object that
60  // is not an array handle as an argument that is expected to be one.
61  VISKORES_IS_ARRAY_HANDLE(ContObjectType);
62 
63  using ValueType = typename ContObjectType::ValueType;
64  using StorageTag = typename ContObjectType::StorageTag;
65 
66  using ExecObjectType = typename ContObjectType::ReadPortalType;
67 
68  template <typename InputDomainType>
69  VISKORES_CONT ExecObjectType operator()(ContObjectType& array,
70  const InputDomainType&,
73  viskores::cont::Token& token) const
74  {
75  // Note: we ignore the size of the domain because the randomly accessed
76  // array might not have the same size depending on how the user is using
77  // the array.
78 
79  return array.PrepareForInput(Device{}, token);
80  }
81 
82 #ifdef VISKORES_MSVC
84 #endif
85 };
86 }
87 }
88 } // namespace viskores::cont::arg
89 
90 #endif //viskores_cont_arg_TransportTagWholeArrayIn_h
ArrayHandle.h
Types.h
viskores::cont::arg::Transport
Class for transporting from the control to the execution environment.
Definition: Transport.h:46
VISKORES_IS_ARRAY_HANDLE
#define VISKORES_IS_ARRAY_HANDLE(T)
Checks that the given type is a viskores::cont::ArrayHandle.
Definition: ArrayHandle.h:145
viskores::Id
viskores::Int64 Id
Base type to use to index arrays.
Definition: Types.h:235
VISKORES_CONT
#define VISKORES_CONT
Definition: ExportMacros.h:65
viskores::cont::arg::Transport< viskores::cont::arg::TransportTagWholeArrayIn, ContObjectType, Device >::StorageTag
typename ContObjectType::StorageTag StorageTag
Definition: TransportTagWholeArrayIn.h:64
viskores
Groups connected points that have the same field value.
Definition: Atomic.h:27
viskores::cont::arg::Transport< viskores::cont::arg::TransportTagWholeArrayIn, ContObjectType, Device >::operator()
ExecObjectType operator()(ContObjectType &array, const InputDomainType &, viskores::Id, viskores::Id, viskores::cont::Token &token) const
Definition: TransportTagWholeArrayIn.h:69
VISKORES_DEPRECATED_SUPPRESS_END
#define VISKORES_DEPRECATED_SUPPRESS_END
Definition: Deprecated.h:132
Transport.h
viskores::cont::arg::TransportTagWholeArrayIn
Transport tag for in-place arrays with random access.
Definition: TransportTagWholeArrayIn.h:43
viskores::cont::arg::Transport< viskores::cont::arg::TransportTagWholeArrayIn, ContObjectType, Device >::ExecObjectType
typename ContObjectType::ReadPortalType ExecObjectType
Definition: TransportTagWholeArrayIn.h:66
Deprecated.h
viskores::cont::arg::Transport< viskores::cont::arg::TransportTagWholeArrayIn, ContObjectType, Device >::ValueType
typename ContObjectType::ValueType ValueType
Definition: TransportTagWholeArrayIn.h:63
viskores::cont::Token
A token to hold the scope of an ArrayHandle or other object.
Definition: Token.h:43
VISKORES_DEPRECATED_SUPPRESS_BEGIN
#define VISKORES_DEPRECATED_SUPPRESS_BEGIN
Definition: Deprecated.h:131