29#ifndef vtkmDataArray_h
30#define vtkmDataArray_h
32#include "vtkAcceleratorsVTKmCoreModule.h"
34#include "vtkmConfigCore.h"
36#include <vtkm/VecTraits.h>
37#include <vtkm/cont/ArrayHandle.h>
38#include <vtkm/cont/UnknownArrayHandle.h>
44VTK_ABI_NAMESPACE_BEGIN
52VTK_ABI_NAMESPACE_BEGIN
56 static_assert(std::is_arithmetic<T>::value,
"T must be an integral or floating-point type");
63 using typename Superclass::ValueType;
69 template <
typename V,
typename S>
82 using Superclass::ComputeScalarRange;
84 double* ranges,
const unsigned char* ghosts,
unsigned char ghostsToSkip = 0xff)
override;
85 using Superclass::ComputeVectorRange;
87 double range[2],
const unsigned char* ghosts,
unsigned char ghostsToSkip = 0xff)
override;
88 using Superclass::ComputeFiniteScalarRange;
90 double* ranges,
const unsigned char* ghosts,
unsigned char ghostsToSkip = 0xff)
override;
91 using Superclass::ComputeFiniteVectorRange;
93 double range[2],
const unsigned char* ghosts,
unsigned char ghostsToSkip = 0xff)
override;
106 bool AllocateTuples(
vtkIdType numberOfTuples);
107 bool ReallocateTuples(
vtkIdType numberOfTuples);
109 std::unique_ptr<internal::ArrayHandleHelperInterface<T>> Helper;
116template <
typename T,
typename S>
118 const vtkm::cont::ArrayHandle<T, S>& ah)
121 ret->SetVtkmArrayHandle(ah);
126#ifndef vtkmDataArray_cxx
145#include "vtkmlib/vtkmDataArray.hxx"
Abstract superclass for all arrays.
Base interface for all typed vtkDataArray subclasses.
Wraps a VTK-m ArrayHandle inside a sub-class of vtkGenericDataArray.
bool ComputeVectorRange(double range[2], const unsigned char *ghosts, unsigned char ghostsToSkip=0xff) override
Returns true if the range was computed.
bool ComputeFiniteVectorRange(double range[2], const unsigned char *ghosts, unsigned char ghostsToSkip=0xff) override
Returns true if the range was computed.
vtkm::cont::UnknownArrayHandle GetVtkmUnknownArrayHandle() const
Get the underlying ArrayHandle.
~vtkmDataArray() override
void SetVtkmArrayHandle(const vtkm::cont::ArrayHandle< V, S > &ah)
Set the VTK-m ArrayHandle to be wrapped.
bool ComputeFiniteScalarRange(double *ranges, const unsigned char *ghosts, unsigned char ghostsToSkip=0xff) override
Computes the range for each component of an array, the length of ranges must be two times the number ...
static vtkmDataArray * New()
bool ComputeScalarRange(double *ranges, const unsigned char *ghosts, unsigned char ghostsToSkip=0xff) override
Computes the range for each component of an array, the length of ranges must be two times the number ...
vtkmDataArray< typename vtkm::VecTraits< T >::BaseComponentType > * make_vtkmDataArray(const vtkm::cont::ArrayHandle< T, S > &ah)