VTK-m  2.2
ArrayHandleTransform.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_ArrayHandleTransform_h
11 #define vtk_m_cont_ArrayHandleTransform_h
12 
13 #include <vtkm/cont/ArrayHandle.h>
14 #include <vtkm/cont/ErrorBadType.h>
18 
20 
22 
23 namespace vtkm
24 {
25 namespace internal
26 {
27 
29 struct NullFunctorType
30 {
31 };
32 
35 template <typename ValueType_,
36  typename PortalType_,
37  typename FunctorType_,
38  typename InverseFunctorType_ = NullFunctorType>
39 class VTKM_ALWAYS_EXPORT ArrayPortalTransform;
40 
41 template <typename ValueType_, typename PortalType_, typename FunctorType_>
43  ArrayPortalTransform<ValueType_, PortalType_, FunctorType_, NullFunctorType>
44 {
45 public:
46  using PortalType = PortalType_;
47  using ValueType = ValueType_;
48  using FunctorType = FunctorType_;
49 
51  ArrayPortalTransform(const PortalType& portal = PortalType(),
52  const FunctorType& functor = FunctorType())
53  : Portal(portal)
54  , Functor(functor)
55  {
56  }
57 
62  template <class OtherV, class OtherP, class OtherF>
63  VTKM_EXEC_CONT ArrayPortalTransform(const ArrayPortalTransform<OtherV, OtherP, OtherF>& src)
64  : Portal(src.GetPortal())
65  , Functor(src.GetFunctor())
66  {
67  }
68 
70  vtkm::Id GetNumberOfValues() const { return this->Portal.GetNumberOfValues(); }
71 
73  ValueType Get(vtkm::Id index) const { return this->Functor(this->Portal.Get(index)); }
74 
76  const PortalType& GetPortal() const { return this->Portal; }
77 
79  const FunctorType& GetFunctor() const { return this->Functor; }
80 
81 protected:
82  PortalType Portal;
83  FunctorType Functor;
84 };
85 
86 template <typename ValueType_,
87  typename PortalType_,
88  typename FunctorType_,
89  typename InverseFunctorType_>
90 class VTKM_ALWAYS_EXPORT ArrayPortalTransform
91  : public ArrayPortalTransform<ValueType_, PortalType_, FunctorType_, NullFunctorType>
92 {
93  using Writable = vtkm::internal::PortalSupportsSets<PortalType_>;
94 
95 public:
96  using Superclass = ArrayPortalTransform<ValueType_, PortalType_, FunctorType_, NullFunctorType>;
97  using PortalType = PortalType_;
98  using ValueType = ValueType_;
99  using FunctorType = FunctorType_;
100  using InverseFunctorType = InverseFunctorType_;
101 
103  ArrayPortalTransform(const PortalType& portal = PortalType(),
104  const FunctorType& functor = FunctorType(),
105  const InverseFunctorType& inverseFunctor = InverseFunctorType())
106  : Superclass(portal, functor)
107  , InverseFunctor(inverseFunctor)
108  {
109  }
110 
111  template <class OtherV, class OtherP, class OtherF, class OtherInvF>
112  VTKM_EXEC_CONT ArrayPortalTransform(
113  const ArrayPortalTransform<OtherV, OtherP, OtherF, OtherInvF>& src)
114  : Superclass(src)
115  , InverseFunctor(src.GetInverseFunctor())
116  {
117  }
118 
119  template <typename Writable_ = Writable,
120  typename = typename std::enable_if<Writable_::value>::type>
121  VTKM_EXEC_CONT void Set(vtkm::Id index, const ValueType& value) const
122  {
123  this->Portal.Set(index, this->InverseFunctor(value));
124  }
125 
127  const InverseFunctorType& GetInverseFunctor() const { return this->InverseFunctor; }
128 
129 private:
130  InverseFunctorType InverseFunctor;
131 };
132 }
133 } // namespace vtkm::internal
134 
135 namespace vtkm
136 {
137 namespace cont
138 {
139 
140 namespace internal
141 {
142 
143 using NullFunctorType = vtkm::internal::NullFunctorType;
144 
145 template <typename ProvidedFunctorType, typename FunctorIsExecContObject>
146 struct TransformFunctorManagerImpl;
147 
148 template <typename ProvidedFunctorType>
149 struct TransformFunctorManagerImpl<ProvidedFunctorType, std::false_type>
150 {
151  VTKM_STATIC_ASSERT_MSG(!vtkm::cont::internal::IsExecutionObjectBase<ProvidedFunctorType>::value,
152  "Must use an ExecutionAndControlObject instead of an ExecutionObject.");
153 
154  ProvidedFunctorType Functor;
155  using FunctorType = ProvidedFunctorType;
156 
157  TransformFunctorManagerImpl() = default;
158 
159  VTKM_CONT
160  TransformFunctorManagerImpl(const ProvidedFunctorType& functor)
161  : Functor(functor)
162  {
163  }
164 
165  VTKM_CONT
166  ProvidedFunctorType PrepareForControl() const { return this->Functor; }
167 
168  VTKM_CONT ProvidedFunctorType PrepareForExecution(vtkm::cont::DeviceAdapterId,
169  vtkm::cont::Token&) const
170  {
171  return this->Functor;
172  }
173 };
174 
175 template <typename ProvidedFunctorType>
176 struct TransformFunctorManagerImpl<ProvidedFunctorType, std::true_type>
177 {
178  VTKM_IS_EXECUTION_AND_CONTROL_OBJECT(ProvidedFunctorType);
179 
180  ProvidedFunctorType Functor;
181  // using FunctorType = decltype(std::declval<ProvidedFunctorType>().PrepareForControl());
182  // using FunctorType = decltype(Functor.PrepareForControl());
183  using FunctorType = vtkm::cont::internal::ControlObjectType<ProvidedFunctorType>;
184 
185  TransformFunctorManagerImpl() = default;
186 
187  VTKM_CONT
188  TransformFunctorManagerImpl(const ProvidedFunctorType& functor)
189  : Functor(functor)
190  {
191  }
192 
193  VTKM_CONT
194  auto PrepareForControl() const
195  -> decltype(vtkm::cont::internal::CallPrepareForControl(this->Functor))
196  {
197  return vtkm::cont::internal::CallPrepareForControl(this->Functor);
198  }
199 
200  VTKM_CONT auto PrepareForExecution(vtkm::cont::DeviceAdapterId device,
201  vtkm::cont::Token& token) const
202  -> decltype(vtkm::cont::internal::CallPrepareForExecution(this->Functor, device, token))
203  {
204  return vtkm::cont::internal::CallPrepareForExecution(this->Functor, device, token);
205  }
206 };
207 
208 template <typename ProvidedFunctorType>
209 struct TransformFunctorManager
210  : TransformFunctorManagerImpl<
211  ProvidedFunctorType,
212  typename vtkm::cont::internal::IsExecutionAndControlObjectBase<ProvidedFunctorType>::type>
213 {
214  using Superclass = TransformFunctorManagerImpl<
215  ProvidedFunctorType,
216  typename vtkm::cont::internal::IsExecutionAndControlObjectBase<ProvidedFunctorType>::type>;
217  using FunctorType = typename Superclass::FunctorType;
218 
219  VTKM_CONT TransformFunctorManager() = default;
220 
221  VTKM_CONT TransformFunctorManager(const TransformFunctorManager&) = default;
222 
223  VTKM_CONT TransformFunctorManager(const ProvidedFunctorType& functor)
224  : Superclass(functor)
225  {
226  }
227 
228  template <typename ValueType>
229  using TransformedValueType = decltype(std::declval<FunctorType>()(std::declval<ValueType>()));
230 };
231 
232 template <typename ArrayHandleType,
233  typename FunctorType,
234  typename InverseFunctorType = NullFunctorType>
235 struct VTKM_ALWAYS_EXPORT StorageTagTransform
236 {
237  using FunctorManager = TransformFunctorManager<FunctorType>;
238  using ValueType =
239  typename FunctorManager::template TransformedValueType<typename ArrayHandleType::ValueType>;
240 };
241 
242 template <typename ArrayHandleType, typename FunctorType>
243 class Storage<typename StorageTagTransform<ArrayHandleType, FunctorType>::ValueType,
244  StorageTagTransform<ArrayHandleType, FunctorType>>
245 {
246  using FunctorManager = TransformFunctorManager<FunctorType>;
247  using ValueType = typename StorageTagTransform<ArrayHandleType, FunctorType>::ValueType;
248 
249  using SourceStorage = typename ArrayHandleType::StorageType;
250 
251  static std::vector<vtkm::cont::internal::Buffer> SourceBuffers(
252  const std::vector<vtkm::cont::internal::Buffer>& buffers)
253  {
254  return std::vector<vtkm::cont::internal::Buffer>(buffers.begin() + 1, buffers.end());
255  }
256 
257 public:
260 
261  using ReadPortalType =
262  vtkm::internal::ArrayPortalTransform<ValueType,
263  typename ArrayHandleType::ReadPortalType,
264  typename FunctorManager::FunctorType>;
265 
266  VTKM_CONT static vtkm::IdComponent GetNumberOfComponentsFlat(
267  const std::vector<vtkm::cont::internal::Buffer>&)
268  {
270  }
271 
272  VTKM_CONT static vtkm::Id GetNumberOfValues(
273  const std::vector<vtkm::cont::internal::Buffer>& buffers)
274  {
275  return SourceStorage::GetNumberOfValues(SourceBuffers(buffers));
276  }
277 
278  VTKM_CONT static ReadPortalType CreateReadPortal(
279  const std::vector<vtkm::cont::internal::Buffer>& buffers,
281  vtkm::cont::Token& token)
282  {
284  {
285  return ReadPortalType(SourceStorage::CreateReadPortal(SourceBuffers(buffers), device, token),
286  buffers[0].GetMetaData<FunctorManager>().PrepareForControl());
287  }
288  else
289  {
290  return ReadPortalType(
291  SourceStorage::CreateReadPortal(SourceBuffers(buffers), device, token),
292  buffers[0].GetMetaData<FunctorManager>().PrepareForExecution(device, token));
293  }
294  }
295 
296  VTKM_CONT static std::vector<vtkm::cont::internal::Buffer> CreateBuffers(
297  const ArrayHandleType& handle = ArrayHandleType{},
298  const FunctorType& functor = FunctorType())
299  {
300  return vtkm::cont::internal::CreateBuffers(FunctorManager(functor), handle);
301  }
302 
303  VTKM_CONT static ArrayHandleType GetArray(
304  const std::vector<vtkm::cont::internal::Buffer>& buffers)
305  {
306  return vtkm::cont::ArrayHandle<typename ArrayHandleType::ValueType,
307  typename ArrayHandleType::StorageTag>(SourceBuffers(buffers));
308  }
309 
310  VTKM_CONT static FunctorType GetFunctor(const std::vector<vtkm::cont::internal::Buffer>& buffers)
311  {
312  return buffers[0].GetMetaData<FunctorManager>().Functor;
313  }
314 
315  VTKM_CONT static NullFunctorType GetInverseFunctor(
316  const std::vector<vtkm::cont::internal::Buffer>&)
317  {
318  return NullFunctorType{};
319  }
320 };
321 
322 template <typename ArrayHandleType, typename FunctorType, typename InverseFunctorType>
323 class Storage<
324  typename StorageTagTransform<ArrayHandleType, FunctorType, InverseFunctorType>::ValueType,
325  StorageTagTransform<ArrayHandleType, FunctorType, InverseFunctorType>>
326 {
327  using FunctorManager = TransformFunctorManager<FunctorType>;
328  using InverseFunctorManager = TransformFunctorManager<InverseFunctorType>;
329  using ValueType = typename StorageTagTransform<ArrayHandleType, FunctorType>::ValueType;
330 
331  using SourceStorage = typename ArrayHandleType::StorageType;
332 
333  static std::vector<vtkm::cont::internal::Buffer> SourceBuffers(
334  const std::vector<vtkm::cont::internal::Buffer>& buffers)
335  {
336  return std::vector<vtkm::cont::internal::Buffer>(buffers.begin() + 2, buffers.end());
337  }
338 
339 public:
340  using ReadPortalType =
341  vtkm::internal::ArrayPortalTransform<ValueType,
342  typename ArrayHandleType::ReadPortalType,
343  typename FunctorManager::FunctorType,
344  typename InverseFunctorManager::FunctorType>;
345  using WritePortalType =
346  vtkm::internal::ArrayPortalTransform<ValueType,
347  typename ArrayHandleType::WritePortalType,
348  typename FunctorManager::FunctorType,
349  typename InverseFunctorManager::FunctorType>;
350 
351  VTKM_CONT static vtkm::IdComponent GetNumberOfComponentsFlat(
352  const std::vector<vtkm::cont::internal::Buffer>&)
353  {
355  }
356 
357  VTKM_CONT static vtkm::Id GetNumberOfValues(
358  const std::vector<vtkm::cont::internal::Buffer>& buffers)
359  {
360  return SourceStorage::GetNumberOfValues(SourceBuffers(buffers));
361  }
362 
363  VTKM_CONT static void ResizeBuffers(vtkm::Id numValues,
364  const std::vector<vtkm::cont::internal::Buffer>& buffers,
365  vtkm::CopyFlag preserve,
366  vtkm::cont::Token& token)
367  {
368  std::vector<vtkm::cont::internal::Buffer> sourceBuffers = SourceBuffers(buffers);
369  SourceStorage::ResizeBuffers(numValues, sourceBuffers, preserve, token);
370  }
371 
372  VTKM_CONT static ReadPortalType CreateReadPortal(
373  const std::vector<vtkm::cont::internal::Buffer>& buffers,
375  vtkm::cont::Token& token)
376  {
378  {
379  return ReadPortalType(SourceStorage::CreateReadPortal(SourceBuffers(buffers), device, token),
380  buffers[0].GetMetaData<FunctorManager>().PrepareForControl(),
381  buffers[1].GetMetaData<InverseFunctorManager>().PrepareForControl());
382  }
383  else
384  {
385  return ReadPortalType(
386  SourceStorage::CreateReadPortal(SourceBuffers(buffers), device, token),
387  buffers[0].GetMetaData<FunctorManager>().PrepareForExecution(device, token),
388  buffers[1].GetMetaData<InverseFunctorManager>().PrepareForExecution(device, token));
389  }
390  }
391 
392  VTKM_CONT static WritePortalType CreateWritePortal(
393  const std::vector<vtkm::cont::internal::Buffer>& buffers,
395  vtkm::cont::Token& token)
396  {
397  return WritePortalType(
398  SourceStorage::CreateWritePortal(SourceBuffers(buffers), device, token),
399  buffers[0].GetMetaData<FunctorManager>().PrepareForExecution(device, token),
400  buffers[1].GetMetaData<InverseFunctorManager>().PrepareForExecution(device, token));
401  }
402 
403  VTKM_CONT static std::vector<vtkm::cont::internal::Buffer> CreateBuffers(
404  const ArrayHandleType& handle = ArrayHandleType{},
405  const FunctorType& functor = FunctorType(),
406  const InverseFunctorType& inverseFunctor = InverseFunctorType())
407  {
408  return vtkm::cont::internal::CreateBuffers(
409  FunctorManager(functor), InverseFunctorManager(inverseFunctor), handle);
410  }
411 
412  VTKM_CONT static ArrayHandleType GetArray(
413  const std::vector<vtkm::cont::internal::Buffer>& buffers)
414  {
415  return vtkm::cont::ArrayHandle<typename ArrayHandleType::ValueType,
416  typename ArrayHandleType::StorageTag>(SourceBuffers(buffers));
417  }
418 
419  VTKM_CONT static FunctorType GetFunctor(const std::vector<vtkm::cont::internal::Buffer>& buffers)
420  {
421  return buffers[0].GetMetaData<FunctorManager>().Functor;
422  }
423 
424  VTKM_CONT static InverseFunctorType GetInverseFunctor(
425  const std::vector<vtkm::cont::internal::Buffer>& buffers)
426  {
427  return buffers[1].GetMetaData<InverseFunctorManager>().Functor;
428  }
429 };
430 
431 } // namespace internal
432 
444 template <typename ArrayHandleType,
445  typename FunctorType,
446  typename InverseFunctorType = internal::NullFunctorType>
448 
449 template <typename ArrayHandleType, typename FunctorType>
450 class ArrayHandleTransform<ArrayHandleType, FunctorType, internal::NullFunctorType>
451  : public vtkm::cont::ArrayHandle<
452  typename internal::StorageTagTransform<ArrayHandleType, FunctorType>::ValueType,
453  internal::StorageTagTransform<ArrayHandleType, FunctorType>>
454 {
455  // If the following line gives a compile error, then the ArrayHandleType
456  // template argument is not a valid ArrayHandle type.
457  VTKM_IS_ARRAY_HANDLE(ArrayHandleType);
458 
459 public:
464  typename internal::StorageTagTransform<ArrayHandleType, FunctorType>::ValueType,
465  internal::StorageTagTransform<ArrayHandleType, FunctorType>>));
466 
467  VTKM_CONT
468  ArrayHandleTransform(const ArrayHandleType& handle,
469  const FunctorType& functor = FunctorType{},
470  internal::NullFunctorType = internal::NullFunctorType{})
471  : Superclass(StorageType::CreateBuffers(handle, functor))
472  {
473  }
474 };
475 
479 template <typename HandleType, typename FunctorType>
481  HandleType handle,
482  FunctorType functor)
483 {
484  return ArrayHandleTransform<HandleType, FunctorType>(handle, functor);
485 }
486 
487 // ArrayHandleTransform with inverse functors enabled (no need to subclass from
488 // ArrayHandleTransform without inverse functors: nothing to inherit).
489 template <typename ArrayHandleType, typename FunctorType, typename InverseFunctorType>
490 class ArrayHandleTransform
491  : public vtkm::cont::ArrayHandle<
492  typename internal::StorageTagTransform<ArrayHandleType, FunctorType, InverseFunctorType>::
493  ValueType,
494  internal::StorageTagTransform<ArrayHandleType, FunctorType, InverseFunctorType>>
495 {
496  VTKM_IS_ARRAY_HANDLE(ArrayHandleType);
497 
498 public:
501  (ArrayHandleTransform<ArrayHandleType, FunctorType, InverseFunctorType>),
503  typename internal::StorageTagTransform<ArrayHandleType, FunctorType, InverseFunctorType>::
504  ValueType,
505  internal::StorageTagTransform<ArrayHandleType, FunctorType, InverseFunctorType>>));
506 
507  ArrayHandleTransform(const ArrayHandleType& handle,
508  const FunctorType& functor = FunctorType(),
509  const InverseFunctorType& inverseFunctor = InverseFunctorType())
510  : Superclass(StorageType::CreateBuffers(handle, functor, inverseFunctor))
511  {
512  }
513 
520 
523  ArrayHandleType GetTransformedArray() const { return StorageType::GetArray(this->GetBuffers()); }
524 
527  FunctorType GetFunctor() const { return StorageType::GetFunctor(this->GetBuffers()); }
528 
531  InverseFunctorType GetInverseFunctor() const
532  {
533  return StorageType::GetInverseFunctor(this->GetBuffers());
534  }
535 };
536 
537 template <typename HandleType, typename FunctorType, typename InverseFunctorType>
539 make_ArrayHandleTransform(HandleType handle, FunctorType functor, InverseFunctorType inverseFunctor)
540 {
542  handle, functor, inverseFunctor);
543 }
544 }
545 
546 } // namespace vtkm::cont
547 
548 //=============================================================================
549 // Specializations of serialization related classes
551 namespace vtkm
552 {
553 namespace cont
554 {
555 
556 template <typename AH, typename Functor, typename InvFunctor>
557 struct SerializableTypeString<vtkm::cont::ArrayHandleTransform<AH, Functor, InvFunctor>>
558 {
559  static VTKM_CONT const std::string& Get()
560  {
561  static std::string name = "AH_Transform<" + SerializableTypeString<AH>::Get() + "," +
563  ">";
564  return name;
565  }
566 };
567 
568 template <typename AH, typename Functor>
569 struct SerializableTypeString<vtkm::cont::ArrayHandleTransform<AH, Functor>>
570 {
571  static VTKM_CONT const std::string& Get()
572  {
573  static std::string name = "AH_Transform<" + SerializableTypeString<AH>::Get() + "," +
575  return name;
576  }
577 };
578 
579 template <typename AH, typename Functor, typename InvFunctor>
580 struct SerializableTypeString<vtkm::cont::ArrayHandle<
581  typename vtkm::cont::internal::StorageTagTransform<AH, Functor, InvFunctor>::ValueType,
582  vtkm::cont::internal::StorageTagTransform<AH, Functor, InvFunctor>>>
583  : SerializableTypeString<vtkm::cont::ArrayHandleTransform<AH, Functor, InvFunctor>>
584 {
585 };
586 }
587 } // vtkm::cont
588 
589 namespace mangled_diy_namespace
590 {
591 
592 template <typename AH, typename Functor>
593 struct Serialization<vtkm::cont::ArrayHandleTransform<AH, Functor>>
594 {
595 private:
598 
599 public:
600  static VTKM_CONT void save(BinaryBuffer& bb, const BaseType& obj)
601  {
602  Type transformedArray = obj;
603  vtkmdiy::save(bb, obj.GetArray());
604  vtkmdiy::save(bb, obj.GetFunctor());
605  }
606 
607  static VTKM_CONT void load(BinaryBuffer& bb, BaseType& obj)
608  {
609  AH array;
610  vtkmdiy::load(bb, array);
611  Functor functor;
612  vtkmdiy::load(bb, functor);
613  obj = vtkm::cont::make_ArrayHandleTransform(array, functor);
614  }
615 };
616 
617 template <typename AH, typename Functor, typename InvFunctor>
618 struct Serialization<vtkm::cont::ArrayHandleTransform<AH, Functor, InvFunctor>>
619 {
620 private:
623 
624 public:
625  static VTKM_CONT void save(BinaryBuffer& bb, const BaseType& obj)
626  {
627  Type transformedArray = obj;
628  vtkmdiy::save(bb, transformedArray.GetTransformedArray());
629  vtkmdiy::save(bb, transformedArray.GetFunctor());
630  vtkmdiy::save(bb, transformedArray.GetInverseFunctor());
631  }
632 
633  static VTKM_CONT void load(BinaryBuffer& bb, BaseType& obj)
634  {
635  AH array;
636  vtkmdiy::load(bb, array);
637  Functor functor;
638  vtkmdiy::load(bb, functor);
639  InvFunctor invFunctor;
640  vtkmdiy::load(bb, invFunctor);
641  obj = vtkm::cont::make_ArrayHandleTransform(array, functor, invFunctor);
642  }
643 };
644 
645 template <typename AH, typename Functor, typename InvFunctor>
646 struct Serialization<vtkm::cont::ArrayHandle<
647  typename vtkm::cont::internal::StorageTagTransform<AH, Functor, InvFunctor>::ValueType,
648  vtkm::cont::internal::StorageTagTransform<AH, Functor, InvFunctor>>>
649  : Serialization<vtkm::cont::ArrayHandleTransform<AH, Functor, InvFunctor>>
650 {
651 };
652 
653 } // diy
655 
656 #endif //vtk_m_cont_ArrayHandleTransform_h
vtkm::cont::ArrayHandle
Manages an array-worth of data.
Definition: ArrayHandle.h:300
ArrayHandle.h
vtkm::cont::ArrayHandleTransform::~ArrayHandleTransform
~ArrayHandleTransform()
Implemented so that it is defined exclusively in the control environment.
Definition: ArrayHandleTransform.h:519
vtkm::exec::arg::load
T load(const U &u, vtkm::Id v)
Definition: FetchTagArrayDirectIn.h:36
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
vtkm::cont::ArrayHandleTransform::GetFunctor
FunctorType GetFunctor() const
Returns the functor transforming the ArrayHandle.
Definition: ArrayHandleTransform.h:527
vtkm::Get
auto Get(const vtkm::Tuple< Ts... > &tuple)
Retrieve the object from a vtkm::Tuple at the given index.
Definition: Tuple.h:81
VTKM_ARRAY_HANDLE_SUBCLASS
#define VTKM_ARRAY_HANDLE_SUBCLASS(classname, fullclasstype, superclass)
Macro to make default methods in ArrayHandle subclasses.
Definition: ArrayHandle.h:243
ArrayPortalHelpers.h
RuntimeDeviceTracker.h
VTKM_EXEC_CONT
#define VTKM_EXEC_CONT
Definition: ExportMacros.h:52
vtkm::cont::ArrayHandleTransform::GetInverseFunctor
InverseFunctorType GetInverseFunctor() const
Returns the inverse functor transforming the ArrayHandle
Definition: ArrayHandleTransform.h:531
vtkm::IdComponent
vtkm::Int32 IdComponent
Base type to use to index small lists.
Definition: Types.h:194
vtkm::cont::ArrayHandleTransform::GetTransformedArray
ArrayHandleType GetTransformedArray() const
Returns the ArrayHandle that is being transformed.
Definition: ArrayHandleTransform.h:523
VTKM_STORAGE_NO_RESIZE
#define VTKM_STORAGE_NO_RESIZE
Definition: Storage.h:185
mangled_diy_namespace
Definition: Particle.h:351
vtkm::cont::ArrayHandleTransform::ArrayHandleTransform
ArrayHandleTransform()
Definition: ArrayHandleTransform.h:505
vtkm::cont::Token
A token to hold the scope of an ArrayHandle or other object.
Definition: Token.h:35
VTKM_STORAGE_NO_WRITE_PORTAL
#define VTKM_STORAGE_NO_WRITE_PORTAL
Definition: Storage.h:198
vtkm::cont::ArrayHandleTransform::StorageType
typename Superclass::StorageType StorageType
Definition: ArrayHandleTransform.h:505
VTKM_IS_ARRAY_HANDLE
#define VTKM_IS_ARRAY_HANDLE(T)
Checks that the given type is a vtkm::cont::ArrayHandle.
Definition: ArrayHandle.h:137
VTKM_STATIC_ASSERT_MSG
#define VTKM_STATIC_ASSERT_MSG(condition, message)
Definition: StaticAssert.h:18
DeviceAdapterRuntimeDetectorSerial.h
ExecutionAndControlObjectBase.h
VTKM_CONT
#define VTKM_CONT
Definition: ExportMacros.h:57
vtkm::Id
vtkm::Int64 Id
Base type to use to index arrays.
Definition: Types.h:227
vtkm::cont::ArrayHandleTransform
Implicitly transform values of one array to another with a functor.
Definition: ArrayHandleTransform.h:447
vtkm::VecFlat
Treat a Vec or Vec-like object as a flat Vec.
Definition: VecFlat.h:224
vtkm::cont::ArrayHandleTransform::ArrayHandleTransform
ArrayHandleTransform(const ArrayHandleType &handle, const FunctorType &functor=FunctorType(), const InverseFunctorType &inverseFunctor=InverseFunctorType())
Definition: ArrayHandleTransform.h:507
vtkm::cont::DeviceAdapterId
An object used to specify a device.
Definition: DeviceAdapterTag.h:58
vtkm::cont::ArrayHandleTransform::Superclass
typename vtkm::cont::detail::GetTypeInParentheses< void(vtkm::cont::ArrayHandle< typename internal::StorageTagTransform< ArrayHandleType, FunctorType, InverseFunctorType >::ValueType, internal::StorageTagTransform< ArrayHandleType, FunctorType, InverseFunctorType > >) >::type Superclass
Definition: ArrayHandleTransform.h:505
vtkm::cont::DeviceAdapterTagUndefined
Tag for a device adapter used to avoid specifying a device.
Definition: DeviceAdapterTag.h:187
vtkm::CopyFlag
CopyFlag
Identifier used to specify whether a function should deep copy data.
Definition: Flags.h:17
VTKM_IS_EXECUTION_AND_CONTROL_OBJECT
#define VTKM_IS_EXECUTION_AND_CONTROL_OBJECT(execObject)
Checks that the argument is a proper execution object.
Definition: ExecutionAndControlObjectBase.h:61
ErrorInternal.h
VTKM_ALWAYS_EXPORT
#define VTKM_ALWAYS_EXPORT
Definition: ExportMacros.h:89
ErrorBadType.h
vtkm::cont::make_ArrayHandleTransform
vtkm::cont::ArrayHandleTransform< HandleType, FunctorType > make_ArrayHandleTransform(HandleType handle, FunctorType functor)
make_ArrayHandleTransform is convenience function to generate an ArrayHandleTransform.
Definition: ArrayHandleTransform.h:480
vtkm::cont::ArrayHandleTransform::ValueType
typename Superclass::ValueType ValueType
Definition: ArrayHandleTransform.h:505