VTK-m  2.0
ArrayHandleCartesianProduct.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_ArrayHandleCartesianProduct_h
11 #define vtk_m_cont_ArrayHandleCartesianProduct_h
12 
13 #include <vtkm/Assert.h>
14 
16 #include <vtkm/cont/ArrayHandle.h>
18 #include <vtkm/cont/Token.h>
19 
20 #include <array>
21 
22 namespace vtkm
23 {
24 namespace internal
25 {
26 
29 template <typename ValueType_,
30  typename PortalTypeFirst_,
31  typename PortalTypeSecond_,
32  typename PortalTypeThird_>
33 class VTKM_ALWAYS_EXPORT ArrayPortalCartesianProduct
34 {
35 public:
36  using ValueType = ValueType_;
37  using IteratorType = ValueType_;
38  using PortalTypeFirst = PortalTypeFirst_;
39  using PortalTypeSecond = PortalTypeSecond_;
40  using PortalTypeThird = PortalTypeThird_;
41 
42  using set_supported_p1 = vtkm::internal::PortalSupportsSets<PortalTypeFirst>;
43  using set_supported_p2 = vtkm::internal::PortalSupportsSets<PortalTypeSecond>;
44  using set_supported_p3 = vtkm::internal::PortalSupportsSets<PortalTypeThird>;
45 
46  using Writable = std::integral_constant<bool,
47  set_supported_p1::value && set_supported_p2::value &&
48  set_supported_p3::value>;
49 
52  ArrayPortalCartesianProduct()
53  : PortalFirst()
54  , PortalSecond()
55  , PortalThird()
56  {
57  } //needs to be host and device so that cuda can create lvalue of these
58 
59  VTKM_CONT
60  ArrayPortalCartesianProduct(const PortalTypeFirst& portalfirst,
61  const PortalTypeSecond& portalsecond,
62  const PortalTypeThird& portalthird)
63  : PortalFirst(portalfirst)
64  , PortalSecond(portalsecond)
65  , PortalThird(portalthird)
66  {
67  }
68 
73 
74  template <class OtherV, class OtherP1, class OtherP2, class OtherP3>
75  VTKM_CONT ArrayPortalCartesianProduct(
76  const ArrayPortalCartesianProduct<OtherV, OtherP1, OtherP2, OtherP3>& src)
77  : PortalFirst(src.GetPortalFirst())
78  , PortalSecond(src.GetPortalSecond())
79  , PortalThird(src.GetPortalThird())
80  {
81  }
82 
85  vtkm::Id GetNumberOfValues() const
86  {
87  return this->PortalFirst.GetNumberOfValues() * this->PortalSecond.GetNumberOfValues() *
88  this->PortalThird.GetNumberOfValues();
89  }
90 
93  ValueType Get(vtkm::Id index) const
94  {
95  VTKM_ASSERT(index >= 0);
96  VTKM_ASSERT(index < this->GetNumberOfValues());
97 
98  vtkm::Id dim1 = this->PortalFirst.GetNumberOfValues();
99  vtkm::Id dim2 = this->PortalSecond.GetNumberOfValues();
100  vtkm::Id dim12 = dim1 * dim2;
101  vtkm::Id idx12 = index % dim12;
102  vtkm::Id i1 = idx12 % dim1;
103  vtkm::Id i2 = idx12 / dim1;
104  vtkm::Id i3 = index / dim12;
105 
106  return vtkm::make_Vec(
107  this->PortalFirst.Get(i1), this->PortalSecond.Get(i2), this->PortalThird.Get(i3));
108  }
109 
110 
112  template <typename Writable_ = Writable,
113  typename = typename std::enable_if<Writable_::value>::type>
114  VTKM_EXEC_CONT void Set(vtkm::Id index, const ValueType& value) const
115  {
116  VTKM_ASSERT(index >= 0);
117  VTKM_ASSERT(index < this->GetNumberOfValues());
118 
119  vtkm::Id dim1 = this->PortalFirst.GetNumberOfValues();
120  vtkm::Id dim2 = this->PortalSecond.GetNumberOfValues();
121  vtkm::Id dim12 = dim1 * dim2;
122  vtkm::Id idx12 = index % dim12;
123 
124  vtkm::Id i1 = idx12 % dim1;
125  vtkm::Id i2 = idx12 / dim1;
126  vtkm::Id i3 = index / dim12;
127 
128  this->PortalFirst.Set(i1, value[0]);
129  this->PortalSecond.Set(i2, value[1]);
130  this->PortalThird.Set(i3, value[2]);
131  }
132 
135  const PortalTypeFirst& GetFirstPortal() const { return this->PortalFirst; }
136 
139  const PortalTypeSecond& GetSecondPortal() const { return this->PortalSecond; }
140 
143  const PortalTypeThird& GetThirdPortal() const { return this->PortalThird; }
144 
145 private:
146  PortalTypeFirst PortalFirst;
147  PortalTypeSecond PortalSecond;
148  PortalTypeThird PortalThird;
149 };
150 }
151 } // namespace vtkm::internal
152 
153 namespace vtkm
154 {
155 namespace cont
156 {
157 
158 template <typename StorageTag1, typename StorageTag2, typename StorageTag3>
160 {
161 };
162 
163 namespace internal
164 {
165 
169 template <typename AH1, typename AH2, typename AH3>
170 struct ArrayHandleCartesianProductTraits
171 {
175 
176  using ComponentType = typename AH1::ValueType;
178  (std::is_same<ComponentType, typename AH2::ValueType>::value),
179  "All arrays for ArrayHandleCartesianProduct must have the same value type. "
180  "Use ArrayHandleCast as necessary to make types match.");
182  (std::is_same<ComponentType, typename AH3::ValueType>::value),
183  "All arrays for ArrayHandleCartesianProduct must have the same value type. "
184  "Use ArrayHandleCast as necessary to make types match.");
185 
188  using ValueType = vtkm::Vec<ComponentType, 3>;
189 
192  using Tag = vtkm::cont::StorageTagCartesianProduct<typename AH1::StorageTag,
193  typename AH2::StorageTag,
194  typename AH3::StorageTag>;
195 
198  using Superclass = vtkm::cont::ArrayHandle<ValueType, Tag>;
199 };
200 
201 template <typename T, typename ST1, typename ST2, typename ST3>
202 class Storage<vtkm::Vec<T, 3>, vtkm::cont::StorageTagCartesianProduct<ST1, ST2, ST3>>
203 {
204  struct Info
205  {
206  std::array<std::size_t, 4> BufferOffset;
207  };
208 
209  using Storage1 = vtkm::cont::internal::Storage<T, ST1>;
210  using Storage2 = vtkm::cont::internal::Storage<T, ST2>;
211  using Storage3 = vtkm::cont::internal::Storage<T, ST3>;
212 
213  using Array1 = vtkm::cont::ArrayHandle<T, ST1>;
214  using Array2 = vtkm::cont::ArrayHandle<T, ST2>;
215  using Array3 = vtkm::cont::ArrayHandle<T, ST3>;
216 
217  VTKM_CONT static std::vector<vtkm::cont::internal::Buffer> GetBuffers(
218  const std::vector<vtkm::cont::internal::Buffer>& buffers,
219  std::size_t subArray)
220  {
221  Info info = buffers[0].GetMetaData<Info>();
222  return std::vector<vtkm::cont::internal::Buffer>(buffers.begin() +
223  info.BufferOffset[subArray - 1],
224  buffers.begin() + info.BufferOffset[subArray]);
225  }
226 
227 public:
229 
230  using ReadPortalType =
231  vtkm::internal::ArrayPortalCartesianProduct<vtkm::Vec<T, 3>,
232  typename Storage1::ReadPortalType,
233  typename Storage2::ReadPortalType,
234  typename Storage3::ReadPortalType>;
235  using WritePortalType =
236  vtkm::internal::ArrayPortalCartesianProduct<vtkm::Vec<T, 3>,
237  typename Storage1::WritePortalType,
238  typename Storage2::WritePortalType,
239  typename Storage3::WritePortalType>;
240 
241  VTKM_CONT static vtkm::Id GetNumberOfValues(
242  const std::vector<vtkm::cont::internal::Buffer>& buffers)
243  {
244  return (Storage1::GetNumberOfValues(GetBuffers(buffers, 1)) *
245  Storage2::GetNumberOfValues(GetBuffers(buffers, 2)) *
246  Storage3::GetNumberOfValues(GetBuffers(buffers, 3)));
247  }
248 
249  VTKM_CONT static void Fill(const std::vector<vtkm::cont::internal::Buffer>& buffers,
250  const vtkm::Vec<T, 3>& fillValue,
251  vtkm::Id startIndex,
252  vtkm::Id endIndex,
253  vtkm::cont::Token& token)
254  {
255  if ((startIndex != 0) || (endIndex != GetNumberOfValues(buffers)))
256  {
258  "Fill for ArrayHandleCartesianProduct can only be used to fill entire array.");
259  }
260  auto subBuffers = GetBuffers(buffers, 1);
261  Storage1::Fill(subBuffers, fillValue[0], 0, Storage1::GetNumberOfValues(subBuffers), token);
262  subBuffers = GetBuffers(buffers, 2);
263  Storage2::Fill(subBuffers, fillValue[1], 0, Storage2::GetNumberOfValues(subBuffers), token);
264  subBuffers = GetBuffers(buffers, 3);
265  Storage3::Fill(subBuffers, fillValue[2], 0, Storage3::GetNumberOfValues(subBuffers), token);
266  }
267 
268  VTKM_CONT static ReadPortalType CreateReadPortal(
269  const std::vector<vtkm::cont::internal::Buffer>& buffers,
271  vtkm::cont::Token& token)
272  {
273  return ReadPortalType(Storage1::CreateReadPortal(GetBuffers(buffers, 1), device, token),
274  Storage2::CreateReadPortal(GetBuffers(buffers, 2), device, token),
275  Storage3::CreateReadPortal(GetBuffers(buffers, 3), device, token));
276  }
277 
278  VTKM_CONT static WritePortalType CreateWritePortal(
279  const std::vector<vtkm::cont::internal::Buffer>& buffers,
281  vtkm::cont::Token& token)
282  {
283  return WritePortalType(Storage1::CreateWritePortal(GetBuffers(buffers, 1), device, token),
284  Storage2::CreateWritePortal(GetBuffers(buffers, 2), device, token),
285  Storage3::CreateWritePortal(GetBuffers(buffers, 3), device, token));
286  }
287 
288  VTKM_CONT static Array1 GetArrayHandle1(const std::vector<vtkm::cont::internal::Buffer>& buffers)
289  {
290  return Array1(GetBuffers(buffers, 1));
291  }
292  VTKM_CONT static Array2 GetArrayHandle2(const std::vector<vtkm::cont::internal::Buffer>& buffers)
293  {
294  return Array2(GetBuffers(buffers, 2));
295  }
296  VTKM_CONT static Array3 GetArrayHandle3(const std::vector<vtkm::cont::internal::Buffer>& buffers)
297  {
298  return Array3(GetBuffers(buffers, 3));
299  }
300 
301  VTKM_CONT static std::vector<vtkm::cont::internal::Buffer> CreateBuffers(
302  const Array1& array1 = Array1{},
303  const Array2& array2 = Array2{},
304  const Array3& array3 = Array3{})
305  {
306  const std::vector<vtkm::cont::internal::Buffer>& buffers1 = array1.GetBuffers();
307  const std::vector<vtkm::cont::internal::Buffer>& buffers2 = array2.GetBuffers();
308  const std::vector<vtkm::cont::internal::Buffer>& buffers3 = array3.GetBuffers();
309 
310  Info info;
311  info.BufferOffset[0] = 1;
312  info.BufferOffset[1] = info.BufferOffset[0] + buffers1.size();
313  info.BufferOffset[2] = info.BufferOffset[1] + buffers2.size();
314  info.BufferOffset[3] = info.BufferOffset[2] + buffers3.size();
315 
316  return vtkm::cont::internal::CreateBuffers(info, buffers1, buffers2, buffers3);
317  }
318 };
319 } // namespace internal
320 
325 template <typename FirstHandleType, typename SecondHandleType, typename ThirdHandleType>
327  : public internal::ArrayHandleCartesianProductTraits<FirstHandleType,
328  SecondHandleType,
329  ThirdHandleType>::Superclass
330 {
331  // If the following line gives a compile error, then the FirstHandleType
332  // template argument is not a valid ArrayHandle type.
333  VTKM_IS_ARRAY_HANDLE(FirstHandleType);
334  VTKM_IS_ARRAY_HANDLE(SecondHandleType);
335  VTKM_IS_ARRAY_HANDLE(ThirdHandleType);
336 
337 public:
341  (typename internal::ArrayHandleCartesianProductTraits<FirstHandleType,
342  SecondHandleType,
343  ThirdHandleType>::Superclass));
344 
345 private:
346  using StorageType = vtkm::cont::internal::Storage<ValueType, StorageTag>;
347 
348 public:
349  VTKM_CONT
350  ArrayHandleCartesianProduct(const FirstHandleType& firstArray,
351  const SecondHandleType& secondArray,
352  const ThirdHandleType& thirdArray)
353  : Superclass(StorageType::CreateBuffers(firstArray, secondArray, thirdArray))
354  {
355  }
356 
363 
364  VTKM_CONT FirstHandleType GetFirstArray() const
365  {
366  return StorageType::GetArrayHandle1(this->GetBuffers());
367  }
368  VTKM_CONT SecondHandleType GetSecondArray() const
369  {
370  return StorageType::GetArrayHandle2(this->GetBuffers());
371  }
372  VTKM_CONT ThirdHandleType GetThirdArray() const
373  {
374  return StorageType::GetArrayHandle3(this->GetBuffers());
375  }
376 };
377 
381 template <typename FirstHandleType, typename SecondHandleType, typename ThirdHandleType>
382 VTKM_CONT
384  make_ArrayHandleCartesianProduct(const FirstHandleType& first,
385  const SecondHandleType& second,
386  const ThirdHandleType& third)
387 {
389  first, second, third);
390 }
391 
392 //--------------------------------------------------------------------------------
393 // Specialization of ArrayExtractComponent
394 namespace internal
395 {
396 
397 // Superclass will inherit the ArrayExtractComponentImplInefficient property if any
398 // of the sub-storage are inefficient (thus making everything inefficient).
399 template <typename... STs>
400 struct ArrayExtractComponentImpl<vtkm::cont::StorageTagCartesianProduct<STs...>>
401  : vtkm::cont::internal::ArrayExtractComponentImplInherit<STs...>
402 {
403  template <typename T>
404  vtkm::cont::ArrayHandleStride<T> AdjustStrideForComponent(
405  const vtkm::cont::ArrayHandleStride<T>& componentArray,
406  const vtkm::Id3& dims,
407  vtkm::IdComponent component,
408  vtkm::Id totalNumValues) const
409  {
410  VTKM_ASSERT(componentArray.GetModulo() == 0);
411  VTKM_ASSERT(componentArray.GetDivisor() == 1);
412 
413  vtkm::Id modulo = 0;
414  if (component < 2)
415  {
416  modulo = dims[component];
417  }
418 
419  vtkm::Id divisor = 1;
420  for (vtkm::IdComponent c = 0; c < component; ++c)
421  {
422  divisor *= dims[c];
423  }
424 
425  return vtkm::cont::ArrayHandleStride<T>(componentArray.GetBasicArray(),
426  totalNumValues,
427  componentArray.GetStride(),
428  componentArray.GetOffset(),
429  modulo,
430  divisor);
431  }
432 
433  template <typename T, typename ST, typename CartesianArrayType>
435  GetStrideForComponentArray(const vtkm::cont::ArrayHandle<T, ST>& componentArray,
436  const CartesianArrayType& cartesianArray,
437  vtkm::IdComponent subIndex,
438  vtkm::IdComponent productIndex,
439  vtkm::CopyFlag allowCopy) const
440  {
442  ArrayExtractComponentImpl<ST>{}(componentArray, subIndex, allowCopy);
443  if ((strideArray.GetModulo() != 0) || (strideArray.GetDivisor() != 1))
444  {
445  // If the sub array has its own modulo and/or divisor, that will likely interfere
446  // with this math. Give up and fall back to simple copy.
447  constexpr vtkm::IdComponent NUM_SUB_COMPONENTS = vtkm::VecFlat<T>::NUM_COMPONENTS;
448  return vtkm::cont::internal::ArrayExtractComponentFallback(
449  cartesianArray, (productIndex * NUM_SUB_COMPONENTS) + subIndex, allowCopy);
450  }
451 
452  vtkm::Id3 dims = { cartesianArray.GetFirstArray().GetNumberOfValues(),
453  cartesianArray.GetSecondArray().GetNumberOfValues(),
454  cartesianArray.GetThirdArray().GetNumberOfValues() };
455 
456  return this->AdjustStrideForComponent(
457  strideArray, dims, productIndex, cartesianArray.GetNumberOfValues());
458  }
459 
460  template <typename T>
463  src,
464  vtkm::IdComponent componentIndex,
465  vtkm::CopyFlag allowCopy) const
466  {
468  constexpr vtkm::IdComponent NUM_SUB_COMPONENTS = vtkm::VecFlat<T>::NUM_COMPONENTS;
469  vtkm::IdComponent subIndex = componentIndex % NUM_SUB_COMPONENTS;
470  vtkm::IdComponent productIndex = componentIndex / NUM_SUB_COMPONENTS;
471 
472  switch (productIndex)
473  {
474  case 0:
475  return this->GetStrideForComponentArray(
476  array.GetFirstArray(), array, subIndex, productIndex, allowCopy);
477  case 1:
478  return this->GetStrideForComponentArray(
479  array.GetSecondArray(), array, subIndex, productIndex, allowCopy);
480  case 2:
481  return this->GetStrideForComponentArray(
482  array.GetThirdArray(), array, subIndex, productIndex, allowCopy);
483  default:
484  throw vtkm::cont::ErrorBadValue("Invalid component index to ArrayExtractComponent.");
485  }
486  }
487 };
488 
489 } // namespace internal
490 
491 }
492 } // namespace vtkm::cont
493 
494 //=============================================================================
495 // Specializations of serialization related classes
497 namespace vtkm
498 {
499 namespace cont
500 {
501 
502 template <typename AH1, typename AH2, typename AH3>
503 struct SerializableTypeString<vtkm::cont::ArrayHandleCartesianProduct<AH1, AH2, AH3>>
504 {
505  static VTKM_CONT const std::string& Get()
506  {
507  static std::string name = "AH_CartesianProduct<" + SerializableTypeString<AH1>::Get() + "," +
509  return name;
510  }
511 };
512 
513 template <typename T, typename ST1, typename ST2, typename ST3>
514 struct SerializableTypeString<
515  vtkm::cont::ArrayHandle<vtkm::Vec<T, 3>, vtkm::cont::StorageTagCartesianProduct<ST1, ST2, ST3>>>
516  : SerializableTypeString<vtkm::cont::ArrayHandleCartesianProduct<vtkm::cont::ArrayHandle<T, ST1>,
517  vtkm::cont::ArrayHandle<T, ST2>,
518  vtkm::cont::ArrayHandle<T, ST3>>>
519 {
520 };
521 }
522 } // vtkm::cont
523 
524 namespace mangled_diy_namespace
525 {
526 
527 template <typename AH1, typename AH2, typename AH3>
528 struct Serialization<vtkm::cont::ArrayHandleCartesianProduct<AH1, AH2, AH3>>
529 {
530 private:
533 
534 public:
535  static VTKM_CONT void save(BinaryBuffer& bb, const BaseType& obj)
536  {
537  Type array = obj;
538  vtkmdiy::save(bb, array.GetFirstArray());
539  vtkmdiy::save(bb, array.GetSecondArray());
540  vtkmdiy::save(bb, array.GetThirdArray());
541  }
542 
543  static VTKM_CONT void load(BinaryBuffer& bb, BaseType& obj)
544  {
545  AH1 array1;
546  AH2 array2;
547  AH3 array3;
548 
549  vtkmdiy::load(bb, array1);
550  vtkmdiy::load(bb, array2);
551  vtkmdiy::load(bb, array3);
552 
553  obj = vtkm::cont::make_ArrayHandleCartesianProduct(array1, array2, array3);
554  }
555 };
556 
557 template <typename T, typename ST1, typename ST2, typename ST3>
558 struct Serialization<
559  vtkm::cont::ArrayHandle<vtkm::Vec<T, 3>, vtkm::cont::StorageTagCartesianProduct<ST1, ST2, ST3>>>
560  : Serialization<vtkm::cont::ArrayHandleCartesianProduct<vtkm::cont::ArrayHandle<T, ST1>,
561  vtkm::cont::ArrayHandle<T, ST2>,
562  vtkm::cont::ArrayHandle<T, ST3>>>
563 {
564 };
565 } // diy
567 
568 #endif //vtk_m_cont_ArrayHandleCartesianProduct_h
vtkm::cont::ArrayHandle::GetBuffers
const VTKM_CONT std::vector< vtkm::cont::internal::Buffer > & GetBuffers() const
Returns the internal Buffer structures that hold the data.
Definition: ArrayHandle.h:696
ErrorBadAllocation.h
vtkm::cont::ArrayHandle
Manages an array-worth of data.
Definition: ArrayHandle.h:283
ArrayHandle.h
ArrayExtractComponent.h
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
VTKM_ASSERT
#define VTKM_ASSERT(condition)
Definition: Assert.h:43
vtkm::cont::ArrayHandleCartesianProduct::GetThirdArray
VTKM_CONT ThirdHandleType GetThirdArray() const
Definition: ArrayHandleCartesianProduct.h:372
VTKM_EXEC_CONT
#define VTKM_EXEC_CONT
Definition: ExportMacros.h:52
vtkm::cont::ArrayHandleCartesianProduct::VTKM_ARRAY_HANDLE_SUBCLASS
VTKM_ARRAY_HANDLE_SUBCLASS(ArrayHandleCartesianProduct,(ArrayHandleCartesianProduct< FirstHandleType, SecondHandleType, ThirdHandleType >),(typename internal::ArrayHandleCartesianProductTraits< FirstHandleType, SecondHandleType, ThirdHandleType >::Superclass))
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::IdComponent
vtkm::Int32 IdComponent
Represents a component ID (index of component in a vector).
Definition: Types.h:168
vtkm::cont::ArrayHandleStride::GetStride
vtkm::Id GetStride() const
Definition: ArrayHandleStride.h:294
vtkm::cont::ArrayHandleCartesianProduct
ArrayHandleCartesianProduct is a specialization of ArrayHandle.
Definition: ArrayHandleCartesianProduct.h:326
vtkm::cont::ArrayHandleCartesianProduct::VTKM_IS_ARRAY_HANDLE
VTKM_IS_ARRAY_HANDLE(FirstHandleType)
vtkm::cont::ArrayHandleStride::GetOffset
vtkm::Id GetOffset() const
Definition: ArrayHandleStride.h:295
vtkm::cont::StorageTagCartesianProduct
Definition: ArrayHandleCartesianProduct.h:159
Assert.h
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::ArrayHandleStride
An ArrayHandle that accesses a basic array with strides and offsets.
Definition: ArrayHandleStride.h:251
vtkm::cont::Token
A token to hold the scope of an ArrayHandle or other object.
Definition: Token.h:35
vtkm::cont::LogLevel::Info
@ Info
Information messages (detected hardware, etc) and temporary debugging output.
vtkm::cont::ArrayHandleStride::GetDivisor
vtkm::Id GetDivisor() const
Definition: ArrayHandleStride.h:297
vtkm::cont::ArrayHandleStride::GetBasicArray
vtkm::cont::ArrayHandleBasic< T > GetBasicArray() const
Definition: ArrayHandleStride.h:299
VTKM_IS_ARRAY_HANDLE
#define VTKM_IS_ARRAY_HANDLE(T)
Definition: ArrayHandle.h:132
vtkm::cont::ArrayHandleCartesianProduct::ArrayHandleCartesianProduct
VTKM_CONT ArrayHandleCartesianProduct(const FirstHandleType &firstArray, const SecondHandleType &secondArray, const ThirdHandleType &thirdArray)
Definition: ArrayHandleCartesianProduct.h:350
VTKM_STATIC_ASSERT_MSG
#define VTKM_STATIC_ASSERT_MSG(condition, message)
Definition: StaticAssert.h:18
vtkm::cont::ArrayHandleCartesianProduct::GetSecondArray
VTKM_CONT SecondHandleType GetSecondArray() const
Definition: ArrayHandleCartesianProduct.h:368
VTKM_CONT
#define VTKM_CONT
Definition: ExportMacros.h:57
vtkm::cont::ArrayHandleCartesianProduct::~ArrayHandleCartesianProduct
~ArrayHandleCartesianProduct()
Implemented so that it is defined exclusively in the control environment.
Definition: ArrayHandleCartesianProduct.h:362
vtkm::VecFlat
Treat a Vec or Vec-like object as a flat Vec.
Definition: VecFlat.h:224
vtkm::make_Vec
constexpr VTKM_EXEC_CONT vtkm::Vec< T, vtkm::IdComponent(sizeof...(Ts)+1)> make_Vec(T value0, Ts &&... args)
Initializes and returns a Vec containing all the arguments.
Definition: Types.h:1212
vtkm::cont::ArrayHandleCartesianProduct::GetFirstArray
VTKM_CONT FirstHandleType GetFirstArray() const
Definition: ArrayHandleCartesianProduct.h:364
vtkm::cont::ArrayHandleStride::GetModulo
vtkm::Id GetModulo() const
Definition: ArrayHandleStride.h:296
vtkm::cont::DeviceAdapterId
Definition: DeviceAdapterTag.h:52
vtkm::Vec< T, 3 >
Definition: Types.h:975
vtkm::Vec
A short fixed-length array.
Definition: Types.h:767
vtkm::cont::ErrorBadValue
This class is thrown when a VTKm function or method encounters an invalid value that inhibits progres...
Definition: ErrorBadValue.h:25
vtkm::cont::ArrayHandle::StorageType
vtkm::cont::internal::Storage< ValueType, StorageTag > StorageType
Definition: ArrayHandle.h:292
vtkm::CopyFlag
CopyFlag
Definition: Flags.h:16
VTKM_ALWAYS_EXPORT
#define VTKM_ALWAYS_EXPORT
Definition: ExportMacros.h:92
Token.h
VTKM_SUPPRESS_EXEC_WARNINGS
#define VTKM_SUPPRESS_EXEC_WARNINGS
Definition: ExportMacros.h:53
vtkm::cont::make_ArrayHandleCartesianProduct
VTKM_CONT vtkm::cont::ArrayHandleCartesianProduct< FirstHandleType, SecondHandleType, ThirdHandleType > make_ArrayHandleCartesianProduct(const FirstHandleType &first, const SecondHandleType &second, const ThirdHandleType &third)
A convenience function for creating an ArrayHandleCartesianProduct.
Definition: ArrayHandleCartesianProduct.h:384