VTK-m  2.2
ArrayHandleRuntimeVec.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_ArrayHandleRuntimeVec_h
11 #define vtk_m_cont_ArrayHandleRuntimeVec_h
12 
14 #include <vtkm/cont/ArrayHandle.h>
16 #include <vtkm/cont/ArrayPortal.h>
17 #include <vtkm/cont/ErrorBadType.h>
18 
19 #include <vtkm/Assert.h>
20 #include <vtkm/StaticAssert.h>
21 #include <vtkm/VecFromPortal.h>
22 #include <vtkm/VecTraits.h>
23 
24 namespace vtkm
25 {
26 namespace internal
27 {
28 
29 namespace detail
30 {
31 
32 template <typename T>
33 struct UnrollVecImpl
34 {
35  using type = vtkm::Vec<T, 1>;
36 };
37 
38 template <typename T, vtkm::IdComponent N>
39 struct UnrollVecImpl<vtkm::Vec<T, N>>
40 {
41  using subtype = typename UnrollVecImpl<T>::type;
43 };
44 
45 } // namespace detail
46 
47 // A helper class that unrolls a nested `Vec` to a single layer `Vec`. This is similar
48 // to `vtkm::VecFlat`, except that this only flattens `vtkm::Vec<T,N>` objects, and not
49 // any other `Vec`-like objects. The reason is that a `vtkm::Vec<T,N>` is the same as N
50 // consecutive `T` objects whereas the same may not be said about other `Vec`-like objects.
51 template <typename T>
52 using UnrollVec = typename detail::UnrollVecImpl<T>::type;
53 
54 template <typename ComponentsPortalType>
55 class VTKM_ALWAYS_EXPORT ArrayPortalRuntimeVec
56 {
57 public:
58  using ComponentType = typename std::remove_const<typename ComponentsPortalType::ValueType>::type;
60 
61  ArrayPortalRuntimeVec() = default;
62 
63  VTKM_EXEC_CONT ArrayPortalRuntimeVec(const ComponentsPortalType& componentsPortal,
64  vtkm::IdComponent numComponents)
65  : ComponentsPortal(componentsPortal)
66  , NumberOfComponents(numComponents)
67  {
68  }
69 
73  template <typename OtherComponentsPortalType>
74  VTKM_EXEC_CONT ArrayPortalRuntimeVec(const ArrayPortalRuntimeVec<OtherComponentsPortalType>& src)
75  : ComponentsPortal(src.GetComponentsPortal())
76  , NumberOfComponents(src.GetNumberOfComponents())
77  {
78  }
79 
80  VTKM_EXEC_CONT vtkm::Id GetNumberOfValues() const
81  {
82  return this->ComponentsPortal.GetNumberOfValues() / this->NumberOfComponents;
83  }
84 
85  VTKM_EXEC_CONT ValueType Get(vtkm::Id index) const
86  {
87  return ValueType(
88  this->ComponentsPortal, this->NumberOfComponents, index * this->NumberOfComponents);
89  }
90 
91  VTKM_EXEC_CONT void Set(vtkm::Id index, const ValueType& value) const
92  {
93  if ((&value.GetPortal() == &this->ComponentsPortal) &&
94  (value.GetOffset() == (index * this->NumberOfComponents)))
95  {
96  // The ValueType (VecFromPortal) operates on demand. Thus, if you set
97  // something in the value, it has already been passed to the array.
98  }
99  else
100  {
101  // The value comes from somewhere else. Copy data in.
102  this->Get(index) = value;
103  }
104  }
105 
106  VTKM_EXEC_CONT const ComponentsPortalType& GetComponentsPortal() const
107  {
108  return this->ComponentsPortal;
109  }
110 
111  VTKM_EXEC_CONT vtkm::IdComponent GetNumberOfComponents() const
112  {
113  return this->NumberOfComponents;
114  }
115 
116 private:
117  ComponentsPortalType ComponentsPortal;
118  vtkm::IdComponent NumberOfComponents = 0;
119 };
120 
121 }
122 } // namespace vtkm::internal
123 
124 namespace vtkm
125 {
126 namespace cont
127 {
128 
130 {
131 };
132 
133 namespace internal
134 {
135 
136 struct RuntimeVecMetaData
137 {
138  vtkm::IdComponent NumberOfComponents;
139 };
140 
141 template <typename ComponentsPortal>
142 class Storage<vtkm::VecFromPortal<ComponentsPortal>, vtkm::cont::StorageTagRuntimeVec>
143 {
144  using ComponentType = typename ComponentsPortal::ValueType;
145  using ComponentsStorage =
146  vtkm::cont::internal::Storage<ComponentType, vtkm::cont::StorageTagBasic>;
147 
150  "ArrayHandleRuntimeVec only supports scalars grouped into a single Vec. Nested Vecs can "
151  "still be used with ArrayHandleRuntimeVec. The values are treated as flattened (like "
152  "with VecFlat).");
153 
155 
157  (std::is_same<ComponentsPortal, typename ComponentsStorage::WritePortalType>::value),
158  "Used invalid ComponentsPortal type with expected ComponentsStorageTag.");
159 
160  using Info = RuntimeVecMetaData;
161 
162  VTKM_CONT static std::vector<vtkm::cont::internal::Buffer> ComponentsBuffers(
163  const std::vector<vtkm::cont::internal::Buffer>& buffers)
164  {
165  return std::vector<vtkm::cont::internal::Buffer>(buffers.begin() + 1, buffers.end());
166  }
167 
168 public:
169  using ReadPortalType =
170  vtkm::internal::ArrayPortalRuntimeVec<typename ComponentsStorage::ReadPortalType>;
171  using WritePortalType =
172  vtkm::internal::ArrayPortalRuntimeVec<typename ComponentsStorage::WritePortalType>;
173 
174  VTKM_CONT static vtkm::IdComponent GetNumberOfComponents(
175  const std::vector<vtkm::cont::internal::Buffer>& buffers)
176  {
177  return buffers[0].GetMetaData<Info>().NumberOfComponents;
178  }
179 
180  VTKM_CONT static vtkm::IdComponent GetNumberOfComponentsFlat(
181  const std::vector<vtkm::cont::internal::Buffer>& buffers)
182  {
183  vtkm::IdComponent numComponents = GetNumberOfComponents(buffers);
184  vtkm::IdComponent numSubComponents =
185  ComponentsStorage::GetNumberOfComponentsFlat(ComponentsBuffers(buffers));
186  return numComponents * numSubComponents;
187  }
188 
189  VTKM_CONT static vtkm::Id GetNumberOfValues(
190  const std::vector<vtkm::cont::internal::Buffer>& buffers)
191  {
192  return ComponentsStorage::GetNumberOfValues(ComponentsBuffers(buffers)) /
193  GetNumberOfComponents(buffers);
194  }
195 
196  VTKM_CONT static void ResizeBuffers(vtkm::Id numValues,
197  const std::vector<vtkm::cont::internal::Buffer>& buffers,
198  vtkm::CopyFlag preserve,
199  vtkm::cont::Token& token)
200  {
201  ComponentsStorage::ResizeBuffers(
202  numValues * GetNumberOfComponents(buffers), ComponentsBuffers(buffers), preserve, token);
203  }
204 
205  VTKM_CONT static void Fill(const std::vector<vtkm::cont::internal::Buffer>&,
207  vtkm::Id,
208  vtkm::Id,
210  {
211  throw vtkm::cont::ErrorBadType("Fill not supported for ArrayHandleRuntimeVec.");
212  }
213 
214  VTKM_CONT static ReadPortalType CreateReadPortal(
215  const std::vector<vtkm::cont::internal::Buffer>& buffers,
217  vtkm::cont::Token& token)
218  {
219  return ReadPortalType(
220  ComponentsStorage::CreateReadPortal(ComponentsBuffers(buffers), device, token),
221  GetNumberOfComponents(buffers));
222  }
223 
224  VTKM_CONT static WritePortalType CreateWritePortal(
225  const std::vector<vtkm::cont::internal::Buffer>& buffers,
227  vtkm::cont::Token& token)
228  {
229  return WritePortalType(
230  ComponentsStorage::CreateWritePortal(ComponentsBuffers(buffers), device, token),
231  GetNumberOfComponents(buffers));
232  }
233 
234  VTKM_CONT static std::vector<vtkm::cont::internal::Buffer> CreateBuffers(
235  vtkm::IdComponent numComponents = 1,
236  const ComponentsArray& componentsArray = ComponentsArray{})
237  {
239  (componentsArray.GetNumberOfValues() % numComponents) != 0,
240  "Array given to ArrayHandleRuntimeVec has size ("
241  << componentsArray.GetNumberOfValues()
242  << ") that is not divisible by the number of components selected ("
243  << numComponents << ").");
244  Info info;
245  info.NumberOfComponents = numComponents;
246  return vtkm::cont::internal::CreateBuffers(info, componentsArray);
247  }
248 
249  VTKM_CONT static ComponentsArray GetComponentsArray(
250  const std::vector<vtkm::cont::internal::Buffer>& buffers)
251  {
252  return ComponentsArray(ComponentsBuffers(buffers));
253  }
254 
255  VTKM_CONT static void AsArrayHandleBasic(
256  const std::vector<vtkm::cont::internal::Buffer>& buffers,
258  {
259  if (GetNumberOfComponents(buffers) != 1)
260  {
262  "Attempted to pull a scalar array from an ArrayHandleRuntime that does not hold scalars.");
263  }
264  dest = GetComponentsArray(buffers);
265  }
266 
267  template <vtkm::IdComponent N>
268  VTKM_CONT static void AsArrayHandleBasic(
269  const std::vector<vtkm::cont::internal::Buffer>& buffers,
271  {
272  if (GetNumberOfComponents(buffers) != N)
273  {
275  "Attempted to pull an array of Vecs of the wrong size from an ArrayHandleRuntime.");
276  }
278  ComponentsBuffers(buffers));
279  }
280 
281  template <typename T, vtkm::IdComponent NInner, vtkm::IdComponent NOuter>
282  VTKM_CONT static void AsArrayHandleBasic(
283  const std::vector<vtkm::cont::internal::Buffer>& buffers,
285  dest)
286  {
287  // Flatten the Vec by one level and attempt to get the array handle for that.
289  AsArrayHandleBasic(buffers, squashedArray);
290  // Now unsquash the array by stealling the buffers and creating an array of the right type
291  dest =
293  squashedArray.GetBuffers());
294  }
295 };
296 
297 } // namespace internal
298 
326 template <typename ComponentType>
328  : public vtkm::cont::ArrayHandle<
329  vtkm::VecFromPortal<typename ArrayHandleBasic<ComponentType>::WritePortalType>,
330  vtkm::cont::StorageTagRuntimeVec>
331 {
332 public:
339 
340 private:
342 
343 public:
352  VTKM_CONT
354  const ComponentsArrayType& componentsArray = ComponentsArrayType{})
355  : Superclass(StorageType::CreateBuffers(numComponents, componentsArray))
356  {
357  }
358 
361  {
362  return StorageType::GetNumberOfComponents(this->GetBuffers());
363  }
364 
370  {
371  return StorageType::GetComponentsArray(this->GetBuffers());
372  }
373 
380  template <typename ValueType>
382  {
383  StorageType::AsArrayHandleBasic(this->GetBuffers(), array);
384  }
385 
387  template <typename ArrayType>
388  ArrayType AsArrayHandleBasic() const
389  {
390  ArrayType array;
391  this->AsArrayHandleBasic(array);
392  return array;
393  }
394 };
395 
404 template <typename T>
406  vtkm::IdComponent numComponents,
409 {
410  using UnrolledVec = vtkm::internal::UnrollVec<T>;
411  using ComponentType = typename UnrolledVec::ComponentType;
412 
413  // Use some dangerous magic to convert the basic array to its base component and create
414  // an ArrayHandleRuntimeVec from that.
416  componentsArray.GetBuffers());
417 
419  numComponents * UnrolledVec::NUM_COMPONENTS, flatComponents);
420 }
421 
424 template <typename T>
427 {
428  return make_ArrayHandleRuntimeVec(1, componentsArray);
429 }
430 
433 template <typename T>
435  const T* array,
436  vtkm::Id numberOfValues,
437  vtkm::CopyFlag copy)
438 {
439  return make_ArrayHandleRuntimeVec(numComponents,
440  vtkm::cont::make_ArrayHandle(array, numberOfValues, copy));
441 }
442 
448 template <typename T>
450  vtkm::IdComponent numComponents,
451  T*& array,
452  vtkm::Id numberOfValues,
453  vtkm::cont::internal::BufferInfo::Deleter deleter = internal::SimpleArrayDeleter<T>,
454  vtkm::cont::internal::BufferInfo::Reallocater reallocater = internal::SimpleArrayReallocater<T>)
455 {
457  numComponents, vtkm::cont::make_ArrayHandleMove(array, numberOfValues, deleter, reallocater));
458 }
459 
462 template <typename T, typename Allocator>
464  const std::vector<T, Allocator>& array,
465  vtkm::CopyFlag copy)
466 {
467  return make_ArrayHandleRuntimeVec(numComponents, vtkm::cont::make_ArrayHandle(array, copy));
468 }
469 
472 template <typename T, typename Allocator>
474  std::vector<T, Allocator>&& array)
475 {
476  return make_ArrayHandleRuntimeVec(numComponents, make_ArrayHandleMove(std::move(array)));
477 }
478 
479 template <typename T, typename Allocator>
481  std::vector<T, Allocator>&& array,
483 {
484  return make_ArrayHandleRuntimeVecMove(numComponents, std::move(array));
485 }
486 
487 namespace internal
488 {
489 
490 template <>
491 struct ArrayExtractComponentImpl<vtkm::cont::StorageTagRuntimeVec>
492 {
493  template <typename T>
495  vtkm::IdComponent componentIndex,
496  vtkm::CopyFlag allowCopy) const
497  {
498  using ComponentType = typename T::ComponentType;
502  ArrayExtractComponentImpl<vtkm::cont::StorageTagBasic>{}(
503  array.GetComponentsArray(), componentIndex % NUM_SUB_COMPONENTS, allowCopy);
504 
505  // Adjust stride and offset to expectations of grouped values
506  const vtkm::IdComponent numComponents = array.GetNumberOfComponents();
508  dest.GetBasicArray(),
509  dest.GetNumberOfValues() / numComponents,
510  dest.GetStride() * numComponents,
511  dest.GetOffset() + (dest.GetStride() * (componentIndex / NUM_SUB_COMPONENTS)),
512  dest.GetModulo(),
513  dest.GetDivisor());
514  }
515 };
516 
517 } // namespace internal
518 
519 }
520 } // namespace vtkm::cont
521 
522 //=============================================================================
523 // Specializations of serialization related classes
525 namespace vtkm
526 {
527 namespace cont
528 {
529 
530 template <typename T>
531 struct SerializableTypeString<vtkm::cont::ArrayHandleRuntimeVec<T>>
532 {
533  static VTKM_CONT const std::string& Get()
534  {
535  static std::string name = "AH_RuntimeVec<" + SerializableTypeString<T>::Get() + ">";
536  return name;
537  }
538 };
539 
540 template <typename VecType>
541 struct SerializableTypeString<vtkm::cont::ArrayHandle<VecType, vtkm::cont::StorageTagRuntimeVec>>
542  : SerializableTypeString<vtkm::cont::ArrayHandleRuntimeVec<typename VecType::ComponentType>>
543 {
544 };
545 
546 }
547 } // vtkm::cont
548 
549 namespace mangled_diy_namespace
550 {
551 
552 template <typename T>
553 struct Serialization<vtkm::cont::ArrayHandleRuntimeVec<T>>
554 {
555 private:
558 
559 public:
560  static VTKM_CONT void save(BinaryBuffer& bb, const BaseType& obj)
561  {
562  vtkmdiy::save(bb, Type(obj).GetNumberOfComponents());
563  vtkmdiy::save(bb, Type(obj).GetComponentsArray());
564  }
565 
566  static VTKM_CONT void load(BinaryBuffer& bb, BaseType& obj)
567  {
568  vtkm::IdComponent numComponents;
569  vtkm::cont::ArrayHandleBasic<T> componentArray;
570 
571  vtkmdiy::load(bb, numComponents);
572  vtkmdiy::load(bb, componentArray);
573 
574  obj = vtkm::cont::make_ArrayHandleRuntimeVec(numComponents, componentArray);
575  }
576 };
577 
578 template <typename VecType>
579 struct Serialization<vtkm::cont::ArrayHandle<VecType, vtkm::cont::StorageTagRuntimeVec>>
580  : Serialization<vtkm::cont::ArrayHandleRuntimeVec<typename VecType::ComponentType>>
581 {
582 };
583 
584 } // diy
586 
587 #endif //vtk_m_cont_ArrayHandleRuntimeVec_h
vtkm::cont::ArrayHandle
Manages an array-worth of data.
Definition: ArrayHandle.h:300
ArrayHandle.h
ArrayExtractComponent.h
vtkm::cont::ArrayHandle< T, vtkm::cont::StorageTagBasic >::GetBuffers
const std::vector< vtkm::cont::internal::Buffer > & GetBuffers() const
Returns the internal Buffer structures that hold the data.
Definition: ArrayHandle.h:721
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::Get
auto Get(const vtkm::Tuple< Ts... > &tuple)
Retrieve the object from a vtkm::Tuple at the given index.
Definition: Tuple.h:81
vtkm::cont::ArrayHandleRuntimeVec::AsArrayHandleBasic
ArrayType AsArrayHandleBasic() const
Converts the array to that of a basic array handle.
Definition: ArrayHandleRuntimeVec.h:388
VTKM_ARRAY_HANDLE_SUBCLASS
#define VTKM_ARRAY_HANDLE_SUBCLASS(classname, fullclasstype, superclass)
Macro to make default methods in ArrayHandle subclasses.
Definition: ArrayHandle.h:243
vtkm::cont::LogLevel::Warn
@ Warn
Less important user errors, such as out-of-bounds parameters.
VTKM_EXEC_CONT
#define VTKM_EXEC_CONT
Definition: ExportMacros.h:52
vtkm::IdComponent
vtkm::Int32 IdComponent
Base type to use to index small lists.
Definition: Types.h:194
vtkm::cont::make_ArrayHandleRuntimeVecMove
auto make_ArrayHandleRuntimeVecMove(vtkm::IdComponent numComponents, T *&array, vtkm::Id numberOfValues, vtkm::cont::internal::BufferInfo::Deleter deleter=internal::SimpleArrayDeleter< T >, vtkm::cont::internal::BufferInfo::Reallocater reallocater=internal::SimpleArrayReallocater< T >)
A convenience function to move a user-allocated array into an ArrayHandleRuntimeVec.
Definition: ArrayHandleRuntimeVec.h:449
vtkm::Vec< T, 1 >
Definition: Types.h:875
vtkm::cont::ArrayHandleStride::GetStride
vtkm::Id GetStride() const
Get the stride that values are accessed.
Definition: ArrayHandleStride.h:377
ArrayHandleBasic.h
vtkm::cont::ArrayHandleStride::GetOffset
vtkm::Id GetOffset() const
Get the offset to start reading values.
Definition: ArrayHandleStride.h:388
vtkm::cont::ArrayHandle< T, vtkm::cont::StorageTagStride >::GetNumberOfValues
vtkm::Id GetNumberOfValues() const
Returns the number of entries in the array.
Definition: ArrayHandle.h:468
vtkm::cont::make_ArrayHandleMove
vtkm::cont::ArrayHandleBasic< T > make_ArrayHandleMove(T *&array, vtkm::Id numberOfValues, vtkm::cont::internal::BufferInfo::Deleter deleter=internal::SimpleArrayDeleter< T >, vtkm::cont::internal::BufferInfo::Reallocater reallocater=internal::SimpleArrayReallocater< T >)
A convenience function to move a user-allocated array into an ArrayHandle.
Definition: ArrayHandleBasic.h:294
Assert.h
vtkm::cont::ErrorBadType
This class is thrown when VTK-m encounters data of a type that is incompatible with the current opera...
Definition: ErrorBadType.h:25
mangled_diy_namespace
Definition: Particle.h:351
vtkm::cont::ArrayHandleRuntimeVec::AsArrayHandleBasic
void AsArrayHandleBasic(vtkm::cont::ArrayHandle< ValueType > &array) const
Converts the array to that of a basic array handle.
Definition: ArrayHandleRuntimeVec.h:381
vtkm::cont::ArrayHandleStride
An ArrayHandle that accesses a basic array with strides and offsets.
Definition: ArrayHandleStride.h:332
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
Get the divisor of the array index.
Definition: ArrayHandleStride.h:404
ArrayPortal.h
VecFromPortal.h
vtkm::cont::ArrayHandleStride::GetBasicArray
vtkm::cont::ArrayHandleBasic< T > GetBasicArray() const
Return the underlying data as a basic array handle.
Definition: ArrayHandleStride.h:410
VTKM_STATIC_ASSERT_MSG
#define VTKM_STATIC_ASSERT_MSG(condition, message)
Definition: StaticAssert.h:18
vtkm::cont::ArrayHandleRuntimeVec::Superclass
typename vtkm::cont::detail::GetTypeInParentheses< void(vtkm::cont::ArrayHandle< vtkm::VecFromPortal< typename ArrayHandleBasic< ComponentType >::WritePortalType >, vtkm::cont::StorageTagRuntimeVec >) >::type Superclass
Definition: ArrayHandleRuntimeVec.h:338
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::VecFlat
Treat a Vec or Vec-like object as a flat Vec.
Definition: VecFlat.h:224
vtkm::cont::ArrayHandleBasic::WritePortalType
typename Superclass::WritePortalType WritePortalType
Definition: ArrayHandleBasic.h:116
vtkmNotUsed
#define vtkmNotUsed(parameter_name)
Simple macro to identify a parameter as unused.
Definition: ExportMacros.h:128
vtkm::cont::ArrayHandleRuntimeVec
Fancy array handle for a basic array with runtime selected vec size.
Definition: ArrayHandleRuntimeVec.h:327
vtkm::cont::ArrayHandleStride::GetModulo
vtkm::Id GetModulo() const
Get the modulus of the array index.
Definition: ArrayHandleStride.h:397
vtkm::cont::DeviceAdapterId
An object used to specify a device.
Definition: DeviceAdapterTag.h:58
vtkm::Vec
A short fixed-length array.
Definition: Types.h:357
vtkm::cont::ArrayHandleRuntimeVec::GetComponentsArray
vtkm::cont::ArrayHandleBasic< ComponentType > GetComponentsArray() const
Return a basic array containing the components stored in this array.
Definition: ArrayHandleRuntimeVec.h:369
StaticAssert.h
vtkm::cont::StorageTagRuntimeVec
Definition: ArrayHandleRuntimeVec.h:129
vtkm::cont::StorageTagBasic
A tag for the basic implementation of a Storage object.
Definition: ArrayHandle.h:45
vtkm::CopyFlag
CopyFlag
Identifier used to specify whether a function should deep copy data.
Definition: Flags.h:17
vtkm::cont::make_ArrayHandleRuntimeVec
auto make_ArrayHandleRuntimeVec(vtkm::IdComponent numComponents, const vtkm::cont::ArrayHandle< T, vtkm::cont::StorageTagBasic > &componentsArray=vtkm::cont::ArrayHandle< T, vtkm::cont::StorageTagBasic >{})
make_ArrayHandleRuntimeVec is convenience function to generate an ArrayHandleRuntimeVec.
Definition: ArrayHandleRuntimeVec.h:405
vtkm::cont::ArrayHandleBasic
Basic array storage for an array handle.
Definition: ArrayHandleBasic.h:111
vtkm::VecTraits
Traits that can be queried to treat any type as a Vec.
Definition: VecTraits.h:61
VTKM_ALWAYS_EXPORT
#define VTKM_ALWAYS_EXPORT
Definition: ExportMacros.h:89
ErrorBadType.h
vtkm::cont::make_ArrayHandle
vtkm::cont::ArrayHandleBasic< T > make_ArrayHandle(const T *array, vtkm::Id numberOfValues, vtkm::CopyFlag copy)
A convenience function for creating an ArrayHandle from a standard C array.
Definition: ArrayHandleBasic.h:270
vtkm::VecFromPortal
A short variable-length array from a window in an ArrayPortal.
Definition: VecFromPortal.h:29
vtkm::cont::ArrayHandleRuntimeVec::GetNumberOfComponents
vtkm::IdComponent GetNumberOfComponents() const
Return the number of components in each vec value.
Definition: ArrayHandleRuntimeVec.h:360
VTKM_LOG_IF_S
#define VTKM_LOG_IF_S(level, cond,...)
Definition: Logging.h:202
VecTraits.h
vtkm::cont::ArrayHandleRuntimeVec::ArrayHandleRuntimeVec
ArrayHandleRuntimeVec(vtkm::IdComponent numComponents, const ComponentsArrayType &componentsArray=ComponentsArrayType{})
Construct an ArrayHandleRuntimeVec with a given number of components.
Definition: ArrayHandleRuntimeVec.h:353