VTK-m  2.0
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>()(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 =
250  Storage<typename ArrayHandleType::ValueType, typename ArrayHandleType::StorageTag>;
251 
252  static std::vector<vtkm::cont::internal::Buffer> SourceBuffers(
253  const std::vector<vtkm::cont::internal::Buffer>& buffers)
254  {
255  return std::vector<vtkm::cont::internal::Buffer>(buffers.begin() + 1, buffers.end());
256  }
257 
258 public:
261 
262  using ReadPortalType =
263  vtkm::internal::ArrayPortalTransform<ValueType,
264  typename ArrayHandleType::ReadPortalType,
265  typename FunctorManager::FunctorType>;
266 
267  VTKM_CONT static vtkm::Id GetNumberOfValues(
268  const std::vector<vtkm::cont::internal::Buffer>& buffers)
269  {
270  return SourceStorage::GetNumberOfValues(SourceBuffers(buffers));
271  }
272 
273  VTKM_CONT static ReadPortalType CreateReadPortal(
274  const std::vector<vtkm::cont::internal::Buffer>& buffers,
276  vtkm::cont::Token& token)
277  {
278  if (device == vtkm::cont::DeviceAdapterTagUndefined{})
279  {
280  return ReadPortalType(SourceStorage::CreateReadPortal(SourceBuffers(buffers), device, token),
281  buffers[0].GetMetaData<FunctorManager>().PrepareForControl());
282  }
283  else
284  {
285  return ReadPortalType(
286  SourceStorage::CreateReadPortal(SourceBuffers(buffers), device, token),
287  buffers[0].GetMetaData<FunctorManager>().PrepareForExecution(device, token));
288  }
289  }
290 
291  VTKM_CONT static std::vector<vtkm::cont::internal::Buffer> CreateBuffers(
292  const ArrayHandleType& handle = ArrayHandleType{},
293  const FunctorType& functor = FunctorType())
294  {
295  return vtkm::cont::internal::CreateBuffers(FunctorManager(functor), handle);
296  }
297 
298  VTKM_CONT static ArrayHandleType GetArray(
299  const std::vector<vtkm::cont::internal::Buffer>& buffers)
300  {
301  return vtkm::cont::ArrayHandle<typename ArrayHandleType::ValueType,
302  typename ArrayHandleType::StorageTag>(SourceBuffers(buffers));
303  }
304 
305  VTKM_CONT static FunctorType GetFunctor(const std::vector<vtkm::cont::internal::Buffer>& buffers)
306  {
307  return buffers[0].GetMetaData<FunctorManager>().Functor;
308  }
309 
310  VTKM_CONT static NullFunctorType GetInverseFunctor(
311  const std::vector<vtkm::cont::internal::Buffer>&)
312  {
313  return NullFunctorType{};
314  }
315 };
316 
317 template <typename ArrayHandleType, typename FunctorType, typename InverseFunctorType>
318 class Storage<
319  typename StorageTagTransform<ArrayHandleType, FunctorType, InverseFunctorType>::ValueType,
320  StorageTagTransform<ArrayHandleType, FunctorType, InverseFunctorType>>
321 {
322  using FunctorManager = TransformFunctorManager<FunctorType>;
323  using InverseFunctorManager = TransformFunctorManager<InverseFunctorType>;
324  using ValueType = typename StorageTagTransform<ArrayHandleType, FunctorType>::ValueType;
325 
326  using SourceStorage =
327  Storage<typename ArrayHandleType::ValueType, typename ArrayHandleType::StorageTag>;
328 
329  static std::vector<vtkm::cont::internal::Buffer> SourceBuffers(
330  const std::vector<vtkm::cont::internal::Buffer>& buffers)
331  {
332  return std::vector<vtkm::cont::internal::Buffer>(buffers.begin() + 2, buffers.end());
333  }
334 
335 public:
336  using ReadPortalType =
337  vtkm::internal::ArrayPortalTransform<ValueType,
338  typename ArrayHandleType::ReadPortalType,
339  typename FunctorManager::FunctorType,
340  typename InverseFunctorManager::FunctorType>;
341  using WritePortalType =
342  vtkm::internal::ArrayPortalTransform<ValueType,
343  typename ArrayHandleType::WritePortalType,
344  typename FunctorManager::FunctorType,
345  typename InverseFunctorManager::FunctorType>;
346 
347  VTKM_CONT static vtkm::Id GetNumberOfValues(
348  const std::vector<vtkm::cont::internal::Buffer>& buffers)
349  {
350  return SourceStorage::GetNumberOfValues(SourceBuffers(buffers));
351  }
352 
353  VTKM_CONT static void ResizeBuffers(vtkm::Id numValues,
354  const std::vector<vtkm::cont::internal::Buffer>& buffers,
355  vtkm::CopyFlag preserve,
356  vtkm::cont::Token& token)
357  {
358  std::vector<vtkm::cont::internal::Buffer> sourceBuffers = SourceBuffers(buffers);
359  SourceStorage::ResizeBuffers(numValues, sourceBuffers, preserve, token);
360  }
361 
362  VTKM_CONT static ReadPortalType CreateReadPortal(
363  const std::vector<vtkm::cont::internal::Buffer>& buffers,
365  vtkm::cont::Token& token)
366  {
367  if (device == vtkm::cont::DeviceAdapterTagUndefined{})
368  {
369  return ReadPortalType(SourceStorage::CreateReadPortal(SourceBuffers(buffers), device, token),
370  buffers[0].GetMetaData<FunctorManager>().PrepareForControl(),
371  buffers[1].GetMetaData<InverseFunctorManager>().PrepareForControl());
372  }
373  else
374  {
375  return ReadPortalType(
376  SourceStorage::CreateReadPortal(SourceBuffers(buffers), device, token),
377  buffers[0].GetMetaData<FunctorManager>().PrepareForExecution(device, token),
378  buffers[1].GetMetaData<InverseFunctorManager>().PrepareForExecution(device, token));
379  }
380  }
381 
382  VTKM_CONT static WritePortalType CreateWritePortal(
383  const std::vector<vtkm::cont::internal::Buffer>& buffers,
385  vtkm::cont::Token& token)
386  {
387  return WritePortalType(
388  SourceStorage::CreateWritePortal(SourceBuffers(buffers), device, token),
389  buffers[0].GetMetaData<FunctorManager>().PrepareForExecution(device, token),
390  buffers[1].GetMetaData<InverseFunctorManager>().PrepareForExecution(device, token));
391  }
392 
393  VTKM_CONT static std::vector<vtkm::cont::internal::Buffer> CreateBuffers(
394  const ArrayHandleType& handle = ArrayHandleType{},
395  const FunctorType& functor = FunctorType(),
396  const InverseFunctorType& inverseFunctor = InverseFunctorType())
397  {
398  return vtkm::cont::internal::CreateBuffers(
399  FunctorManager(functor), InverseFunctorManager(inverseFunctor), handle);
400  }
401 
402  VTKM_CONT static ArrayHandleType GetArray(
403  const std::vector<vtkm::cont::internal::Buffer>& buffers)
404  {
405  return vtkm::cont::ArrayHandle<typename ArrayHandleType::ValueType,
406  typename ArrayHandleType::StorageTag>(SourceBuffers(buffers));
407  }
408 
409  VTKM_CONT static FunctorType GetFunctor(const std::vector<vtkm::cont::internal::Buffer>& buffers)
410  {
411  return buffers[0].GetMetaData<FunctorManager>().Functor;
412  }
413 
414  VTKM_CONT static InverseFunctorType GetInverseFunctor(
415  const std::vector<vtkm::cont::internal::Buffer>& buffers)
416  {
417  return buffers[1].GetMetaData<InverseFunctorManager>().Functor;
418  }
419 };
420 
421 } // namespace internal
422 
434 template <typename ArrayHandleType,
435  typename FunctorType,
436  typename InverseFunctorType = internal::NullFunctorType>
438 
439 template <typename ArrayHandleType, typename FunctorType>
440 class ArrayHandleTransform<ArrayHandleType, FunctorType, internal::NullFunctorType>
441  : public vtkm::cont::ArrayHandle<
442  typename internal::StorageTagTransform<ArrayHandleType, FunctorType>::ValueType,
443  internal::StorageTagTransform<ArrayHandleType, FunctorType>>
444 {
445  // If the following line gives a compile error, then the ArrayHandleType
446  // template argument is not a valid ArrayHandle type.
447  VTKM_IS_ARRAY_HANDLE(ArrayHandleType);
448 
449 public:
454  typename internal::StorageTagTransform<ArrayHandleType, FunctorType>::ValueType,
455  internal::StorageTagTransform<ArrayHandleType, FunctorType>>));
456 
457 private:
458  using StorageType = vtkm::cont::internal::Storage<ValueType, StorageTag>;
459 
460 public:
461  VTKM_CONT
462  ArrayHandleTransform(const ArrayHandleType& handle,
463  const FunctorType& functor = FunctorType{},
464  internal::NullFunctorType = internal::NullFunctorType{})
465  : Superclass(StorageType::CreateBuffers(handle, functor))
466  {
467  }
468 };
469 
473 template <typename HandleType, typename FunctorType>
475  HandleType handle,
476  FunctorType functor)
477 {
478  return ArrayHandleTransform<HandleType, FunctorType>(handle, functor);
479 }
480 
481 // ArrayHandleTransform with inverse functors enabled (no need to subclass from
482 // ArrayHandleTransform without inverse functors: nothing to inherit).
483 template <typename ArrayHandleType, typename FunctorType, typename InverseFunctorType>
484 class ArrayHandleTransform
485  : public vtkm::cont::ArrayHandle<
486  typename internal::StorageTagTransform<ArrayHandleType, FunctorType, InverseFunctorType>::
487  ValueType,
488  internal::StorageTagTransform<ArrayHandleType, FunctorType, InverseFunctorType>>
489 {
490  VTKM_IS_ARRAY_HANDLE(ArrayHandleType);
491 
492 public:
495  (ArrayHandleTransform<ArrayHandleType, FunctorType, InverseFunctorType>),
497  typename internal::StorageTagTransform<ArrayHandleType, FunctorType, InverseFunctorType>::
498  ValueType,
499  internal::StorageTagTransform<ArrayHandleType, FunctorType, InverseFunctorType>>));
500 
501 private:
502  using StorageType = vtkm::cont::internal::Storage<ValueType, StorageTag>;
503 
504 public:
505  ArrayHandleTransform(const ArrayHandleType& handle,
506  const FunctorType& functor = FunctorType(),
507  const InverseFunctorType& inverseFunctor = InverseFunctorType())
508  : Superclass(StorageType::CreateBuffers(handle, functor, inverseFunctor))
509  {
510  }
511 
518 
521  ArrayHandleType GetTransformedArray() const { return StorageType::GetArray(this->GetBuffers()); }
522 
525  FunctorType GetFunctor() const { return StorageType::GetFunctor(this->GetBuffers()); }
526 
529  InverseFunctorType GetInverseFunctor() const
530  {
531  return StorageType::GetInverseFunctor(this->GetBuffers());
532  }
533 };
534 
535 template <typename HandleType, typename FunctorType, typename InverseFunctorType>
537 make_ArrayHandleTransform(HandleType handle, FunctorType functor, InverseFunctorType inverseFunctor)
538 {
540  handle, functor, inverseFunctor);
541 }
542 }
543 
544 } // namespace vtkm::cont
545 
546 //=============================================================================
547 // Specializations of serialization related classes
549 namespace vtkm
550 {
551 namespace cont
552 {
553 
554 template <typename AH, typename Functor, typename InvFunctor>
555 struct SerializableTypeString<vtkm::cont::ArrayHandleTransform<AH, Functor, InvFunctor>>
556 {
557  static VTKM_CONT const std::string& Get()
558  {
559  static std::string name = "AH_Transform<" + SerializableTypeString<AH>::Get() + "," +
561  ">";
562  return name;
563  }
564 };
565 
566 template <typename AH, typename Functor>
567 struct SerializableTypeString<vtkm::cont::ArrayHandleTransform<AH, Functor>>
568 {
569  static VTKM_CONT const std::string& Get()
570  {
571  static std::string name = "AH_Transform<" + SerializableTypeString<AH>::Get() + "," +
573  return name;
574  }
575 };
576 
577 template <typename AH, typename Functor, typename InvFunctor>
578 struct SerializableTypeString<vtkm::cont::ArrayHandle<
579  typename vtkm::cont::internal::StorageTagTransform<AH, Functor, InvFunctor>::ValueType,
580  vtkm::cont::internal::StorageTagTransform<AH, Functor, InvFunctor>>>
581  : SerializableTypeString<vtkm::cont::ArrayHandleTransform<AH, Functor, InvFunctor>>
582 {
583 };
584 }
585 } // vtkm::cont
586 
587 namespace mangled_diy_namespace
588 {
589 
590 template <typename AH, typename Functor>
591 struct Serialization<vtkm::cont::ArrayHandleTransform<AH, Functor>>
592 {
593 private:
596 
597 public:
598  static VTKM_CONT void save(BinaryBuffer& bb, const BaseType& obj)
599  {
600  Type transformedArray = obj;
601  vtkmdiy::save(bb, obj.GetArray());
602  vtkmdiy::save(bb, obj.GetFunctor());
603  }
604 
605  static VTKM_CONT void load(BinaryBuffer& bb, BaseType& obj)
606  {
607  AH array;
608  vtkmdiy::load(bb, array);
609  Functor functor;
610  vtkmdiy::load(bb, functor);
611  obj = vtkm::cont::make_ArrayHandleTransform(array, functor);
612  }
613 };
614 
615 template <typename AH, typename Functor, typename InvFunctor>
616 struct Serialization<vtkm::cont::ArrayHandleTransform<AH, Functor, InvFunctor>>
617 {
618 private:
621 
622 public:
623  static VTKM_CONT void save(BinaryBuffer& bb, const BaseType& obj)
624  {
625  Type transformedArray = obj;
626  vtkmdiy::save(bb, transformedArray.GetTransformedArray());
627  vtkmdiy::save(bb, transformedArray.GetFunctor());
628  vtkmdiy::save(bb, transformedArray.GetInverseFunctor());
629  }
630 
631  static VTKM_CONT void load(BinaryBuffer& bb, BaseType& obj)
632  {
633  AH array;
634  vtkmdiy::load(bb, array);
635  Functor functor;
636  vtkmdiy::load(bb, functor);
637  InvFunctor invFunctor;
638  vtkmdiy::load(bb, invFunctor);
639  obj = vtkm::cont::make_ArrayHandleTransform(array, functor, invFunctor);
640  }
641 };
642 
643 template <typename AH, typename Functor, typename InvFunctor>
644 struct Serialization<vtkm::cont::ArrayHandle<
645  typename vtkm::cont::internal::StorageTagTransform<AH, Functor, InvFunctor>::ValueType,
646  vtkm::cont::internal::StorageTagTransform<AH, Functor, InvFunctor>>>
647  : Serialization<vtkm::cont::ArrayHandleTransform<AH, Functor, InvFunctor>>
648 {
649 };
650 
651 } // diy
653 
654 #endif //vtk_m_cont_ArrayHandleTransform_h
vtkm::cont::ArrayHandleTransform::VTKM_IS_ARRAY_HANDLE
VTKM_IS_ARRAY_HANDLE(ArrayHandleType)
vtkm::cont::ArrayHandle
Manages an array-worth of data.
Definition: ArrayHandle.h:283
ArrayHandle.h
vtkm::cont::ArrayHandleTransform::~ArrayHandleTransform
~ArrayHandleTransform()
Implemented so that it is defined exclusively in the control environment.
Definition: ArrayHandleTransform.h:517
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:525
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:529
vtkm::Get
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_EXEC_CONT auto Get(const vtkm::Tuple< Ts... > &tuple) -> decltype(tuple.template Get< Index >())
Retrieve the object from a vtkm::Tuple at the given index.
Definition: Tuple.h:83
vtkm::cont::ArrayHandleTransform::GetTransformedArray
ArrayHandleType GetTransformedArray() const
Returns the ArrayHandle that is being transformed.
Definition: ArrayHandleTransform.h:521
VTKM_STORAGE_NO_RESIZE
#define VTKM_STORAGE_NO_RESIZE
Definition: Storage.h:185
mangled_diy_namespace
Definition: Particle.h:331
vtkm::Id
vtkm::Int32 Id
Represents an ID (index into arrays).
Definition: Types.h:191
vtkm::exec::arg::load
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_EXEC T load(const U &u, vtkm::Id v)
Definition: FetchTagArrayDirectIn.h:36
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::VTKM_ARRAY_HANDLE_SUBCLASS
VTKM_ARRAY_HANDLE_SUBCLASS(ArrayHandleTransform,(ArrayHandleTransform< ArrayHandleType, FunctorType, InverseFunctorType >),(vtkm::cont::ArrayHandle< typename internal::StorageTagTransform< ArrayHandleType, FunctorType, InverseFunctorType >::ValueType, internal::StorageTagTransform< ArrayHandleType, FunctorType, InverseFunctorType >>))
vtkm::cont::make_ArrayHandleTransform
VTKM_CONT vtkm::cont::ArrayHandleTransform< HandleType, FunctorType > make_ArrayHandleTransform(HandleType handle, FunctorType functor)
make_ArrayHandleTransform is convenience function to generate an ArrayHandleTransform.
Definition: ArrayHandleTransform.h:474
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::cont::ArrayHandleTransform
Implicitly transform values of one array to another with a functor.
Definition: ArrayHandleTransform.h:437
vtkm::cont::ArrayHandleTransform::ArrayHandleTransform
ArrayHandleTransform(const ArrayHandleType &handle, const FunctorType &functor=FunctorType(), const InverseFunctorType &inverseFunctor=InverseFunctorType())
Definition: ArrayHandleTransform.h:505
vtkm::cont::DeviceAdapterId
Definition: DeviceAdapterTag.h:52
vtkm::cont::ArrayHandleTransform::StorageType
vtkm::cont::internal::Storage< ValueType, StorageTag > StorageType
Definition: ArrayHandleTransform.h:502
vtkm::CopyFlag
CopyFlag
Definition: Flags.h:16
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:92
ErrorBadType.h