Commit ef83adf3 authored by Robert Maynard's avatar Robert Maynard

Field, CoordinateSystem, VirtualCoordinates all use the new virtual code

parent 3d67a008
......@@ -59,6 +59,12 @@ public:
ArrayHandle()
: Storage(nullptr){};
/// virtual destructor, as required to make sure derived classes that
/// might have member variables are properly cleaned up.
//
virtual ~ArrayHandle() = default;
///Move existing shared_ptr of vtkm::cont::StorageVirtual to be
///owned by this ArrayHandleVirtual.
///This is generally how derived class construct a valid ArrayHandleVirtual
......@@ -107,23 +113,20 @@ public:
VTKM_CONT bool IsType() const
{
VTKM_IS_ARRAY_HANDLE(ArrayHandleType);
//We need to go long the way to find the StorageType
//as StorageType is private on lots of derived ArrayHandles
//See Issue #314
using VT = typename ArrayHandleType::ValueType;
static_assert(
std::is_same<VT, T>::value,
"ArrayHandleVirtual<ValueType> can only be casted to an ArrayHandle of the same ValueType.");
//We need to determine if we are checking that `ArrayHandleType`
//is a virtual array handle since that is an easy check.
//Or if we have to go ask the storage if they are holding
//
using ST = typename ArrayHandleType::StorageTag;
return this->Storage->IsType(typeid(vtkm::cont::internal::Storage<VT, ST>));
using is_base = std::is_same<vtkm::cont::StorageTagVirtual, ST>;
return this->IsSameType<ArrayHandleType>(is_base{});
}
/// Returns a view on the internal storage of the ArrayHandleVirtual
///
VTKM_CONT const StorageType* GetStorage() const { return this->Storage.get(); }
/// Returns a new instance of an ArrayHandleVirtual with the same storage
///
VTKM_CONT ArrayHandle<T, ::vtkm::cont::StorageTagVirtual> NewInstance() const
......@@ -133,29 +136,57 @@ public:
: ArrayHandle<T, ::vtkm::cont::StorageTagVirtual>();
}
// Return a ArrayPortalRef that wraps the real virtual portal. We need a stack object for
// the following reasons:
// 1. Device Adapter algorithms only support const AH<T,S>& and not const AH<T,S>*
// 2. Devices will want to get the length of a portal before execution, but for CUDA
// we can't ask this information of the portal as it only valid on the device, instead
// we have to store this information also in the ref wrapper
vtkm::ArrayPortalRef<T> PrepareForInput(vtkm::cont::DeviceAdapterId devId) const
/// Returns a view on the internal storage of the ArrayHandleVirtual
///
VTKM_CONT const StorageType* GetStorage() const { return this->Storage.get(); }
/// Get the array portal of the control array.
/// Since worklet invocations are asynchronous and this routine is a synchronization point,
/// exceptions maybe thrown for errors from previously executed worklets.
///
PortalControl GetPortalControl()
{
return make_ArrayPortalRef(
static_cast<const vtkm::ArrayPortalVirtual<T>*>(this->Storage->PrepareForInput(devId)),
static_cast<const vtkm::ArrayPortalVirtual<T>*>(this->Storage->GetPortalControl()),
this->GetNumberOfValues());
}
vtkm::ArrayPortalRef<T> PrepareForOutput(vtkm::Id numberOfValues,
vtkm::cont::DeviceAdapterId devId)
/// Get the array portal of the control array.
/// Since worklet invocations are asynchronous and this routine is a synchronization point,
/// exceptions maybe thrown for errors from previously executed worklets.
///
PortalConstControl GetPortalConstControl() const
{
return make_ArrayPortalRef(static_cast<const vtkm::ArrayPortalVirtual<T>*>(
this->Storage->PrepareForOutput(numberOfValues, devId)),
numberOfValues);
return make_ArrayPortalRef(
static_cast<const vtkm::ArrayPortalVirtual<T>*>(this->Storage->GetPortalConstControl()),
this->GetNumberOfValues());
}
/// Returns the number of entries in the array.
///
vtkm::Id GetNumberOfValues() const { return this->Storage->GetNumberOfValues(); }
/// \brief Allocates an array large enough to hold the given number of values.
///
/// The allocation may be done on an already existing array, but can wipe out
/// any data already in the array. This method can throw
/// ErrorBadAllocation if the array cannot be allocated or
/// ErrorBadValue if the allocation is not feasible (for example, the
/// array storage is read-only).
///
VTKM_CONT
void Allocate(vtkm::Id numberOfValues) { return this->Storage->Allocate(numberOfValues); }
/// \brief Reduces the size of the array without changing its values.
///
/// This method allows you to resize the array without reallocating it. The
/// number of entries in the array is changed to \c numberOfValues. The data
/// in the array (from indices 0 to \c numberOfValues - 1) are the same, but
/// \c numberOfValues must be equal or less than the preexisting size
/// (returned from GetNumberOfValues). That is, this method can only be used
/// to shorten the array, not lengthen.
void Shrink(vtkm::Id numberOfValues) { return this->Storage->Shrink(numberOfValues); }
/// Releases any resources being used in the execution environment (that are
/// not being shared by the control environment).
///
......@@ -165,30 +196,80 @@ public:
///
void ReleaseResources() { return this->Storage->ReleaseResources(); }
/// Get the array portal of the control array.
/// Since worklet invocations are asynchronous and this routine is a synchronization point,
/// exceptions maybe thrown for errors from previously executed worklets.
/// Prepares this array to be used as an input to an operation in the
/// execution environment. If necessary, copies data to the execution
/// environment. Can throw an exception if this array does not yet contain
/// any data. Returns a portal that can be used in code running in the
/// execution environment.
///
PortalControl GetPortalControl()
/// Return a ArrayPortalRef that wraps the real virtual portal. We need a stack object for
/// the following reasons:
/// 1. Device Adapter algorithms only support const AH<T,S>& and not const AH<T,S>*
/// 2. Devices will want to get the length of a portal before execution, but for CUDA
/// we can't ask this information of the portal as it only valid on the device, instead
/// we have to store this information also in the ref wrapper
vtkm::ArrayPortalRef<T> PrepareForInput(vtkm::cont::DeviceAdapterId devId) const
{
return make_ArrayPortalRef(
static_cast<const vtkm::ArrayPortalVirtual<T>*>(this->Storage->GetPortalControl()),
static_cast<const vtkm::ArrayPortalVirtual<T>*>(this->Storage->PrepareForInput(devId)),
this->GetNumberOfValues());
}
/// Get the array portal of the control array.
/// Since worklet invocations are asynchronous and this routine is a synchronization point,
/// exceptions maybe thrown for errors from previously executed worklets.
/// Prepares (allocates) this array to be used as an output from an operation
/// in the execution environment. The internal state of this class is set to
/// have valid data in the execution array with the assumption that the array
/// will be filled soon (i.e. before any other methods of this object are
/// called). Returns a portal that can be used in code running in the
/// execution environment.
///
PortalConstControl GetPortalConstControl() const
vtkm::ArrayPortalRef<T> PrepareForOutput(vtkm::Id numberOfValues,
vtkm::cont::DeviceAdapterId devId)
{
return make_ArrayPortalRef(static_cast<const vtkm::ArrayPortalVirtual<T>*>(
this->Storage->PrepareForOutput(numberOfValues, devId)),
numberOfValues);
}
/// Prepares this array to be used in an in-place operation (both as input
/// and output) in the execution environment. If necessary, copies data to
/// the execution environment. Can throw an exception if this array does not
/// yet contain any data. Returns a portal that can be used in code running
/// in the execution environment.
///
vtkm::ArrayPortalRef<T> PrepareForInPlace(vtkm::cont::DeviceAdapterId devId)
{
return make_ArrayPortalRef(
static_cast<const vtkm::ArrayPortalVirtual<T>*>(this->Storage->GetPortalConstControl()),
static_cast<const vtkm::ArrayPortalVirtual<T>*>(this->Storage->PrepareForInput(devId)),
this->GetNumberOfValues());
}
/// Returns the DeviceAdapterId for the current device. If there is no device
/// with an up-to-date copy of the data, VTKM_DEVICE_ADAPTER_UNDEFINED is
/// returned.
VTKM_CONT
DeviceAdapterId GetDeviceAdapterId() const { return this->Storage->GetDeviceAdapterId(); }
protected:
std::shared_ptr<StorageType> Storage = nullptr;
private:
template <typename ArrayHandleType>
bool IsSameType(std::true_type vtkmNotUsed(inheritsFromArrayHandleVirtual)) const
{
//All classes that derive from ArrayHandleVirtual have virtual methods so we can use
//typeid directly
return typeid(*this) == typeid(ArrayHandleType);
}
template <typename ArrayHandleType>
bool IsSameType(std::false_type vtkmNotUsed(notFromArrayHandleVirtual)) const
{
//We need to go long the way to find the StorageType
//as StorageType is private on lots of derived ArrayHandles
//See Issue #314
using ST = typename ArrayHandleType::StorageTag;
return this->Storage->IsType(typeid(vtkm::cont::internal::Storage<T, ST>));
}
};
template <typename T>
......
This diff is collapsed.
......@@ -25,8 +25,8 @@
#include <vtkm/StaticAssert.h>
#include <vtkm/cont/ArrayHandle.h>
#include <vtkm/cont/ArrayHandleVariant.h>
#include <vtkm/cont/DeviceAdapterAlgorithm.h>
#include <vtkm/cont/DynamicArrayHandle.h>
#include <vtkm/cont/Field.h>
namespace vtkm
......
......@@ -27,10 +27,6 @@ namespace vtkm
namespace cont
{
using CoordinatesTypeList = vtkm::ListTagBase<vtkm::cont::ArrayHandleVirtualCoordinates::ValueType>;
using CoordinatesStorageList =
vtkm::ListTagBase<vtkm::cont::ArrayHandleVirtualCoordinates::StorageTag>;
VTKM_CONT CoordinateSystem::CoordinateSystem()
: Superclass()
{
......@@ -38,7 +34,7 @@ VTKM_CONT CoordinateSystem::CoordinateSystem()
VTKM_CONT CoordinateSystem::CoordinateSystem(
std::string name,
const vtkm::cont::ArrayHandleVirtualCoordinates::Superclass& data)
const vtkm::cont::ArrayHandleVirtual<vtkm::Vec<vtkm::FloatDefault, 3>>& data)
: Superclass(name, Association::POINTS, data)
{
}
......@@ -64,7 +60,8 @@ vtkm::cont::ArrayHandleVirtualCoordinates CoordinateSystem::GetData() const
}
VTKM_CONT
void CoordinateSystem::SetData(const vtkm::cont::ArrayHandleVirtualCoordinates::Superclass& newdata)
void CoordinateSystem::SetData(
const vtkm::cont::ArrayHandleVirtual<vtkm::Vec<vtkm::FloatDefault, 3>>& newdata)
{
this->Superclass::SetData(newdata);
}
......@@ -76,26 +73,6 @@ void CoordinateSystem::PrintSummary(std::ostream& out) const
this->Superclass::PrintSummary(out);
}
VTKM_CONT
void CoordinateSystem::GetRange(vtkm::Range* range) const
{
this->Superclass::GetRange(range, CoordinatesTypeList(), CoordinatesStorageList());
}
VTKM_CONT
const vtkm::cont::ArrayHandle<vtkm::Range>& CoordinateSystem::GetRange() const
{
return this->Superclass::GetRange(CoordinatesTypeList(), CoordinatesStorageList());
}
VTKM_CONT
vtkm::Bounds CoordinateSystem::GetBounds() const
{
vtkm::Range ranges[3];
this->GetRange(ranges);
return vtkm::Bounds(ranges[0], ranges[1], ranges[2]);
}
template VTKM_CONT_EXPORT CoordinateSystem::CoordinateSystem(
std::string name,
const vtkm::cont::ArrayHandle<vtkm::Vec<float, 3>>&);
......@@ -141,12 +118,12 @@ template VTKM_CONT_EXPORT CoordinateSystem::CoordinateSystem(
vtkm::cont::ArrayHandle<vtkm::Float64, vtkm::cont::StorageTagBasic>>::StorageTag>&);
template VTKM_CONT_EXPORT CoordinateSystem::CoordinateSystem(std::string name,
const vtkm::cont::DynamicArrayHandle&);
const vtkm::cont::ArrayHandleVariant&);
template VTKM_CONT_EXPORT void CoordinateSystem::SetData(
const vtkm::cont::ArrayHandle<vtkm::Vec<float, 3>>&);
template VTKM_CONT_EXPORT void CoordinateSystem::SetData(
const vtkm::cont::ArrayHandle<vtkm::Vec<double, 3>>&);
template VTKM_CONT_EXPORT void CoordinateSystem::SetData(const vtkm::cont::DynamicArrayHandle&);
template VTKM_CONT_EXPORT void CoordinateSystem::SetData(const vtkm::cont::ArrayHandleVariant&);
}
} // namespace vtkm::cont
......@@ -33,17 +33,20 @@ namespace cont
class VTKM_CONT_EXPORT CoordinateSystem : public vtkm::cont::Field
{
using Superclass = vtkm::cont::Field;
using CoordinatesTypeList =
vtkm::ListTagBase<vtkm::cont::ArrayHandleVirtualCoordinates::ValueType>;
public:
VTKM_CONT
CoordinateSystem();
VTKM_CONT CoordinateSystem(std::string name,
const vtkm::cont::ArrayHandleVirtualCoordinates::Superclass& data);
VTKM_CONT CoordinateSystem(
std::string name,
const vtkm::cont::ArrayHandleVirtual<vtkm::Vec<vtkm::FloatDefault, 3>>& data);
template <typename TypeList, typename StorageList>
template <typename TypeList>
VTKM_CONT CoordinateSystem(std::string name,
const vtkm::cont::DynamicArrayHandleBase<TypeList, StorageList>& data);
const vtkm::cont::ArrayHandleVariantBase<TypeList>& data);
template <typename T, typename Storage>
VTKM_CONT CoordinateSystem(std::string name, const ArrayHandle<T, Storage>& data);
......@@ -60,23 +63,35 @@ public:
VTKM_CONT
vtkm::cont::ArrayHandleVirtualCoordinates GetData() const;
VTKM_CONT void SetData(const vtkm::cont::ArrayHandleVirtualCoordinates::Superclass& newdata);
VTKM_CONT void SetData(
const vtkm::cont::ArrayHandleVirtual<vtkm::Vec<vtkm::FloatDefault, 3>>& newdata);
template <typename T, typename StorageTag>
VTKM_CONT void SetData(const vtkm::cont::ArrayHandle<T, StorageTag>& newdata);
template <typename T, typename Storage>
VTKM_CONT void SetData(const vtkm::cont::ArrayHandle<T, Storage>& newdata);
VTKM_CONT
template <typename TypeList, typename StorageList>
void SetData(const vtkm::cont::DynamicArrayHandleBase<TypeList, StorageList>& newdata);
template <typename TypeList>
void SetData(const vtkm::cont::ArrayHandleVariantBase<TypeList>& newdata);
VTKM_CONT
void GetRange(vtkm::Range* range) const;
void GetRange(vtkm::Range* range) const
{
this->Superclass::GetRange(range, CoordinatesTypeList());
}
VTKM_CONT
const vtkm::cont::ArrayHandle<vtkm::Range>& GetRange() const;
const vtkm::cont::ArrayHandle<vtkm::Range>& GetRange() const
{
return this->Superclass::GetRange(CoordinatesTypeList());
}
VTKM_CONT
vtkm::Bounds GetBounds() const;
vtkm::Bounds GetBounds() const
{
vtkm::Range ranges[3];
this->GetRange(ranges);
return vtkm::Bounds(ranges[0], ranges[1], ranges[2]);
}
virtual void PrintSummary(std::ostream& out) const override;
......
......@@ -48,22 +48,22 @@ struct MakeArrayHandleVirtualCoordinatesFunctor
}
};
template <typename TypeList, typename StorageList>
template <typename TypeList>
VTKM_CONT vtkm::cont::ArrayHandleVirtualCoordinates MakeArrayHandleVirtualCoordinates(
const vtkm::cont::DynamicArrayHandleBase<TypeList, StorageList>& array)
const vtkm::cont::ArrayHandleVariantBase<TypeList>& array)
{
vtkm::cont::ArrayHandleVirtualCoordinates output;
vtkm::cont::CastAndCall(array.ResetTypeList(vtkm::TypeListTagFieldVec3{}),
vtkm::cont::CastAndCall(array.ResetTypes(vtkm::TypeListTagFieldVec3{}),
MakeArrayHandleVirtualCoordinatesFunctor{},
output);
return output;
}
} // namespace detail
template <typename TypeList, typename StorageList>
template <typename TypeList>
VTKM_CONT CoordinateSystem::CoordinateSystem(
std::string name,
const vtkm::cont::DynamicArrayHandleBase<TypeList, StorageList>& data)
const vtkm::cont::ArrayHandleVariantBase<TypeList>& data)
: Superclass(name, Association::POINTS, detail::MakeArrayHandleVirtualCoordinates(data))
{
}
......@@ -81,9 +81,9 @@ VTKM_CONT void CoordinateSystem::SetData(const vtkm::cont::ArrayHandle<T, Storag
this->SetData(vtkm::cont::ArrayHandleVirtualCoordinates(newdata));
}
template <typename TypeList, typename StorageList>
template <typename TypeList>
VTKM_CONT void CoordinateSystem::SetData(
const vtkm::cont::DynamicArrayHandleBase<TypeList, StorageList>& newdata)
const vtkm::cont::ArrayHandleVariantBase<TypeList>& newdata)
{
this->SetData(detail::MakeArrayHandleVirtualCoordinates(newdata));
}
......
......@@ -23,9 +23,9 @@
#include <vtkm/cont/vtkm_cont_export.h>
#include <vtkm/cont/ArrayHandle.h>
#include <vtkm/cont/ArrayHandleVariant.h>
#include <vtkm/cont/CoordinateSystem.h>
#include <vtkm/cont/DeviceAdapterAlgorithm.h>
#include <vtkm/cont/DynamicArrayHandle.h>
#include <vtkm/cont/DynamicCellSet.h>
#include <vtkm/cont/ErrorBadValue.h>
#include <vtkm/cont/Field.h>
......@@ -193,7 +193,6 @@ namespace cont
{
template <typename FieldTypeList = VTKM_DEFAULT_TYPE_LIST_TAG,
typename FieldStorageList = VTKM_DEFAULT_STORAGE_LIST_TAG,
typename CellSetTypesList = VTKM_DEFAULT_CELL_SET_LIST_TAG>
struct SerializableDataSet
{
......@@ -212,12 +211,11 @@ struct SerializableDataSet
namespace diy
{
template <typename FieldTypeList, typename FieldStorageList, typename CellSetTypesList>
struct Serialization<
vtkm::cont::SerializableDataSet<FieldTypeList, FieldStorageList, CellSetTypesList>>
template <typename FieldTypeList, typename CellSetTypesList>
struct Serialization<vtkm::cont::SerializableDataSet<FieldTypeList, CellSetTypesList>>
{
private:
using Type = vtkm::cont::SerializableDataSet<FieldTypeList, FieldStorageList, CellSetTypesList>;
using Type = vtkm::cont::SerializableDataSet<FieldTypeList, CellSetTypesList>;
public:
static VTKM_CONT void save(BinaryBuffer& bb, const Type& serializable)
......@@ -242,8 +240,7 @@ public:
diy::save(bb, numberOfFields);
for (vtkm::IdComponent i = 0; i < numberOfFields; ++i)
{
diy::save(
bb, vtkm::cont::SerializableField<FieldTypeList, FieldStorageList>(dataset.GetField(i)));
diy::save(bb, vtkm::cont::SerializableField<FieldTypeList>(dataset.GetField(i)));
}
}
......@@ -274,7 +271,7 @@ public:
diy::load(bb, numberOfFields);
for (vtkm::IdComponent i = 0; i < numberOfFields; ++i)
{
vtkm::cont::SerializableField<FieldTypeList, FieldStorageList> field;
vtkm::cont::SerializableField<FieldTypeList> field;
diy::load(bb, field);
dataset.AddField(field.Field);
}
......
......@@ -38,7 +38,7 @@ public:
VTKM_CONT
static void AddPointField(vtkm::cont::DataSet& dataSet,
const std::string& fieldName,
const vtkm::cont::DynamicArrayHandle& field)
const vtkm::cont::ArrayHandleVariant& field)
{
dataSet.AddField(Field(fieldName, vtkm::cont::Field::Association::POINTS, field));
}
......@@ -74,7 +74,7 @@ public:
VTKM_CONT
static void AddCellField(vtkm::cont::DataSet& dataSet,
const std::string& fieldName,
const vtkm::cont::DynamicArrayHandle& field,
const vtkm::cont::ArrayHandleVariant& field,
const std::string& cellSetName)
{
dataSet.AddField(
......@@ -119,7 +119,7 @@ public:
VTKM_CONT
static void AddCellField(vtkm::cont::DataSet& dataSet,
const std::string& fieldName,
const vtkm::cont::DynamicArrayHandle& field,
const vtkm::cont::ArrayHandleVariant& field,
vtkm::Id cellSetIndex = 0)
{
std::string cellSetName = dataSet.GetCellSet(cellSetIndex).GetName();
......
......@@ -18,7 +18,7 @@
// this software.
//============================================================================
#include <vtkm/cont/Field.h>
#include "Field.h"
namespace vtkm
{
......@@ -27,7 +27,7 @@ namespace cont
/// constructors for points / whole mesh
VTKM_CONT
Field::Field(std::string name, Association association, const vtkm::cont::DynamicArrayHandle& data)
Field::Field(std::string name, Association association, const vtkm::cont::ArrayHandleVariant& data)
: Name(name)
, FieldAssociation(association)
, AssocCellSetName()
......@@ -45,7 +45,7 @@ VTKM_CONT
Field::Field(std::string name,
Association association,
const std::string& cellSetName,
const vtkm::cont::DynamicArrayHandle& data)
const vtkm::cont::ArrayHandleVariant& data)
: Name(name)
, FieldAssociation(association)
, AssocCellSetName(cellSetName)
......@@ -62,7 +62,7 @@ VTKM_CONT
Field::Field(std::string name,
Association association,
vtkm::IdComponent logicalDim,
const vtkm::cont::DynamicArrayHandle& data)
const vtkm::cont::ArrayHandleVariant& data)
: Name(name)
, FieldAssociation(association)
, AssocCellSetName()
......@@ -155,36 +155,18 @@ Field::~Field()
{
}
VTKM_CONT
const vtkm::cont::ArrayHandle<vtkm::Range>& Field::GetRange() const
{
return this->GetRange(VTKM_DEFAULT_TYPE_LIST_TAG(), VTKM_DEFAULT_STORAGE_LIST_TAG());
}
VTKM_CONT
void Field::GetRange(vtkm::Range* range) const
{
this->GetRange(range, VTKM_DEFAULT_TYPE_LIST_TAG(), VTKM_DEFAULT_STORAGE_LIST_TAG());
}
VTKM_CONT
const vtkm::cont::DynamicArrayHandle& Field::GetData() const
const vtkm::cont::ArrayHandleVariant& Field::GetData() const
{
return this->Data;
}
VTKM_CONT
vtkm::cont::DynamicArrayHandle& Field::GetData()
vtkm::cont::ArrayHandleVariant& Field::GetData()
{
this->ModifiedFlag = true;
return this->Data;
}
VTKM_CONT
const vtkm::cont::ArrayHandle<vtkm::Range>& Field::GetRange(VTKM_DEFAULT_TYPE_LIST_TAG,
VTKM_DEFAULT_STORAGE_LIST_TAG) const
{
return this->GetRangeImpl(VTKM_DEFAULT_TYPE_LIST_TAG(), VTKM_DEFAULT_STORAGE_LIST_TAG());
}
}
} // namespace vtkm::cont
This diff is collapsed.
......@@ -34,7 +34,7 @@ vtkm::cont::ArrayHandle<vtkm::Range> FieldRangeCompute(const vtkm::cont::DataSet
vtkm::cont::Field::Association assoc)
{
return vtkm::cont::detail::FieldRangeComputeImpl(
dataset, name, assoc, VTKM_DEFAULT_TYPE_LIST_TAG(), VTKM_DEFAULT_STORAGE_LIST_TAG());
dataset, name, assoc, VTKM_DEFAULT_TYPE_LIST_TAG());
}
//-----------------------------------------------------------------------------
......@@ -44,7 +44,7 @@ vtkm::cont::ArrayHandle<vtkm::Range> FieldRangeCompute(const vtkm::cont::MultiBl
vtkm::cont::Field::Association assoc)
{
return vtkm::cont::detail::FieldRangeComputeImpl(
multiblock, name, assoc, VTKM_DEFAULT_TYPE_LIST_TAG(), VTKM_DEFAULT_STORAGE_LIST_TAG());
multiblock, name, assoc, VTKM_DEFAULT_TYPE_LIST_TAG());
}
}
} // namespace vtkm::cont
......@@ -47,20 +47,6 @@ vtkm::cont::ArrayHandle<vtkm::Range> FieldRangeCompute(
const std::string& name,
vtkm::cont::Field::Association assoc = vtkm::cont::Field::Association::ANY);
template <typename TypeList, typename StorageList>
VTKM_CONT vtkm::cont::ArrayHandle<vtkm::Range> FieldRangeCompute(
const vtkm::cont::DataSet& dataset,
const std::string& name,
vtkm::cont::Field::Association assoc,
TypeList,
StorageList)
{
VTKM_IS_LIST_TAG(TypeList);
VTKM_IS_LIST_TAG(StorageList);
return vtkm::cont::detail::FieldRangeComputeImpl(dataset, name, assoc, TypeList(), StorageList());
}
template <typename TypeList>
VTKM_CONT vtkm::cont::ArrayHandle<vtkm::Range> FieldRangeCompute(
const vtkm::cont::DataSet& dataset,
......@@ -69,9 +55,9 @@ VTKM_CONT vtkm::cont::ArrayHandle<vtkm::Range> FieldRangeCompute(
TypeList)
{
VTKM_IS_LIST_TAG(TypeList);
return vtkm::cont::detail::FieldRangeComputeImpl(
dataset, name, assoc, TypeList(), VTKM_DEFAULT_STORAGE_LIST_TAG());
return vtkm::cont::detail::FieldRangeComputeImpl(dataset, name, assoc, TypeList());
}
//@}
//{@
......@@ -88,21 +74,6 @@ vtkm::cont::ArrayHandle<vtkm::Range> FieldRangeCompute(
const std::string& name,
vtkm::cont::Field::Association assoc = vtkm::cont::Field::Association::ANY);
template <typename TypeList, typename StorageList>
VTKM_CONT vtkm::cont::ArrayHandle<vtkm::Range> FieldRangeCompute(
const vtkm::cont::MultiBlock& multiblock,
const std::string& name,
vtkm::cont::Field::Association assoc,
TypeList,
StorageList)
{
VTKM_IS_LIST_TAG(TypeList);
VTKM_IS_LIST_TAG(StorageList);
return vtkm::cont::detail::FieldRangeComputeImpl(
multiblock, name, assoc, TypeList(), StorageList());
}
template <typename TypeList>
VTKM_CONT vtkm::cont::ArrayHandle<vtkm::Range> FieldRangeCompute(
const vtkm::cont::MultiBlock& multiblock,
......@@ -111,9 +82,9 @@ VTKM_CONT vtkm::cont::ArrayHandle<vtkm::Range> FieldRangeCompute(
TypeList)
{
VTKM_IS_LIST_TAG(TypeList);
return vtkm::cont::detail::FieldRangeComputeImpl(
multiblock, name, assoc, TypeList(), VTKM_DEFAULT_STORAGE_LIST_TAG());
return vtkm::cont::detail::FieldRangeComputeImpl(multiblock, name, assoc, TypeList());
}
//@}
}
} // namespace vtkm::cont
......
......@@ -29,13 +29,12 @@ namespace cont
namespace detail
{
template <typename TypeList, typename StorageList>
template <typename TypeList>
VTKM_CONT vtkm::cont::ArrayHandle<vtkm::Range> FieldRangeComputeImpl(
const vtkm::cont::DataSet& dataset,
const std::string& name,
vtkm::cont::Field::Association assoc,
TypeList,
StorageList)
TypeList)
{
vtkm::cont::Field field;
try
......@@ -48,16 +47,15 @@ VTKM_CONT vtkm::cont::ArrayHandle<vtkm::Range> FieldRangeComputeImpl(
return vtkm::cont::ArrayHandle<vtkm::Range>();
}
return field.GetRange(TypeList(), StorageList());
return field.GetRange(TypeList());
}
template <typename TypeList, typename StorageList>
template <typename TypeList>
VTKM_CONT vtkm::cont::ArrayHandle<vtkm::Range> FieldRangeComputeImpl(
const vtkm::cont::MultiBlock& multiblock,
const std::string& name,
vtkm::cont::Field::Association assoc,
TypeList,
StorageList)
TypeList)
{
std::vector<vtkm::Range> result_vector = std::accumulate(
multiblock.begin(),
......@@ -65,7 +63,7 @@ VTKM_CONT vtkm::cont::ArrayHandle<vtkm::Range> FieldRangeComputeImpl(
std::vector<vtkm::Range>(),
[&](const std::vector<vtkm::Range>& accumulated_value, const vtkm::cont::DataSet& dataset) {
vtkm::cont::ArrayHandle<vtkm::Range> block_range =
vtkm::cont::detail::FieldRangeComputeImpl(dataset, name, assoc, TypeList(), StorageList());
vtkm::cont::detail::FieldRangeComputeImpl(dataset, name, assoc, TypeList());
std::vector<vtkm::Range> result = accumulated_value;
......
......@@ -45,8 +45,7 @@ vtkm::cont::ArrayHandle<vtkm::Range> FieldRangeGlobalCompute(const vtkm::cont::D
const std::string& name,
vtkm::cont::Field::Association assoc)
{
return detail::FieldRangeGlobalComputeImpl(
dataset, name, assoc, VTKM_DEFAULT_TYPE_LIST_TAG(), VTKM_DEFAULT_STORAGE_LIST_TAG());
return detail::FieldRangeGlobalComputeImpl(dataset, name, assoc, VTKM_DEFAULT_TYPE_LIST_TAG());
}
//-----------------------------------------------------------------------------
......@@ -56,8 +55,7 @@ vtkm::cont::ArrayHandle<vtkm::Range> FieldRangeGlobalCompute(
const std::string& name,
vtkm::cont::Field::Association assoc)
{
return detail::FieldRangeGlobalComputeImpl(
multiblock, name, assoc, VTKM_DEFAULT_TYPE_LIST_TAG(), VTKM_DEFAULT_STORAGE_LIST_TAG());
return detail::FieldRangeGlobalComputeImpl(multiblock, name, assoc, VTKM_DEFAULT_TYPE_LIST_TAG());
}
//-----------------------------------------------------------------------------
......
......@@ -45,20 +45,6 @@ vtkm::cont::ArrayHandle<vtkm::Range> FieldRangeGlobalCompute(
const std::string& name,
vtkm::cont::Field::Association assoc = vtkm::cont::Field::Association::ANY);
template <typename TypeList, typename StorageList>