Commit ef83adf3 authored by Robert Maynard's avatar Robert Maynard
Browse files

Field, CoordinateSystem, VirtualCoordinates all use the new virtual code

parent 3d67a008
...@@ -59,6 +59,12 @@ public: ...@@ -59,6 +59,12 @@ public:
ArrayHandle() ArrayHandle()
: Storage(nullptr){}; : 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 ///Move existing shared_ptr of vtkm::cont::StorageVirtual to be
///owned by this ArrayHandleVirtual. ///owned by this ArrayHandleVirtual.
///This is generally how derived class construct a valid ArrayHandleVirtual ///This is generally how derived class construct a valid ArrayHandleVirtual
...@@ -107,23 +113,20 @@ public: ...@@ -107,23 +113,20 @@ public:
VTKM_CONT bool IsType() const VTKM_CONT bool IsType() const
{ {
VTKM_IS_ARRAY_HANDLE(ArrayHandleType); 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; using VT = typename ArrayHandleType::ValueType;
static_assert( static_assert(
std::is_same<VT, T>::value, std::is_same<VT, T>::value,
"ArrayHandleVirtual<ValueType> can only be casted to an ArrayHandle of the same ValueType."); "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; 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 /// Returns a new instance of an ArrayHandleVirtual with the same storage
/// ///
VTKM_CONT ArrayHandle<T, ::vtkm::cont::StorageTagVirtual> NewInstance() const VTKM_CONT ArrayHandle<T, ::vtkm::cont::StorageTagVirtual> NewInstance() const
...@@ -133,29 +136,57 @@ public: ...@@ -133,29 +136,57 @@ public:
: ArrayHandle<T, ::vtkm::cont::StorageTagVirtual>(); : ArrayHandle<T, ::vtkm::cont::StorageTagVirtual>();
} }
// Return a ArrayPortalRef that wraps the real virtual portal. We need a stack object for /// Returns a view on the internal storage of the ArrayHandleVirtual
// the following reasons: ///
// 1. Device Adapter algorithms only support const AH<T,S>& and not const AH<T,S>* VTKM_CONT const StorageType* GetStorage() const { return this->Storage.get(); }
// 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 /// Get the array portal of the control array.
// we have to store this information also in the ref wrapper /// Since worklet invocations are asynchronous and this routine is a synchronization point,
vtkm::ArrayPortalRef<T> PrepareForInput(vtkm::cont::DeviceAdapterId devId) const /// exceptions maybe thrown for errors from previously executed worklets.
///
PortalControl GetPortalControl()
{ {
return make_ArrayPortalRef( return make_ArrayPortalRef(
static_cast<const vtkm::ArrayPortalVirtual<T>*>(this->Storage->PrepareForInput(devId)), static_cast<const vtkm::ArrayPortalVirtual<T>*>(this->Storage->GetPortalControl()),
this->GetNumberOfValues()); this->GetNumberOfValues());
} }
vtkm::ArrayPortalRef<T> PrepareForOutput(vtkm::Id numberOfValues, /// Get the array portal of the control array.
vtkm::cont::DeviceAdapterId devId) /// 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>*>( return make_ArrayPortalRef(
this->Storage->PrepareForOutput(numberOfValues, devId)), static_cast<const vtkm::ArrayPortalVirtual<T>*>(this->Storage->GetPortalConstControl()),
numberOfValues); this->GetNumberOfValues());
} }
/// Returns the number of entries in the array.
///
vtkm::Id GetNumberOfValues() const { return this->Storage->GetNumberOfValues(); } 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 /// Releases any resources being used in the execution environment (that are
/// not being shared by the control environment). /// not being shared by the control environment).
/// ///
...@@ -165,30 +196,80 @@ public: ...@@ -165,30 +196,80 @@ public:
/// ///
void ReleaseResources() { return this->Storage->ReleaseResources(); } void ReleaseResources() { return this->Storage->ReleaseResources(); }
/// Get the array portal of the control array. /// Prepares this array to be used as an input to an operation in the
/// Since worklet invocations are asynchronous and this routine is a synchronization point, /// execution environment. If necessary, copies data to the execution
/// exceptions maybe thrown for errors from previously executed worklets. /// 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( return make_ArrayPortalRef(
static_cast<const vtkm::ArrayPortalVirtual<T>*>(this->Storage->GetPortalControl()), static_cast<const vtkm::ArrayPortalVirtual<T>*>(this->Storage->PrepareForInput(devId)),
this->GetNumberOfValues()); this->GetNumberOfValues());
} }
/// Get the array portal of the control array. /// Prepares (allocates) this array to be used as an output from an operation
/// Since worklet invocations are asynchronous and this routine is a synchronization point, /// in the execution environment. The internal state of this class is set to
/// exceptions maybe thrown for errors from previously executed worklets. /// 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( return make_ArrayPortalRef(
static_cast<const vtkm::ArrayPortalVirtual<T>*>(this->Storage->GetPortalConstControl()), static_cast<const vtkm::ArrayPortalVirtual<T>*>(this->Storage->PrepareForInput(devId)),
this->GetNumberOfValues()); 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: protected:
std::shared_ptr<StorageType> Storage = nullptr; 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> template <typename T>
......
This diff is collapsed.
...@@ -25,8 +25,8 @@ ...@@ -25,8 +25,8 @@
#include <vtkm/StaticAssert.h> #include <vtkm/StaticAssert.h>
#include <vtkm/cont/ArrayHandle.h> #include <vtkm/cont/ArrayHandle.h>
#include <vtkm/cont/ArrayHandleVariant.h>
#include <vtkm/cont/DeviceAdapterAlgorithm.h> #include <vtkm/cont/DeviceAdapterAlgorithm.h>
#include <vtkm/cont/DynamicArrayHandle.h>
#include <vtkm/cont/Field.h> #include <vtkm/cont/Field.h>
namespace vtkm namespace vtkm
......
...@@ -27,10 +27,6 @@ namespace vtkm ...@@ -27,10 +27,6 @@ namespace vtkm
namespace cont namespace cont
{ {
using CoordinatesTypeList = vtkm::ListTagBase<vtkm::cont::ArrayHandleVirtualCoordinates::ValueType>;
using CoordinatesStorageList =
vtkm::ListTagBase<vtkm::cont::ArrayHandleVirtualCoordinates::StorageTag>;
VTKM_CONT CoordinateSystem::CoordinateSystem() VTKM_CONT CoordinateSystem::CoordinateSystem()
: Superclass() : Superclass()
{ {
...@@ -38,7 +34,7 @@ VTKM_CONT CoordinateSystem::CoordinateSystem() ...@@ -38,7 +34,7 @@ VTKM_CONT CoordinateSystem::CoordinateSystem()
VTKM_CONT CoordinateSystem::CoordinateSystem( VTKM_CONT CoordinateSystem::CoordinateSystem(
std::string name, std::string name,
const vtkm::cont::ArrayHandleVirtualCoordinates::Superclass& data) const vtkm::cont::ArrayHandleVirtual<vtkm::Vec<vtkm::FloatDefault, 3>>& data)
: Superclass(name, Association::POINTS, data) : Superclass(name, Association::POINTS, data)
{ {
} }
...@@ -64,7 +60,8 @@ vtkm::cont::ArrayHandleVirtualCoordinates CoordinateSystem::GetData() const ...@@ -64,7 +60,8 @@ vtkm::cont::ArrayHandleVirtualCoordinates CoordinateSystem::GetData() const
} }
VTKM_CONT 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); this->Superclass::SetData(newdata);
} }
...@@ -76,26 +73,6 @@ void CoordinateSystem::PrintSummary(std::ostream& out) const ...@@ -76,26 +73,6 @@ void CoordinateSystem::PrintSummary(std::ostream& out) const
this->Superclass::PrintSummary(out); 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( template VTKM_CONT_EXPORT CoordinateSystem::CoordinateSystem(
std::string name, std::string name,
const vtkm::cont::ArrayHandle<vtkm::Vec<float, 3>>&); const vtkm::cont::ArrayHandle<vtkm::Vec<float, 3>>&);
...@@ -141,12 +118,12 @@ template VTKM_CONT_EXPORT CoordinateSystem::CoordinateSystem( ...@@ -141,12 +118,12 @@ template VTKM_CONT_EXPORT CoordinateSystem::CoordinateSystem(
vtkm::cont::ArrayHandle<vtkm::Float64, vtkm::cont::StorageTagBasic>>::StorageTag>&); vtkm::cont::ArrayHandle<vtkm::Float64, vtkm::cont::StorageTagBasic>>::StorageTag>&);
template VTKM_CONT_EXPORT CoordinateSystem::CoordinateSystem(std::string name, template VTKM_CONT_EXPORT CoordinateSystem::CoordinateSystem(std::string name,
const vtkm::cont::DynamicArrayHandle&); const vtkm::cont::ArrayHandleVariant&);
template VTKM_CONT_EXPORT void CoordinateSystem::SetData( template VTKM_CONT_EXPORT void CoordinateSystem::SetData(
const vtkm::cont::ArrayHandle<vtkm::Vec<float, 3>>&); const vtkm::cont::ArrayHandle<vtkm::Vec<float, 3>>&);
template VTKM_CONT_EXPORT void CoordinateSystem::SetData( template VTKM_CONT_EXPORT void CoordinateSystem::SetData(
const vtkm::cont::ArrayHandle<vtkm::Vec<double, 3>>&); 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 } // namespace vtkm::cont
...@@ -33,17 +33,20 @@ namespace cont ...@@ -33,17 +33,20 @@ namespace cont
class VTKM_CONT_EXPORT CoordinateSystem : public vtkm::cont::Field class VTKM_CONT_EXPORT CoordinateSystem : public vtkm::cont::Field
{ {
using Superclass = vtkm::cont::Field; using Superclass = vtkm::cont::Field;
using CoordinatesTypeList =
vtkm::ListTagBase<vtkm::cont::ArrayHandleVirtualCoordinates::ValueType>;
public: public:
VTKM_CONT VTKM_CONT
CoordinateSystem(); CoordinateSystem();
VTKM_CONT CoordinateSystem(std::string name, VTKM_CONT CoordinateSystem(
const vtkm::cont::ArrayHandleVirtualCoordinates::Superclass& data); 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, VTKM_CONT CoordinateSystem(std::string name,
const vtkm::cont::DynamicArrayHandleBase<TypeList, StorageList>& data); const vtkm::cont::ArrayHandleVariantBase<TypeList>& data);
template <typename T, typename Storage> template <typename T, typename Storage>
VTKM_CONT CoordinateSystem(std::string name, const ArrayHandle<T, Storage>& data); VTKM_CONT CoordinateSystem(std::string name, const ArrayHandle<T, Storage>& data);
...@@ -60,23 +63,35 @@ public: ...@@ -60,23 +63,35 @@ public:
VTKM_CONT VTKM_CONT
vtkm::cont::ArrayHandleVirtualCoordinates GetData() const; 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> template <typename T, typename Storage>
VTKM_CONT void SetData(const vtkm::cont::ArrayHandle<T, StorageTag>& newdata); VTKM_CONT void SetData(const vtkm::cont::ArrayHandle<T, Storage>& newdata);
VTKM_CONT VTKM_CONT
template <typename TypeList, typename StorageList> template <typename TypeList>
void SetData(const vtkm::cont::DynamicArrayHandleBase<TypeList, StorageList>& newdata); void SetData(const vtkm::cont::ArrayHandleVariantBase<TypeList>& newdata);
VTKM_CONT VTKM_CONT
void GetRange(vtkm::Range* range) const; void GetRange(vtkm::Range* range) const
{
this->Superclass::GetRange(range, CoordinatesTypeList());
}
VTKM_CONT 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_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; virtual void PrintSummary(std::ostream& out) const override;
......
...@@ -48,22 +48,22 @@ struct MakeArrayHandleVirtualCoordinatesFunctor ...@@ -48,22 +48,22 @@ struct MakeArrayHandleVirtualCoordinatesFunctor
} }
}; };
template <typename TypeList, typename StorageList> template <typename TypeList>
VTKM_CONT vtkm::cont::ArrayHandleVirtualCoordinates MakeArrayHandleVirtualCoordinates( 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::ArrayHandleVirtualCoordinates output;
vtkm::cont::CastAndCall(array.ResetTypeList(vtkm::TypeListTagFieldVec3{}), vtkm::cont::CastAndCall(array.ResetTypes(vtkm::TypeListTagFieldVec3{}),
MakeArrayHandleVirtualCoordinatesFunctor{}, MakeArrayHandleVirtualCoordinatesFunctor{},
output); output);
return output; return output;
} }
} // namespace detail } // namespace detail
template <typename TypeList, typename StorageList> template <typename TypeList>
VTKM_CONT CoordinateSystem::CoordinateSystem( VTKM_CONT CoordinateSystem::CoordinateSystem(
std::string name, std::string name,
const vtkm::cont::DynamicArrayHandleBase<TypeList, StorageList>& data) const vtkm::cont::ArrayHandleVariantBase<TypeList>& data)
: Superclass(name, Association::POINTS, detail::MakeArrayHandleVirtualCoordinates(data)) : Superclass(name, Association::POINTS, detail::MakeArrayHandleVirtualCoordinates(data))
{ {
} }
...@@ -81,9 +81,9 @@ VTKM_CONT void CoordinateSystem::SetData(const vtkm::cont::ArrayHandle<T, Storag ...@@ -81,9 +81,9 @@ VTKM_CONT void CoordinateSystem::SetData(const vtkm::cont::ArrayHandle<T, Storag
this->SetData(vtkm::cont::ArrayHandleVirtualCoordinates(newdata)); this->SetData(vtkm::cont::ArrayHandleVirtualCoordinates(newdata));
} }
template <typename TypeList, typename StorageList> template <typename TypeList>
VTKM_CONT void CoordinateSystem::SetData( VTKM_CONT void CoordinateSystem::SetData(
const vtkm::cont::DynamicArrayHandleBase<TypeList, StorageList>& newdata) const vtkm::cont::ArrayHandleVariantBase<TypeList>& newdata)
{ {
this->SetData(detail::MakeArrayHandleVirtualCoordinates(newdata)); this->SetData(detail::MakeArrayHandleVirtualCoordinates(newdata));
} }
......
...@@ -23,9 +23,9 @@ ...@@ -23,9 +23,9 @@
#include <vtkm/cont/vtkm_cont_export.h> #include <vtkm/cont/vtkm_cont_export.h>
#include <vtkm/cont/ArrayHandle.h> #include <vtkm/cont/ArrayHandle.h>
#include <vtkm/cont/ArrayHandleVariant.h>
#include <vtkm/cont/CoordinateSystem.h> #include <vtkm/cont/CoordinateSystem.h>
#include <vtkm/cont/DeviceAdapterAlgorithm.h> #include <vtkm/cont/DeviceAdapterAlgorithm.h>
#include <vtkm/cont/DynamicArrayHandle.h>
#include <vtkm/cont/DynamicCellSet.h> #include <vtkm/cont/DynamicCellSet.h>
#include <vtkm/cont/ErrorBadValue.h> #include <vtkm/cont/ErrorBadValue.h>
#include <vtkm/cont/Field.h> #include <vtkm/cont/Field.h>
...@@ -193,7 +193,6 @@ namespace cont ...@@ -193,7 +193,6 @@ namespace cont
{ {
template <typename FieldTypeList = VTKM_DEFAULT_TYPE_LIST_TAG, template <typename FieldTypeList = VTKM_DEFAULT_TYPE_LIST_TAG,
typename FieldStorageList = VTKM_DEFAULT_STORAGE_LIST_TAG,
typename CellSetTypesList = VTKM_DEFAULT_CELL_SET_LIST_TAG> typename CellSetTypesList = VTKM_DEFAULT_CELL_SET_LIST_TAG>
struct SerializableDataSet struct SerializableDataSet
{ {
...@@ -212,12 +211,11 @@ struct SerializableDataSet ...@@ -212,12 +211,11 @@ struct SerializableDataSet
namespace diy namespace diy
{ {
template <typename FieldTypeList, typename FieldStorageList, typename CellSetTypesList> template <typename FieldTypeList, typename CellSetTypesList>
struct Serialization< struct Serialization<vtkm::cont::SerializableDataSet<FieldTypeList, CellSetTypesList>>
vtkm::cont::SerializableDataSet<FieldTypeList, FieldStorageList, CellSetTypesList>>
{ {
private: private:
using Type = vtkm::cont::SerializableDataSet<FieldTypeList, FieldStorageList, CellSetTypesList>; using Type = vtkm::cont::SerializableDataSet<FieldTypeList, CellSetTypesList>;
public: public:
static VTKM_CONT void save(BinaryBuffer& bb, const Type& serializable) static VTKM_CONT void save(BinaryBuffer& bb, const Type& serializable)
...@@ -242,8 +240,7 @@ public: ...@@ -242,8 +240,7 @@ public:
diy::save(bb, numberOfFields); diy::save(bb, numberOfFields);
for (vtkm::IdComponent i = 0; i < numberOfFields; ++i) for (vtkm::IdComponent i = 0; i < numberOfFields; ++i)
{ {
diy::save( diy::save(bb, vtkm::cont::SerializableField<FieldTypeList>(dataset.GetField(i)));
bb, vtkm::cont::SerializableField<FieldTypeList, FieldStorageList>(dataset.GetField(i)));
} }
} }
...@@ -274,7 +271,7 @@ public: ...@@ -274,7 +271,7 @@ public:
diy::load(bb, numberOfFields); diy::load(bb, numberOfFields);
for (vtkm::IdComponent i = 0; i < numberOfFields; ++i) for (vtkm::IdComponent i = 0; i < numberOfFields; ++i)
{ {
vtkm::cont::SerializableField<FieldTypeList, FieldStorageList> field; vtkm::cont::SerializableField<FieldTypeList> field;
diy::load(bb, field); diy::load(bb, field);
dataset.AddField(field.Field); dataset.AddField(field.Field);
} }
......
...@@ -38,7 +38,7 @@ public: ...@@ -38,7 +38,7 @@ public:
VTKM_CONT VTKM_CONT
static void AddPointField(vtkm::cont::DataSet& dataSet, static void AddPointField(vtkm::cont::DataSet& dataSet,
const std::string& fieldName, const std::string& fieldName,
const vtkm::cont::DynamicArrayHandle& field) const vtkm::cont::ArrayHandleVariant& field)
{ {
dataSet.AddField(Field(fieldName, vtkm::cont::Field::Association::POINTS, field)); dataSet.AddField(Field(fieldName, vtkm::cont::Field::Association::POINTS, field));
} }
...@@ -74,7 +74,7 @@ public: ...@@ -74,7 +74,7 @@ public: