VTK-m  2.0
TransportTagBitField.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_TransportTagBitField_h
11 #define vtk_m_cont_arg_TransportTagBitField_h
12 
14 
15 #include <vtkm/cont/BitField.h>
16 
17 namespace vtkm
18 {
19 namespace cont
20 {
21 namespace arg
22 {
23 
25 {
26 };
28 {
29 };
31 {
32 };
33 
34 template <typename Device>
36 {
37  using ExecObjectType =
38  typename vtkm::cont::BitField::template ExecutionTypes<Device>::PortalConst;
39 
40  template <typename InputDomainType>
42  const InputDomainType&,
43  vtkm::Id,
44  vtkm::Id,
45  vtkm::cont::Token& token) const
46  {
47  return field.PrepareForInput(Device{}, token);
48  }
49 };
50 
51 template <typename Device>
53 {
54  using ExecObjectType = typename vtkm::cont::BitField::template ExecutionTypes<Device>::Portal;
55 
56  template <typename InputDomainType>
58  const InputDomainType&,
59  vtkm::Id,
60  vtkm::Id,
61  vtkm::cont::Token& token) const
62  {
63  // This behaves similarly to WholeArray tags, where "Out" maps to InPlace
64  // since we don't want to reallocate or enforce size restrictions.
65  return field.PrepareForInPlace(Device{}, token);
66  }
67 };
68 
69 template <typename Device>
71 {
72  using ExecObjectType = typename vtkm::cont::BitField::template ExecutionTypes<Device>::Portal;
73 
74  template <typename InputDomainType>
76  const InputDomainType&,
77  vtkm::Id,
78  vtkm::Id,
79  vtkm::cont::Token& token) const
80  {
81  return field.PrepareForInPlace(Device{}, token);
82  }
83 };
84 }
85 }
86 } // namespace vtkm::cont::arg
87 
88 #endif //vtk_m_cont_arg_TransportTagBitField_h
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
vtkm::cont::BitField::PrepareForInput
VTKM_CONT ReadPortalType PrepareForInput(vtkm::cont::DeviceAdapterId device, vtkm::cont::Token &token) const
Prepares this BitField to be used as an input to an operation in the execution environment.
BitField.h
vtkm::cont::BitField::PrepareForInPlace
VTKM_CONT WritePortalType PrepareForInPlace(vtkm::cont::DeviceAdapterId device, vtkm::cont::Token &token) const
Prepares this BitField to be used in an in-place operation (both as input and output) in the executio...
vtkm::cont::arg::Transport< vtkm::cont::arg::TransportTagBitFieldInOut, vtkm::cont::BitField, Device >::ExecObjectType
typename vtkm::cont::BitField::template ExecutionTypes< Device >::Portal ExecObjectType
Definition: TransportTagBitField.h:72
vtkm::Id
vtkm::Int32 Id
Represents an ID (index into arrays).
Definition: Types.h:191
vtkm::cont::arg::TransportTagBitFieldOut
Definition: TransportTagBitField.h:27
vtkm::cont::arg::TransportTagBitFieldInOut
Definition: TransportTagBitField.h:30
vtkm::cont::arg::TransportTagBitFieldIn
Definition: TransportTagBitField.h:24
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::TransportTagBitFieldOut, vtkm::cont::BitField, Device >::operator()
VTKM_CONT ExecObjectType operator()(vtkm::cont::BitField &field, const InputDomainType &, vtkm::Id, vtkm::Id, vtkm::cont::Token &token) const
Definition: TransportTagBitField.h:57
vtkm::cont::arg::Transport< vtkm::cont::arg::TransportTagBitFieldIn, vtkm::cont::BitField, Device >::operator()
VTKM_CONT ExecObjectType operator()(vtkm::cont::BitField &field, const InputDomainType &, vtkm::Id, vtkm::Id, vtkm::cont::Token &token) const
Definition: TransportTagBitField.h:41
VTKM_CONT
#define VTKM_CONT
Definition: ExportMacros.h:57
Transport.h
vtkm::cont::arg::Transport< vtkm::cont::arg::TransportTagBitFieldOut, vtkm::cont::BitField, Device >::ExecObjectType
typename vtkm::cont::BitField::template ExecutionTypes< Device >::Portal ExecObjectType
Definition: TransportTagBitField.h:54
vtkm::cont::arg::Transport< vtkm::cont::arg::TransportTagBitFieldInOut, vtkm::cont::BitField, Device >::operator()
VTKM_CONT ExecObjectType operator()(vtkm::cont::BitField &field, const InputDomainType &, vtkm::Id, vtkm::Id, vtkm::cont::Token &token) const
Definition: TransportTagBitField.h:75
vtkm::cont::BitField
Definition: BitField.h:497
vtkm::cont::arg::Transport< vtkm::cont::arg::TransportTagBitFieldIn, vtkm::cont::BitField, Device >::ExecObjectType
typename vtkm::cont::BitField::template ExecutionTypes< Device >::PortalConst ExecObjectType
Definition: TransportTagBitField.h:38
vtkm::cont::arg::Transport
Class for transporting from the control to the execution environment.
Definition: Transport.h:38