Commit 9ca4d36e authored by Robert Maynard's avatar Robert Maynard

Update benchmarking to work with ArrayHandleVariant

parent f63be1ab
......@@ -22,8 +22,8 @@
#include <vtkm/VectorAnalysis.h>
#include <vtkm/cont/ArrayHandle.h>
#include <vtkm/cont/ArrayHandleVariant.h>
#include <vtkm/cont/CellSetStructured.h>
#include <vtkm/cont/DynamicArrayHandle.h>
#include <vtkm/cont/ImplicitFunctionHandle.h>
#include <vtkm/cont/Timer.h>
......@@ -309,7 +309,6 @@ struct ValueTypes : vtkm::ListTagBase<vtkm::Float32, vtkm::Float64>
struct InterpValueTypes : vtkm::ListTagBase<vtkm::Float32, vtkm::Vec<vtkm::Float32, 3>>
{
};
using StorageListTag = ::vtkm::cont::StorageListTagBasic;
/// This class runs a series of micro-benchmarks to measure
/// performance of different field operations
......@@ -318,14 +317,11 @@ class BenchmarkFieldAlgorithms
{
using StorageTag = vtkm::cont::StorageTagBasic;
using Algorithm = vtkm::cont::DeviceAdapterAlgorithm<DeviceAdapterTag>;
using Timer = vtkm::cont::Timer<DeviceAdapterTag>;
using ValueDynamicHandle = vtkm::cont::DynamicArrayHandleBase<ValueTypes, StorageListTag>;
using InterpDynamicHandle = vtkm::cont::DynamicArrayHandleBase<InterpValueTypes, StorageListTag>;
using IdDynamicHandle =
vtkm::cont::DynamicArrayHandleBase<vtkm::TypeListTagIndex, StorageListTag>;
using ValueVariantHandle = vtkm::cont::ArrayHandleVariantBase<ValueTypes>;
using InterpVariantHandle = vtkm::cont::ArrayHandleVariantBase<InterpValueTypes>;
using IdVariantHandle = vtkm::cont::ArrayHandleVariantBase<vtkm::TypeListTagIndex>;
private:
template <typename Value>
......@@ -402,9 +398,9 @@ private:
VTKM_CONT
vtkm::Float64 operator()()
{
ValueDynamicHandle dstocks(this->StockPrice);
ValueDynamicHandle dstrikes(this->OptionStrike);
ValueDynamicHandle doptions(this->OptionYears);
ValueVariantHandle dstocks(this->StockPrice);
ValueVariantHandle dstrikes(this->OptionStrike);
ValueVariantHandle doptions(this->OptionYears);
vtkm::cont::ArrayHandle<Value> callResultHandle, putResultHandle;
const Value RISKFREE = 0.02f;
......@@ -488,9 +484,9 @@ private:
vtkm::cont::ArrayHandle<Value> temp1;
vtkm::cont::ArrayHandle<Value> temp2;
vtkm::cont::DynamicArrayHandleBase<MathTypes, StorageListTag> dinput(this->InputHandle);
ValueDynamicHandle dtemp1(temp1);
ValueDynamicHandle dtemp2(temp2);
vtkm::cont::ArrayHandleVariantBase<MathTypes> dinput(this->InputHandle);
ValueVariantHandle dtemp1(temp1);
ValueVariantHandle dtemp2(temp2);
Timer timer;
......@@ -564,7 +560,7 @@ private:
{
using MathTypes = vtkm::ListTagBase<vtkm::Vec<vtkm::Float32, 3>, vtkm::Vec<vtkm::Float64, 3>>;
vtkm::cont::DynamicArrayHandleBase<MathTypes, StorageListTag> dinput(this->InputHandle);
vtkm::cont::ArrayHandleVariantBase<MathTypes> dinput(this->InputHandle);
vtkm::cont::ArrayHandle<Value, StorageTag> result;
......@@ -666,9 +662,9 @@ private:
VTKM_CONT
vtkm::Float64 operator()()
{
InterpDynamicHandle dfield(this->FieldHandle);
InterpDynamicHandle dweight(this->WeightHandle);
IdDynamicHandle dedges(this->EdgePairHandle);
InterpVariantHandle dfield(this->FieldHandle);
InterpVariantHandle dweight(this->WeightHandle);
IdVariantHandle dedges(this->EdgePairHandle);
vtkm::cont::ArrayHandle<Value> result;
Timer timer;
......
......@@ -147,8 +147,6 @@ using FieldTypes = vtkm::ListTagBase<vtkm::Float32,
vtkm::Vec<vtkm::Float32, 3>,
vtkm::Vec<vtkm::Float64, 3>>;
using FieldStorage = vtkm::ListTagBase<vtkm::cont::StorageTagBasic>;
using StructuredCellList = vtkm::ListTagBase<vtkm::cont::CellSetStructured<3>>;
using UnstructuredCellList =
......@@ -158,26 +156,16 @@ using AllCellList = vtkm::ListTagJoin<StructuredCellList, UnstructuredCellList>;
using CoordinateList = vtkm::ListTagBase<vtkm::Vec<vtkm::Float32, 3>, vtkm::Vec<vtkm::Float64, 3>>;
using CoordinateStorage =
vtkm::ListTagBase<vtkm::cont::ArrayHandleUniformPointCoordinates::StorageTag,
vtkm::cont::StorageTagBasic>;
using DeviceAdapters = vtkm::ListTagBase<Device>;
class BenchmarkFilterPolicy : public vtkm::filter::PolicyBase<BenchmarkFilterPolicy>
{
public:
using FieldTypeList = FieldTypes;
using FieldStorageList = FieldStorage;
using StructuredCellSetList = StructuredCellList;
using UnstructuredCellSetList = UnstructuredCellList;
using AllCellSetList = AllCellList;
using CoordinateTypeList = CoordinateList;
using CoordinateStorageList = CoordinateStorage;
using DeviceAdapterList = DeviceAdapters;
};
// Class implementing all filter benchmarks:
......@@ -852,7 +840,7 @@ public:
}
};
// Get the number of components in a DynamicArrayHandle, ArrayHandle, or Field's
// Get the number of components in a ArrayHandleVariant, ArrayHandle, or Field's
// ValueType.
struct NumberOfComponents
{
......
......@@ -136,7 +136,6 @@ struct ValueTypes
: vtkm::ListTagBase<vtkm::UInt32, vtkm::Int32, vtkm::Int64, vtkm::Float32, vtkm::Float64>
{
};
using StorageListTag = ::vtkm::cont::StorageListTagBasic;
/// This class runs a series of micro-benchmarks to measure
/// performance of different field operations
......@@ -145,11 +144,9 @@ class BenchmarkTopologyAlgorithms
{
using StorageTag = vtkm::cont::StorageTagBasic;
using Algorithm = vtkm::cont::DeviceAdapterAlgorithm<DeviceAdapterTag>;
using Timer = vtkm::cont::Timer<DeviceAdapterTag>;
using ValueDynamicHandle = vtkm::cont::DynamicArrayHandleBase<ValueTypes, StorageListTag>;
using ValueVariantHandle = vtkm::cont::ArrayHandleVariantBase<ValueTypes>;
private:
template <typename T, typename Enable = void>
......@@ -245,7 +242,7 @@ private:
vtkm::cont::CellSetStructured<3> cellSet;
cellSet.SetPointDimensions(vtkm::Id3(CUBE_SIZE, CUBE_SIZE, CUBE_SIZE));
ValueDynamicHandle dinput(this->InputHandle);
ValueVariantHandle dinput(this->InputHandle);
vtkm::cont::ArrayHandle<Value, StorageTag> result;
Timer timer;
......@@ -324,7 +321,7 @@ private:
vtkm::cont::CellSetStructured<3> cellSet;
cellSet.SetPointDimensions(vtkm::Id3(CUBE_SIZE, CUBE_SIZE, CUBE_SIZE));
ValueDynamicHandle dinput(this->InputHandle);
ValueVariantHandle dinput(this->InputHandle);
vtkm::cont::ArrayHandle<Value, StorageTag> result;
Timer timer;
......@@ -372,7 +369,7 @@ private:
cellSet.SetPointDimensions(vtkm::Id3(CUBE_SIZE, CUBE_SIZE, CUBE_SIZE));
vtkm::cont::ArrayHandle<vtkm::IdComponent, StorageTag> result;
ValueDynamicHandle dinput(this->InputHandle);
ValueVariantHandle dinput(this->InputHandle);
Timer timer;
......
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