Commit 78e9cf09 authored by Robert Maynard's avatar Robert Maynard

ArrayRangeCompute now supports ArrayHandleVirtual<vec3f>

parent 7eb1e31b
......@@ -52,7 +52,6 @@ VTKM_CONT vtkm::cont::ArrayHandle<vtkm::Range> ArrayRangeCompute(
const ArrayHandleType& input,
vtkm::cont::RuntimeDeviceTracker tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker());
// Precompiled versions of ArrayRangeCompute
#define VTKM_ARRAY_RANGE_COMPUTE_EXPORT_T(T, Storage) \
VTKM_CONT_EXPORT \
......@@ -95,11 +94,19 @@ VTKM_ARRAY_RANGE_COMPUTE_EXPORT_VEC(vtkm::UInt8, 4, vtkm::cont::StorageTagBasic)
VTKM_ARRAY_RANGE_COMPUTE_EXPORT_VEC(vtkm::Float32, 4, vtkm::cont::StorageTagBasic);
VTKM_ARRAY_RANGE_COMPUTE_EXPORT_VEC(vtkm::Float64, 4, vtkm::cont::StorageTagBasic);
#undef VTKM_ARRAY_RANGE_COMPUTE_EXPORT_T
#undef VTKM_ARRAY_RANGE_COMPUTE_EXPORT_VEC
// Implementation of uniform point coordinates
VTKM_CONT
vtkm::cont::ArrayHandle<vtkm::Range> ArrayRangeCompute(
const vtkm::cont::ArrayHandleVirtualCoordinates& input,
vtkm::cont::RuntimeDeviceTracker tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker());
VTKM_CONT
vtkm::cont::ArrayHandle<vtkm::Range> ArrayRangeCompute(
const vtkm::cont::ArrayHandleVirtual<vtkm::Vec<vtkm::FloatDefault, 3>>& input,
vtkm::cont::RuntimeDeviceTracker tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker());
VTKM_CONT_EXPORT
VTKM_CONT
vtkm::cont::ArrayHandle<vtkm::Range> ArrayRangeCompute(
......@@ -107,7 +114,6 @@ vtkm::cont::ArrayHandle<vtkm::Range> ArrayRangeCompute(
vtkm::cont::ArrayHandleUniformPointCoordinates::StorageTag>& array,
vtkm::cont::RuntimeDeviceTracker = vtkm::cont::GetGlobalRuntimeDeviceTracker());
// Implementation of composite vectors
VTKM_CONT_EXPORT
VTKM_CONT
......
......@@ -103,6 +103,53 @@ inline vtkm::cont::ArrayHandle<vtkm::Range> ArrayRangeComputeImpl(
} // namespace detail
VTKM_CONT
inline vtkm::cont::ArrayHandle<vtkm::Range> ArrayRangeCompute(
const vtkm::cont::ArrayHandleVirtualCoordinates& input,
vtkm::cont::RuntimeDeviceTracker tracker)
{
auto array =
static_cast<const vtkm::cont::ArrayHandleVirtual<vtkm::Vec<vtkm::FloatDefault, 3>>&>(input);
return ArrayRangeCompute(array, tracker);
}
VTKM_CONT
inline vtkm::cont::ArrayHandle<vtkm::Range> ArrayRangeCompute(
const vtkm::cont::ArrayHandleVirtual<vtkm::Vec<vtkm::FloatDefault, 3>>& input,
vtkm::cont::RuntimeDeviceTracker tracker)
{
using UniformHandleType = ArrayHandleUniformPointCoordinates;
using RectilinearHandleType =
vtkm::cont::ArrayHandleCartesianProduct<vtkm::cont::ArrayHandle<vtkm::FloatDefault>,
vtkm::cont::ArrayHandle<vtkm::FloatDefault>,
vtkm::cont::ArrayHandle<vtkm::FloatDefault>>;
if (input.IsType<UniformHandleType>())
{
using T = typename UniformHandleType::ValueType;
using S = typename UniformHandleType::StorageTag;
const vtkm::cont::StorageVirtual* storage = input.GetStorage();
const auto* any = storage->Cast<vtkm::cont::StorageAny<T, S>>();
return ArrayRangeCompute(any->GetHandle(), tracker);
}
else if (input.IsType<RectilinearHandleType>())
{
using T = typename RectilinearHandleType::ValueType;
using S = typename RectilinearHandleType::StorageTag;
const vtkm::cont::StorageVirtual* storage = input.GetStorage();
const auto* any = storage->Cast<vtkm::cont::StorageAny<T, S>>();
return ArrayRangeCompute(any->GetHandle(), tracker);
}
else
{
return detail::ArrayRangeComputeImpl(input, tracker);
}
}
template <typename ArrayHandleType>
inline vtkm::cont::ArrayHandle<vtkm::Range> ArrayRangeCompute(
const ArrayHandleType& input,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment