Viskores  1.0
TransportTagBitField.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_TransportTagBitField_h
19 #define viskores_cont_arg_TransportTagBitField_h
20 
22 
23 #include <viskores/cont/BitField.h>
24 
25 namespace viskores
26 {
27 namespace cont
28 {
29 namespace arg
30 {
31 
33 {
34 };
36 {
37 };
39 {
40 };
41 
42 template <typename Device>
44 {
45  using ExecObjectType =
46  typename viskores::cont::BitField::template ExecutionTypes<Device>::PortalConst;
47 
48  template <typename InputDomainType>
50  const InputDomainType&,
53  viskores::cont::Token& token) const
54  {
55  return field.PrepareForInput(Device{}, token);
56  }
57 };
58 
59 template <typename Device>
61 {
62  using ExecObjectType = typename viskores::cont::BitField::template ExecutionTypes<Device>::Portal;
63 
64  template <typename InputDomainType>
66  const InputDomainType&,
69  viskores::cont::Token& token) const
70  {
71  // This behaves similarly to WholeArray tags, where "Out" maps to InPlace
72  // since we don't want to reallocate or enforce size restrictions.
73  return field.PrepareForInPlace(Device{}, token);
74  }
75 };
76 
77 template <typename Device>
79 {
80  using ExecObjectType = typename viskores::cont::BitField::template ExecutionTypes<Device>::Portal;
81 
82  template <typename InputDomainType>
84  const InputDomainType&,
87  viskores::cont::Token& token) const
88  {
89  return field.PrepareForInPlace(Device{}, token);
90  }
91 };
92 }
93 }
94 } // namespace viskores::cont::arg
95 
96 #endif //viskores_cont_arg_TransportTagBitField_h
viskores::cont::arg::Transport
Class for transporting from the control to the execution environment.
Definition: Transport.h:46
BitField.h
viskores::cont::arg::Transport< viskores::cont::arg::TransportTagBitFieldIn, viskores::cont::BitField, Device >::operator()
ExecObjectType operator()(viskores::cont::BitField &field, const InputDomainType &, viskores::Id, viskores::Id, viskores::cont::Token &token) const
Definition: TransportTagBitField.h:49
viskores::cont::arg::Transport< viskores::cont::arg::TransportTagBitFieldIn, viskores::cont::BitField, Device >::ExecObjectType
typename viskores::cont::BitField::template ExecutionTypes< Device >::PortalConst ExecObjectType
Definition: TransportTagBitField.h:46
viskores::cont::arg::TransportTagBitFieldIn
Definition: TransportTagBitField.h:32
viskores::cont::BitField::PrepareForInput
ReadPortalType PrepareForInput(viskores::cont::DeviceAdapterId device, viskores::cont::Token &token) const
Prepares this BitField to be used as an input to an operation in the execution environment.
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::BitField::PrepareForInPlace
WritePortalType PrepareForInPlace(viskores::cont::DeviceAdapterId device, viskores::cont::Token &token) const
Prepares this BitField to be used in an in-place operation (both as input and output) in the executio...
viskores::cont::BitField
Definition: BitField.h:507
viskores
Groups connected points that have the same field value.
Definition: Atomic.h:27
Transport.h
viskores::cont::arg::Transport< viskores::cont::arg::TransportTagBitFieldInOut, viskores::cont::BitField, Device >::ExecObjectType
typename viskores::cont::BitField::template ExecutionTypes< Device >::Portal ExecObjectType
Definition: TransportTagBitField.h:80
viskores::cont::arg::Transport< viskores::cont::arg::TransportTagBitFieldInOut, viskores::cont::BitField, Device >::operator()
ExecObjectType operator()(viskores::cont::BitField &field, const InputDomainType &, viskores::Id, viskores::Id, viskores::cont::Token &token) const
Definition: TransportTagBitField.h:83
viskores::cont::arg::TransportTagBitFieldOut
Definition: TransportTagBitField.h:35
viskores::cont::Token
A token to hold the scope of an ArrayHandle or other object.
Definition: Token.h:43
viskores::cont::arg::TransportTagBitFieldInOut
Definition: TransportTagBitField.h:38
viskores::cont::arg::Transport< viskores::cont::arg::TransportTagBitFieldOut, viskores::cont::BitField, Device >::operator()
ExecObjectType operator()(viskores::cont::BitField &field, const InputDomainType &, viskores::Id, viskores::Id, viskores::cont::Token &token) const
Definition: TransportTagBitField.h:65
viskores::cont::arg::Transport< viskores::cont::arg::TransportTagBitFieldOut, viskores::cont::BitField, Device >::ExecObjectType
typename viskores::cont::BitField::template ExecutionTypes< Device >::Portal ExecObjectType
Definition: TransportTagBitField.h:62