Viskores  1.0
ArrayHandleRuntimeVec.h
Go to the documentation of this file.
1 //============================================================================
2 // The contents of this file are covered by the Viskores license. See
3 // LICENSE.txt for details.
4 //
5 // By contributing to this file, all contributors agree to the Developer
6 // Certificate of Origin Version 1.1 (DCO 1.1) as stated in DCO.txt.
7 //============================================================================
8 
9 //============================================================================
10 // Copyright (c) Kitware, Inc.
11 // All rights reserved.
12 // See LICENSE.txt for details.
13 //
14 // This software is distributed WITHOUT ANY WARRANTY; without even
15 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
16 // PURPOSE. See the above copyright notice for more information.
17 //============================================================================
18 #ifndef viskores_cont_ArrayHandleRuntimeVec_h
19 #define viskores_cont_ArrayHandleRuntimeVec_h
20 
26 
27 #include <viskores/Assert.h>
28 #include <viskores/StaticAssert.h>
29 #include <viskores/VecFromPortal.h>
30 #include <viskores/VecTraits.h>
31 
32 namespace viskores
33 {
34 namespace internal
35 {
36 
37 namespace detail
38 {
39 
40 template <typename T>
41 struct UnrollVecImpl
42 {
43  using type = viskores::Vec<T, 1>;
44 };
45 
46 template <typename T, viskores::IdComponent N>
47 struct UnrollVecImpl<viskores::Vec<T, N>>
48 {
49  using subtype = typename UnrollVecImpl<T>::type;
51 };
52 
53 } // namespace detail
54 
55 // A helper class that unrolls a nested `Vec` to a single layer `Vec`. This is similar
56 // to `viskores::VecFlat`, except that this only flattens `viskores::Vec<T,N>` objects, and not
57 // any other `Vec`-like objects. The reason is that a `viskores::Vec<T,N>` is the same as N
58 // consecutive `T` objects whereas the same may not be said about other `Vec`-like objects.
59 template <typename T>
60 using UnrollVec = typename detail::UnrollVecImpl<T>::type;
61 
62 template <typename ComponentsPortalType>
63 class VISKORES_ALWAYS_EXPORT ArrayPortalRuntimeVec
64 {
65 public:
66  using ComponentType = typename std::remove_const<typename ComponentsPortalType::ValueType>::type;
68 
69  ArrayPortalRuntimeVec() = default;
70 
71  VISKORES_EXEC_CONT ArrayPortalRuntimeVec(const ComponentsPortalType& componentsPortal,
72  viskores::IdComponent numComponents)
73  : ComponentsPortal(componentsPortal)
74  , NumberOfComponents(numComponents)
75  {
76  }
77 
81  template <typename OtherComponentsPortalType>
82  VISKORES_EXEC_CONT ArrayPortalRuntimeVec(
83  const ArrayPortalRuntimeVec<OtherComponentsPortalType>& src)
84  : ComponentsPortal(src.GetComponentsPortal())
85  , NumberOfComponents(src.GetNumberOfComponents())
86  {
87  }
88 
89  VISKORES_EXEC_CONT viskores::Id GetNumberOfValues() const
90  {
91  return this->ComponentsPortal.GetNumberOfValues() / this->NumberOfComponents;
92  }
93 
94  VISKORES_EXEC_CONT ValueType Get(viskores::Id index) const
95  {
96  return ValueType(
97  this->ComponentsPortal, this->NumberOfComponents, index * this->NumberOfComponents);
98  }
99 
100  VISKORES_EXEC_CONT void Set(viskores::Id index, const ValueType& value) const
101  {
102  if ((&value.GetPortal() == &this->ComponentsPortal) &&
103  (value.GetOffset() == (index * this->NumberOfComponents)))
104  {
105  // The ValueType (VecFromPortal) operates on demand. Thus, if you set
106  // something in the value, it has already been passed to the array.
107  }
108  else
109  {
110  // The value comes from somewhere else. Copy data in.
111  this->Get(index) = value;
112  }
113  }
114 
115  VISKORES_EXEC_CONT const ComponentsPortalType& GetComponentsPortal() const
116  {
117  return this->ComponentsPortal;
118  }
119 
120  VISKORES_EXEC_CONT viskores::IdComponent GetNumberOfComponents() const
121  {
122  return this->NumberOfComponents;
123  }
124 
125 private:
126  ComponentsPortalType ComponentsPortal;
127  viskores::IdComponent NumberOfComponents = 0;
128 };
129 
130 }
131 } // namespace viskores::internal
132 
133 namespace viskores
134 {
135 namespace cont
136 {
137 
138 struct VISKORES_ALWAYS_EXPORT StorageTagRuntimeVec
139 {
140 };
141 
142 namespace internal
143 {
144 
145 struct RuntimeVecMetaData
146 {
147  viskores::IdComponent NumberOfComponents;
148 };
149 
150 template <typename ComponentsPortal>
151 class Storage<viskores::VecFromPortal<ComponentsPortal>, viskores::cont::StorageTagRuntimeVec>
152 {
153  using ComponentType = typename ComponentsPortal::ValueType;
154  using ComponentsStorage =
155  viskores::cont::internal::Storage<ComponentType, viskores::cont::StorageTagBasic>;
156 
159  "ArrayHandleRuntimeVec only supports scalars grouped into a single Vec. Nested Vecs can "
160  "still be used with ArrayHandleRuntimeVec. The values are treated as flattened (like "
161  "with VecFlat).");
162 
164 
166  (std::is_same<ComponentsPortal, typename ComponentsStorage::WritePortalType>::value),
167  "Used invalid ComponentsPortal type with expected ComponentsStorageTag.");
168 
169  using Info = RuntimeVecMetaData;
170 
171  VISKORES_CONT static std::vector<viskores::cont::internal::Buffer> ComponentsBuffers(
172  const std::vector<viskores::cont::internal::Buffer>& buffers)
173  {
174  return std::vector<viskores::cont::internal::Buffer>(buffers.begin() + 1, buffers.end());
175  }
176 
177 public:
178  using ReadPortalType =
179  viskores::internal::ArrayPortalRuntimeVec<typename ComponentsStorage::ReadPortalType>;
180  using WritePortalType =
181  viskores::internal::ArrayPortalRuntimeVec<typename ComponentsStorage::WritePortalType>;
182 
183  VISKORES_CONT static viskores::IdComponent GetNumberOfComponents(
184  const std::vector<viskores::cont::internal::Buffer>& buffers)
185  {
186  return buffers[0].GetMetaData<Info>().NumberOfComponents;
187  }
188 
189  VISKORES_CONT static viskores::IdComponent GetNumberOfComponentsFlat(
190  const std::vector<viskores::cont::internal::Buffer>& buffers)
191  {
192  viskores::IdComponent numComponents = GetNumberOfComponents(buffers);
193  viskores::IdComponent numSubComponents =
194  ComponentsStorage::GetNumberOfComponentsFlat(ComponentsBuffers(buffers));
195  return numComponents * numSubComponents;
196  }
197 
198  VISKORES_CONT static viskores::Id GetNumberOfValues(
199  const std::vector<viskores::cont::internal::Buffer>& buffers)
200  {
201  return ComponentsStorage::GetNumberOfValues(ComponentsBuffers(buffers)) /
202  GetNumberOfComponents(buffers);
203  }
204 
205  VISKORES_CONT static void ResizeBuffers(
206  viskores::Id numValues,
207  const std::vector<viskores::cont::internal::Buffer>& buffers,
208  viskores::CopyFlag preserve,
209  viskores::cont::Token& token)
210  {
211  ComponentsStorage::ResizeBuffers(
212  numValues * GetNumberOfComponents(buffers), ComponentsBuffers(buffers), preserve, token);
213  }
214 
215  VISKORES_CONT static void Fill(const std::vector<viskores::cont::internal::Buffer>&,
217  viskores::Id,
218  viskores::Id,
220  {
221  throw viskores::cont::ErrorBadType("Fill not supported for ArrayHandleRuntimeVec.");
222  }
223 
224  VISKORES_CONT static ReadPortalType CreateReadPortal(
225  const std::vector<viskores::cont::internal::Buffer>& buffers,
227  viskores::cont::Token& token)
228  {
229  return ReadPortalType(
230  ComponentsStorage::CreateReadPortal(ComponentsBuffers(buffers), device, token),
231  GetNumberOfComponents(buffers));
232  }
233 
234  VISKORES_CONT static WritePortalType CreateWritePortal(
235  const std::vector<viskores::cont::internal::Buffer>& buffers,
237  viskores::cont::Token& token)
238  {
239  return WritePortalType(
240  ComponentsStorage::CreateWritePortal(ComponentsBuffers(buffers), device, token),
241  GetNumberOfComponents(buffers));
242  }
243 
244  VISKORES_CONT static std::vector<viskores::cont::internal::Buffer> CreateBuffers(
245  viskores::IdComponent numComponents = 1,
246  const ComponentsArray& componentsArray = ComponentsArray{})
247  {
249  (componentsArray.GetNumberOfValues() % numComponents) != 0,
250  "Array given to ArrayHandleRuntimeVec has size ("
251  << componentsArray.GetNumberOfValues()
252  << ") that is not divisible by the number of components selected ("
253  << numComponents << ").");
254  Info info;
255  info.NumberOfComponents = numComponents;
256  return viskores::cont::internal::CreateBuffers(info, componentsArray);
257  }
258 
259  VISKORES_CONT static ComponentsArray GetComponentsArray(
260  const std::vector<viskores::cont::internal::Buffer>& buffers)
261  {
262  return ComponentsArray(ComponentsBuffers(buffers));
263  }
264 
265  VISKORES_CONT static void AsArrayHandleBasic(
266  const std::vector<viskores::cont::internal::Buffer>& buffers,
268  {
269  if (GetNumberOfComponents(buffers) != 1)
270  {
272  "Attempted to pull a scalar array from an ArrayHandleRuntime that does not hold scalars.");
273  }
274  dest = GetComponentsArray(buffers);
275  }
276 
277  template <viskores::IdComponent N>
278  VISKORES_CONT static void AsArrayHandleBasic(
279  const std::vector<viskores::cont::internal::Buffer>& buffers,
281  dest)
282  {
283  if (GetNumberOfComponents(buffers) != N)
284  {
286  "Attempted to pull an array of Vecs of the wrong size from an ArrayHandleRuntime.");
287  }
288  dest =
290  ComponentsBuffers(buffers));
291  }
292 
293  template <typename T, viskores::IdComponent NInner, viskores::IdComponent NOuter>
294  VISKORES_CONT static void AsArrayHandleBasic(
295  const std::vector<viskores::cont::internal::Buffer>& buffers,
298  {
299  // Flatten the Vec by one level and attempt to get the array handle for that.
301  AsArrayHandleBasic(buffers, squashedArray);
302  // Now unsquash the array by stealling the buffers and creating an array of the right type
305  }
306 };
307 
308 } // namespace internal
309 
337 template <typename ComponentType>
340  viskores::VecFromPortal<typename ArrayHandleBasic<ComponentType>::WritePortalType>,
341  viskores::cont::StorageTagRuntimeVec>
342 {
343 public:
350 
351 private:
353 
354 public:
365  const ComponentsArrayType& componentsArray = ComponentsArrayType{})
366  : Superclass(StorageType::CreateBuffers(numComponents, componentsArray))
367  {
368  }
369 
372  {
373  return StorageType::GetNumberOfComponents(this->GetBuffers());
374  }
375 
381  {
382  return StorageType::GetComponentsArray(this->GetBuffers());
383  }
384 
391  template <typename ValueType>
393  {
394  StorageType::AsArrayHandleBasic(this->GetBuffers(), array);
395  }
396 
398  template <typename ArrayType>
399  ArrayType AsArrayHandleBasic() const
400  {
401  ArrayType array;
402  this->AsArrayHandleBasic(array);
403  return array;
404  }
405 };
406 
415 template <typename T>
417  viskores::IdComponent numComponents,
420 {
421  using UnrolledVec = viskores::internal::UnrollVec<T>;
422  using ComponentType = typename UnrolledVec::ComponentType;
423 
424  // Use some dangerous magic to convert the basic array to its base component and create
425  // an ArrayHandleRuntimeVec from that.
427  componentsArray.GetBuffers());
428 
430  numComponents * UnrolledVec::NUM_COMPONENTS, flatComponents);
431 }
432 
435 template <typename T>
438 {
439  return make_ArrayHandleRuntimeVec(1, componentsArray);
440 }
441 
444 template <typename T>
446  const T* array,
447  viskores::Id numberOfValues,
448  viskores::CopyFlag copy)
449 {
450  return make_ArrayHandleRuntimeVec(numComponents,
451  viskores::cont::make_ArrayHandle(array, numberOfValues, copy));
452 }
453 
459 template <typename T>
461  viskores::IdComponent numComponents,
462  T*& array,
463  viskores::Id numberOfValues,
464  viskores::cont::internal::BufferInfo::Deleter deleter = internal::SimpleArrayDeleter<T>,
465  viskores::cont::internal::BufferInfo::Reallocater reallocater =
466  internal::SimpleArrayReallocater<T>)
467 {
469  numComponents,
470  viskores::cont::make_ArrayHandleMove(array, numberOfValues, deleter, reallocater));
471 }
472 
475 template <typename T, typename Allocator>
477  const std::vector<T, Allocator>& array,
478  viskores::CopyFlag copy)
479 {
480  return make_ArrayHandleRuntimeVec(numComponents, viskores::cont::make_ArrayHandle(array, copy));
481 }
482 
485 template <typename T, typename Allocator>
487  std::vector<T, Allocator>&& array)
488 {
489  return make_ArrayHandleRuntimeVec(numComponents, make_ArrayHandleMove(std::move(array)));
490 }
491 
492 template <typename T, typename Allocator>
494  std::vector<T, Allocator>&& array,
496 {
497  return make_ArrayHandleRuntimeVecMove(numComponents, std::move(array));
498 }
499 
500 namespace internal
501 {
502 
503 template <>
504 struct ArrayExtractComponentImpl<viskores::cont::StorageTagRuntimeVec>
505 {
506  template <typename T>
508  viskores::IdComponent componentIndex,
509  viskores::CopyFlag allowCopy) const
510  {
511  using ComponentType = typename T::ComponentType;
513  constexpr viskores::IdComponent NUM_SUB_COMPONENTS =
516  ArrayExtractComponentImpl<viskores::cont::StorageTagBasic>{}(
517  array.GetComponentsArray(), componentIndex % NUM_SUB_COMPONENTS, allowCopy);
518 
519  // Adjust stride and offset to expectations of grouped values
520  const viskores::IdComponent numComponents = array.GetNumberOfComponents();
522  dest.GetBasicArray(),
523  dest.GetNumberOfValues() / numComponents,
524  dest.GetStride() * numComponents,
525  dest.GetOffset() + (dest.GetStride() * (componentIndex / NUM_SUB_COMPONENTS)),
526  dest.GetModulo(),
527  dest.GetDivisor());
528  }
529 };
530 
531 } // namespace internal
532 
533 }
534 } // namespace viskores::cont
535 
536 //=============================================================================
537 // Specializations of serialization related classes
539 namespace viskores
540 {
541 namespace cont
542 {
543 
544 template <typename T>
545 struct SerializableTypeString<viskores::cont::ArrayHandleRuntimeVec<T>>
546 {
547  static VISKORES_CONT const std::string& Get()
548  {
549  static std::string name = "AH_RuntimeVec<" + SerializableTypeString<T>::Get() + ">";
550  return name;
551  }
552 };
553 
554 template <typename VecType>
555 struct SerializableTypeString<
556  viskores::cont::ArrayHandle<VecType, viskores::cont::StorageTagRuntimeVec>>
557  : SerializableTypeString<viskores::cont::ArrayHandleRuntimeVec<typename VecType::ComponentType>>
558 {
559 };
560 
561 }
562 } // viskores::cont
563 
564 namespace mangled_diy_namespace
565 {
566 
567 template <typename T>
568 struct Serialization<viskores::cont::ArrayHandleRuntimeVec<T>>
569 {
570 private:
573 
574 public:
575  static VISKORES_CONT void save(BinaryBuffer& bb, const BaseType& obj)
576  {
577  viskoresdiy::save(bb, Type(obj).GetNumberOfComponents());
578  viskoresdiy::save(bb, Type(obj).GetComponentsArray());
579  }
580 
581  static VISKORES_CONT void load(BinaryBuffer& bb, BaseType& obj)
582  {
583  viskores::IdComponent numComponents;
585 
586  viskoresdiy::load(bb, numComponents);
587  viskoresdiy::load(bb, componentArray);
588 
589  obj = viskores::cont::make_ArrayHandleRuntimeVec(numComponents, componentArray);
590  }
591 };
592 
593 template <typename VecType>
594 struct Serialization<viskores::cont::ArrayHandle<VecType, viskores::cont::StorageTagRuntimeVec>>
595  : Serialization<viskores::cont::ArrayHandleRuntimeVec<typename VecType::ComponentType>>
596 {
597 };
598 
599 } // diy
601 
602 #endif //viskores_cont_ArrayHandleRuntimeVec_h
viskores::exec::arg::load
T load(const U &u, viskores::Id v)
Definition: FetchTagArrayDirectIn.h:44
viskores::VecFlat
Treat a Vec or Vec-like object as a flat Vec.
Definition: VecFlat.h:240
ArrayHandle.h
ArrayExtractComponent.h
viskores::cont::ArrayHandleRuntimeVec::GetComponentsArray
viskores::cont::ArrayHandleBasic< ComponentType > GetComponentsArray() const
Return a basic array containing the components stored in this array.
Definition: ArrayHandleRuntimeVec.h:380
viskores::cont::LogLevel::Warn
@ Warn
Less important user errors, such as out-of-bounds parameters.
viskores::cont::ArrayHandleRuntimeVec::AsArrayHandleBasic
ArrayType AsArrayHandleBasic() const
Converts the array to that of a basic array handle.
Definition: ArrayHandleRuntimeVec.h:399
viskores::VecFromPortal
A short variable-length array from a window in an ArrayPortal.
Definition: VecFromPortal.h:37
viskores::cont::ErrorBadType
This class is thrown when Viskores encounters data of a type that is incompatible with the current op...
Definition: ErrorBadType.h:33
viskores::cont::ArrayHandleRuntimeVec
Fancy array handle for a basic array with runtime selected vec size.
Definition: ArrayHandleRuntimeVec.h:338
viskoresNotUsed
#define viskoresNotUsed(parameter_name)
Simple macro to identify a parameter as unused.
Definition: ExportMacros.h:136
ArrayHandleBasic.h
viskores::cont::ArrayHandle
Manages an array-worth of data.
Definition: ArrayHandle.h:313
viskores::cont::ArrayHandleBasic::WritePortalType
typename Superclass::WritePortalType WritePortalType
Definition: ArrayHandleBasic.h:126
viskores::cont::ArrayHandleRuntimeVec::AsArrayHandleBasic
void AsArrayHandleBasic(viskores::cont::ArrayHandle< ValueType > &array) const
Converts the array to that of a basic array handle.
Definition: ArrayHandleRuntimeVec.h:392
Assert.h
viskores::cont::LogLevel::Info
@ Info
Information messages (detected hardware, etc) and temporary debugging output.
viskores::IdComponent
viskores::Int32 IdComponent
Base type to use to index small lists.
Definition: Types.h:202
viskores::cont::StorageTagBasic
A tag for the basic implementation of a Storage object.
Definition: ArrayHandle.h:53
viskores::cont::ArrayHandleRuntimeVec::Superclass
typename viskores::cont::detail::GetTypeInParentheses< void(viskores::cont::ArrayHandle< viskores::VecFromPortal< typename ArrayHandleBasic< ComponentType >::WritePortalType >, viskores::cont::StorageTagRuntimeVec >) >::type Superclass
Definition: ArrayHandleRuntimeVec.h:349
viskores::cont::make_ArrayHandleMove
viskores::cont::ArrayHandleBasic< T > make_ArrayHandleMove(T *&array, viskores::Id numberOfValues, viskores::cont::internal::BufferInfo::Deleter deleter=internal::SimpleArrayDeleter< T >, viskores::cont::internal::BufferInfo::Reallocater reallocater=internal::SimpleArrayReallocater< T >)
A convenience function to move a user-allocated array into an ArrayHandle.
Definition: ArrayHandleBasic.h:310
VISKORES_EXEC_CONT
#define VISKORES_EXEC_CONT
Definition: ExportMacros.h:60
mangled_diy_namespace
Definition: Particle.h:373
viskores::cont::ArrayHandleStride
An ArrayHandle that accesses a basic array with strides and offsets.
Definition: ArrayHandleStride.h:343
viskores::cont::make_ArrayHandleRuntimeVecMove
auto make_ArrayHandleRuntimeVecMove(viskores::IdComponent numComponents, T *&array, viskores::Id numberOfValues, viskores::cont::internal::BufferInfo::Deleter deleter=internal::SimpleArrayDeleter< T >, viskores::cont::internal::BufferInfo::Reallocater reallocater=internal::SimpleArrayReallocater< T >)
A convenience function to move a user-allocated array into an ArrayHandleRuntimeVec.
Definition: ArrayHandleRuntimeVec.h:460
viskores::Id
viskores::Int64 Id
Base type to use to index arrays.
Definition: Types.h:235
VISKORES_CONT
#define VISKORES_CONT
Definition: ExportMacros.h:65
ArrayPortal.h
viskores::cont::StorageTagRuntimeVec
Definition: ArrayHandleRuntimeVec.h:138
viskores
Groups connected points that have the same field value.
Definition: Atomic.h:27
VecFromPortal.h
viskores::cont::ArrayHandleStride::GetDivisor
viskores::Id GetDivisor() const
Get the divisor of the array index.
Definition: ArrayHandleStride.h:418
viskores::VecTraits
Traits that can be queried to treat any type as a Vec.
Definition: VecTraits.h:69
viskores::cont::ArrayHandleRuntimeVec::GetNumberOfComponents
viskores::IdComponent GetNumberOfComponents() const
Return the number of components in each vec value.
Definition: ArrayHandleRuntimeVec.h:371
viskores::cont::ArrayHandleRuntimeVec::ArrayHandleRuntimeVec
ArrayHandleRuntimeVec(viskores::IdComponent numComponents, const ComponentsArrayType &componentsArray=ComponentsArrayType{})
Construct an ArrayHandleRuntimeVec with a given number of components.
Definition: ArrayHandleRuntimeVec.h:364
viskores::cont::ArrayHandleStride::GetOffset
viskores::Id GetOffset() const
Get the offset to start reading values.
Definition: ArrayHandleStride.h:402
viskores::cont::ArrayHandleBasic
Basic array storage for an array handle.
Definition: ArrayHandleBasic.h:120
viskores::cont::ArrayHandle< T, viskores::cont::StorageTagStride >::GetNumberOfValues
viskores::Id GetNumberOfValues() const
Returns the number of entries in the array.
Definition: ArrayHandle.h:482
viskores::Vec< T, 1 >
Definition: Types.h:887
VISKORES_STATIC_ASSERT_MSG
#define VISKORES_STATIC_ASSERT_MSG(condition, message)
Definition: StaticAssert.h:26
viskores::cont::DeviceAdapterId
An object used to specify a device.
Definition: DeviceAdapterTag.h:66
StaticAssert.h
VISKORES_ARRAY_HANDLE_SUBCLASS
#define VISKORES_ARRAY_HANDLE_SUBCLASS(classname, fullclasstype, superclass)
Macro to make default methods in ArrayHandle subclasses.
Definition: ArrayHandle.h:256
VISKORES_LOG_IF_S
#define VISKORES_LOG_IF_S(level, cond,...)
Definition: Logging.h:210
viskores::Get
auto Get(const viskores::Tuple< Ts... > &tuple)
Retrieve the object from a viskores::Tuple at the given index.
Definition: Tuple.h:89
ErrorBadType.h
viskores::cont::make_ArrayHandleRuntimeVec
auto make_ArrayHandleRuntimeVec(viskores::IdComponent numComponents, const viskores::cont::ArrayHandle< T, viskores::cont::StorageTagBasic > &componentsArray=viskores::cont::ArrayHandle< T, viskores::cont::StorageTagBasic >{})
make_ArrayHandleRuntimeVec is convenience function to generate an ArrayHandleRuntimeVec.
Definition: ArrayHandleRuntimeVec.h:416
viskores::CopyFlag
CopyFlag
Identifier used to specify whether a function should deep copy data.
Definition: Flags.h:25
viskores::cont::ArrayHandleStride::GetModulo
viskores::Id GetModulo() const
Get the modulus of the array index.
Definition: ArrayHandleStride.h:411
viskores::cont::make_ArrayHandle
viskores::cont::ArrayHandleBasic< T > make_ArrayHandle(const T *array, viskores::Id numberOfValues, viskores::CopyFlag copy)
A convenience function for creating an ArrayHandle from a standard C array.
Definition: ArrayHandleBasic.h:285
viskores::Vec
A short fixed-length array.
Definition: Types.h:365
viskores::cont::Token
A token to hold the scope of an ArrayHandle or other object.
Definition: Token.h:43
viskores::cont::ArrayHandle< T, viskores::cont::StorageTagBasic >::GetBuffers
const std::vector< viskores::cont::internal::Buffer > & GetBuffers() const
Returns the internal Buffer structures that hold the data.
Definition: ArrayHandle.h:738
VecTraits.h
viskores::cont::ArrayHandleStride::GetStride
viskores::Id GetStride() const
Get the stride that values are accessed.
Definition: ArrayHandleStride.h:391
viskores::cont::ArrayHandleStride::GetBasicArray
viskores::cont::ArrayHandleBasic< T > GetBasicArray() const
Return the underlying data as a basic array handle.
Definition: ArrayHandleStride.h:424