mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-16 17:22:55 +00:00
Merge branch 'master' of https://gitlab.kitware.com/vtk/vtk-m into pics_unittests
This commit is contained in:
commit
533380e705
@ -29,8 +29,8 @@ std::string fieldName = "pointvar";
|
||||
// Create an isosurface filter
|
||||
vtkm::filter::MarchingCubes filter;
|
||||
filter.SetIsoValue(0, isovalue);
|
||||
vtkm::filter::ResultDataSet result = filter.Execute( inputData,
|
||||
inputData.GetField(fieldName) );
|
||||
vtkm::filter::Result result = filter.Execute( inputData,
|
||||
inputData.GetField(fieldName) );
|
||||
filter.MapFieldOntoOutput(result, inputData.GetField(fieldName));
|
||||
|
||||
// compute the bounds and extends of the input data
|
||||
|
@ -32,7 +32,7 @@
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
|
||||
typedef vtkm::Vec<vtkm::Float32, 3> FloatVec3;
|
||||
using FloatVec3 = vtkm::Vec<vtkm::Float32, 3>;
|
||||
|
||||
namespace
|
||||
{
|
||||
@ -79,7 +79,7 @@ int main(int argc, char* argv[])
|
||||
return 1;
|
||||
}
|
||||
|
||||
typedef VTKM_DEFAULT_DEVICE_ADAPTER_TAG DeviceAdapter;
|
||||
using DeviceAdapter = VTKM_DEFAULT_DEVICE_ADAPTER_TAG;
|
||||
std::cout << "Device Adapter Name: " << vtkm::cont::DeviceAdapterTraits<DeviceAdapter>::GetName()
|
||||
<< std::endl;
|
||||
|
||||
|
@ -116,7 +116,7 @@ int main(int argc, char* argv[])
|
||||
dsf.AddPointField(inDataSet, "values", values);
|
||||
|
||||
// Output data set is pairs of saddle and peak vertex IDs
|
||||
vtkm::filter::ResultField result;
|
||||
vtkm::filter::Result result;
|
||||
|
||||
// Convert 2D mesh of values into contour tree, pairs of vertex ids
|
||||
vtkm::filter::ContourTreeMesh2D filter;
|
||||
|
@ -117,7 +117,7 @@ int main(int argc, char* argv[])
|
||||
dsf.AddPointField(inDataSet, "values", values);
|
||||
|
||||
// Output data set is pairs of saddle and peak vertex IDs
|
||||
vtkm::filter::ResultField result;
|
||||
vtkm::filter::Result result;
|
||||
|
||||
// Convert 3D mesh of values into contour tree, pairs of vertex ids
|
||||
vtkm::filter::ContourTreeMesh3D filter;
|
||||
|
@ -21,4 +21,4 @@
|
||||
//Define the CUDA device adapter as being the default
|
||||
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_CUDA
|
||||
|
||||
#include "Demo.cxx"
|
||||
#include "Demo.cxx"
|
||||
|
@ -76,8 +76,8 @@ int main(int argc, char* argv[])
|
||||
fieldName = "SCALARS:pointvar";
|
||||
}
|
||||
|
||||
typedef vtkm::rendering::MapperRayTracer Mapper;
|
||||
typedef vtkm::rendering::CanvasRayTracer Canvas;
|
||||
using Mapper = vtkm::rendering::MapperRayTracer;
|
||||
using Canvas = vtkm::rendering::CanvasRayTracer;
|
||||
|
||||
// Set up a camera for rendering the input data
|
||||
const vtkm::cont::CoordinateSystem coords = inputData.GetCoordinateSystem();
|
||||
@ -119,7 +119,7 @@ int main(int argc, char* argv[])
|
||||
filter.SetGenerateNormals(false);
|
||||
filter.SetMergeDuplicatePoints(false);
|
||||
filter.SetIsoValue(0, isovalue);
|
||||
vtkm::filter::ResultDataSet result = filter.Execute(inputData, inputData.GetField(fieldName));
|
||||
vtkm::filter::Result result = filter.Execute(inputData, inputData.GetField(fieldName));
|
||||
filter.MapFieldOntoOutput(result, inputData.GetField(fieldName));
|
||||
vtkm::cont::DataSet& outputData = result.GetDataSet();
|
||||
// Render a separate image with the output isosurface
|
||||
|
@ -20,4 +20,4 @@
|
||||
|
||||
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_CUDA
|
||||
|
||||
#include "HelloWorld.cxx"
|
||||
#include "HelloWorld.cxx"
|
||||
|
@ -162,7 +162,7 @@ struct HelloVTKMInterop
|
||||
|
||||
void renderFrame()
|
||||
{
|
||||
typedef vtkm::worklet::DispatcherMapField<GenerateSurfaceWorklet> DispatcherType;
|
||||
using DispatcherType = vtkm::worklet::DispatcherMapField<GenerateSurfaceWorklet>;
|
||||
|
||||
vtkm::Float32 t = static_cast<vtkm::Float32>(this->Timer.GetElapsedTime());
|
||||
|
||||
@ -181,7 +181,7 @@ struct HelloVTKMInterop
|
||||
};
|
||||
|
||||
//global static so that glut callback can access it
|
||||
typedef VTKM_DEFAULT_DEVICE_ADAPTER_TAG DeviceAdapter;
|
||||
using DeviceAdapter = VTKM_DEFAULT_DEVICE_ADAPTER_TAG;
|
||||
HelloVTKMInterop<DeviceAdapter, vtkm::Float32>* helloWorld = nullptr;
|
||||
|
||||
// Render the output using simple OpenGL
|
||||
@ -198,7 +198,7 @@ void idle()
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
typedef vtkm::cont::DeviceAdapterTraits<DeviceAdapter> DeviceAdapterTraits;
|
||||
using DeviceAdapterTraits = vtkm::cont::DeviceAdapterTraits<DeviceAdapter>;
|
||||
std::cout << "Running Hello World example on device adapter: " << DeviceAdapterTraits::GetName()
|
||||
<< std::endl;
|
||||
|
||||
|
@ -20,4 +20,4 @@
|
||||
|
||||
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_TBB
|
||||
|
||||
#include "HelloWorld.cxx"
|
||||
#include "HelloWorld.cxx"
|
||||
|
@ -20,4 +20,4 @@
|
||||
|
||||
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_CUDA
|
||||
|
||||
#include "IsosurfaceUniformGrid.cxx"
|
||||
#include "IsosurfaceUniformGrid.cxx"
|
||||
|
@ -64,7 +64,7 @@ class TangleField : public vtkm::worklet::WorkletMapField
|
||||
public:
|
||||
typedef void ControlSignature(FieldIn<IdType> vertexId, FieldOut<Scalar> v);
|
||||
typedef void ExecutionSignature(_1, _2);
|
||||
typedef _1 InputDomain;
|
||||
using InputDomain = _1;
|
||||
|
||||
const vtkm::Id xdim, ydim, zdim;
|
||||
const vtkm::Float32 xmin, ymin, zmin, xmax, ymax, zmax;
|
||||
@ -246,14 +246,14 @@ int main(int argc, char* argv[])
|
||||
filter.SetGenerateNormals(true);
|
||||
filter.SetMergeDuplicatePoints(false);
|
||||
filter.SetIsoValue(0, 0.5);
|
||||
vtkm::filter::ResultDataSet result = filter.Execute(dataSet, dataSet.GetField("nodevar"));
|
||||
vtkm::filter::Result result = filter.Execute(dataSet, dataSet.GetField("nodevar"));
|
||||
|
||||
filter.MapFieldOntoOutput(result, dataSet.GetField("nodevar"));
|
||||
|
||||
//need to extract vertices, normals, and scalars
|
||||
vtkm::cont::DataSet& outputData = result.GetDataSet();
|
||||
|
||||
typedef vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::Float32, 3>> VertType;
|
||||
using VertType = vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::Float32, 3>>;
|
||||
vtkm::cont::CoordinateSystem coords = outputData.GetCoordinateSystem();
|
||||
|
||||
verticesArray = coords.GetData().Cast<VertType>();
|
||||
|
@ -20,4 +20,4 @@
|
||||
|
||||
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_TBB
|
||||
|
||||
#include "IsosurfaceUniformGrid.cxx"
|
||||
#include "IsosurfaceUniformGrid.cxx"
|
||||
|
@ -20,4 +20,4 @@
|
||||
|
||||
//This file merely exists so that we can simplify the logic for invoking
|
||||
//nvcc telling that cuda code exists.
|
||||
#include "MultiBackend.cxx"
|
||||
#include "MultiBackend.cxx"
|
||||
|
@ -31,8 +31,8 @@
|
||||
#include <vtkm/cont/serial/DeviceAdapterSerial.h>
|
||||
#include <vtkm/cont/tbb/DeviceAdapterTBB.h>
|
||||
|
||||
typedef vtkm::Vec<vtkm::Float32, 3> FloatVec3;
|
||||
typedef vtkm::Vec<vtkm::UInt8, 4> Uint8Vec4;
|
||||
using FloatVec3 = vtkm::Vec<vtkm::Float32, 3>;
|
||||
using Uint8Vec4 = vtkm::Vec<vtkm::UInt8, 4>;
|
||||
|
||||
struct GenerateSurfaceWorklet : public vtkm::worklet::WorkletMapField
|
||||
{
|
||||
@ -67,10 +67,10 @@ struct RunGenerateSurfaceWorklet
|
||||
bool operator()(DeviceAdapterTag) const
|
||||
{
|
||||
//At this point we know we have runtime support
|
||||
typedef vtkm::cont::DeviceAdapterTraits<DeviceAdapterTag> DeviceTraits;
|
||||
using DeviceTraits = vtkm::cont::DeviceAdapterTraits<DeviceAdapterTag>;
|
||||
|
||||
typedef vtkm::worklet::DispatcherMapField<GenerateSurfaceWorklet, DeviceAdapterTag>
|
||||
DispatcherType;
|
||||
using DispatcherType =
|
||||
vtkm::worklet::DispatcherMapField<GenerateSurfaceWorklet, DeviceAdapterTag>;
|
||||
|
||||
std::cout << "Running a worklet on device adapter: " << DeviceTraits::GetName() << std::endl;
|
||||
|
||||
|
@ -48,7 +48,7 @@
|
||||
|
||||
#include "../isosurface/quaternion.h"
|
||||
|
||||
typedef VTKM_DEFAULT_DEVICE_ADAPTER_TAG DeviceAdapter;
|
||||
using DeviceAdapter = VTKM_DEFAULT_DEVICE_ADAPTER_TAG;
|
||||
|
||||
// Output data set shared with opengl
|
||||
static vtkm::worklet::StreamLineFilterUniformGrid<vtkm::Float32, DeviceAdapter>* streamLineFilter;
|
||||
|
@ -44,7 +44,7 @@
|
||||
|
||||
#include "../isosurface/quaternion.h"
|
||||
|
||||
typedef VTKM_DEFAULT_DEVICE_ADAPTER_TAG DeviceAdapter;
|
||||
using DeviceAdapter = VTKM_DEFAULT_DEVICE_ADAPTER_TAG;
|
||||
|
||||
namespace
|
||||
{
|
||||
@ -302,7 +302,7 @@ int main(int argc, char* argv[])
|
||||
|
||||
// Convert cells to tetrahedra
|
||||
vtkm::filter::Tetrahedralize tetrahedralize;
|
||||
vtkm::filter::ResultDataSet result = tetrahedralize.Execute(inDataSet);
|
||||
vtkm::filter::Result result = tetrahedralize.Execute(inDataSet);
|
||||
|
||||
outDataSet = result.GetDataSet();
|
||||
|
||||
|
@ -43,7 +43,7 @@
|
||||
|
||||
#include "../isosurface/quaternion.h"
|
||||
|
||||
typedef VTKM_DEFAULT_DEVICE_ADAPTER_TAG DeviceAdapter;
|
||||
using DeviceAdapter = VTKM_DEFAULT_DEVICE_ADAPTER_TAG;
|
||||
|
||||
// Default size of the example
|
||||
static vtkm::Id3 dims(4, 4, 4);
|
||||
@ -284,7 +284,7 @@ int main(int argc, char* argv[])
|
||||
vtkm::cont::DataSet inDataSet = MakeTetrahedralizeTestDataSet(dims);
|
||||
|
||||
vtkm::filter::Tetrahedralize tetrahedralize;
|
||||
vtkm::filter::ResultDataSet result = tetrahedralize.Execute(inDataSet);
|
||||
vtkm::filter::Result result = tetrahedralize.Execute(inDataSet);
|
||||
|
||||
tetDataSet = result.GetDataSet();
|
||||
|
||||
|
@ -41,7 +41,7 @@
|
||||
#include <GL/glut.h>
|
||||
#endif
|
||||
|
||||
typedef VTKM_DEFAULT_DEVICE_ADAPTER_TAG DeviceAdapter;
|
||||
using DeviceAdapter = VTKM_DEFAULT_DEVICE_ADAPTER_TAG;
|
||||
|
||||
namespace
|
||||
{
|
||||
@ -222,7 +222,7 @@ int main(int argc, char* argv[])
|
||||
|
||||
// Convert 2D explicit cells to triangles
|
||||
vtkm::filter::Triangulate triangulate;
|
||||
vtkm::filter::ResultDataSet result = triangulate.Execute(inDataSet);
|
||||
vtkm::filter::Result result = triangulate.Execute(inDataSet);
|
||||
outDataSet = result.GetDataSet();
|
||||
|
||||
// Render the output dataset of tets
|
||||
|
@ -41,7 +41,7 @@
|
||||
#include <GL/glut.h>
|
||||
#endif
|
||||
|
||||
typedef VTKM_DEFAULT_DEVICE_ADAPTER_TAG DeviceAdapter;
|
||||
using DeviceAdapter = VTKM_DEFAULT_DEVICE_ADAPTER_TAG;
|
||||
|
||||
// Default size of the example
|
||||
static vtkm::Id2 dims(4, 4);
|
||||
@ -189,7 +189,7 @@ int main(int argc, char* argv[])
|
||||
|
||||
// Convert uniform quad to triangle
|
||||
vtkm::filter::Triangulate triangulate;
|
||||
vtkm::filter::ResultDataSet result = triangulate.Execute(inDataSet);
|
||||
vtkm::filter::Result result = triangulate.Execute(inDataSet);
|
||||
|
||||
triDataSet = result.GetDataSet();
|
||||
|
||||
|
@ -41,7 +41,7 @@ class TangleField : public vtkm::worklet::WorkletMapField
|
||||
public:
|
||||
typedef void ControlSignature(FieldIn<IdType> vertexId, FieldOut<Scalar> v);
|
||||
typedef void ExecutionSignature(_1, _2);
|
||||
typedef _1 InputDomain;
|
||||
using InputDomain = _1;
|
||||
|
||||
const vtkm::Id xdim, ydim, zdim;
|
||||
const vtkm::Float32 xmin, ymin, zmin, xmax, ymax, zmax;
|
||||
@ -151,7 +151,7 @@ int main(int argc, char* argv[])
|
||||
data[i] = i;
|
||||
input = vtkm::cont::make_ArrayHandle(data);
|
||||
|
||||
typedef vtkm::cont::DeviceAdapterAlgorithm<VTKM_DEFAULT_DEVICE_ADAPTER_TAG> DeviceAlgorithms;
|
||||
using DeviceAlgorithms = vtkm::cont::DeviceAdapterAlgorithm<VTKM_DEFAULT_DEVICE_ADAPTER_TAG>;
|
||||
vtkm::worklet::SineWorklet sineWorklet;
|
||||
|
||||
bool usingManagedMemory = vtkm::cont::cuda::internal::CudaAllocator::UsingManagedMemory();
|
||||
@ -202,14 +202,14 @@ int main(int argc, char* argv[])
|
||||
filter.SetGenerateNormals(true);
|
||||
filter.SetMergeDuplicatePoints(false);
|
||||
filter.SetIsoValue(0.5);
|
||||
vtkm::filter::ResultDataSet result = filter.Execute(dataSet, dataSet.GetField("nodevar"));
|
||||
vtkm::filter::Result result = filter.Execute(dataSet, dataSet.GetField("nodevar"));
|
||||
|
||||
filter.MapFieldOntoOutput(result, dataSet.GetField("nodevar"));
|
||||
|
||||
//need to extract vertices, normals, and scalars
|
||||
vtkm::cont::DataSet& outputData = result.GetDataSet();
|
||||
|
||||
typedef vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::Float32, 3>> VertType;
|
||||
using VertType = vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::Float32, 3>>;
|
||||
vtkm::cont::CoordinateSystem coords = outputData.GetCoordinateSystem();
|
||||
|
||||
verticesArray = coords.GetData().Cast<VertType>();
|
||||
|
@ -39,7 +39,7 @@
|
||||
#if !defined(NDEBUG)
|
||||
#define VTKM_ASSERT(condition) assert(condition)
|
||||
#else
|
||||
#define VTKM_ASSERT(condition)
|
||||
#define VTKM_ASSERT(condition) (void)(condition)
|
||||
#endif
|
||||
|
||||
#endif //vtk_m_Assert_h
|
||||
|
@ -1,389 +0,0 @@
|
||||
//=============================================================================
|
||||
//
|
||||
// Copyright (c) Kitware, Inc.
|
||||
// All rights reserved.
|
||||
// See LICENSE.txt for details.
|
||||
//
|
||||
// This software is distributed WITHOUT ANY WARRANTY; without even
|
||||
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
// PURPOSE. See the above copyright notice for more information.
|
||||
//
|
||||
// Copyright 2015 Sandia Corporation.
|
||||
// Copyright 2015 UT-Battelle, LLC.
|
||||
// Copyright 2015 Los Alamos National Security.
|
||||
//
|
||||
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
|
||||
// the U.S. Government retains certain rights in this software.
|
||||
// Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National
|
||||
// Laboratory (LANL), the U.S. Government retains certain rights in
|
||||
// this software.
|
||||
//
|
||||
//=============================================================================
|
||||
#ifndef vtk_m_cont_cuda_ArrayHandleCuda_h
|
||||
#define vtk_m_cont_cuda_ArrayHandleCuda_h
|
||||
|
||||
#include <vtkm/cont/ArrayHandle.h>
|
||||
#include <vtkm/cont/ErrorBadAllocation.h>
|
||||
#include <vtkm/cont/ErrorBadType.h>
|
||||
#include <vtkm/cont/Storage.h>
|
||||
|
||||
#ifdef VTKM_CUDA
|
||||
#include <vtkm/cont/cuda/internal/ArrayManagerExecutionThrustDevice.h>
|
||||
#endif
|
||||
|
||||
VTKM_THIRDPARTY_PRE_INCLUDE
|
||||
#include <thrust/system/cuda/memory.h>
|
||||
VTKM_THIRDPARTY_POST_INCLUDE
|
||||
|
||||
namespace vtkm
|
||||
{
|
||||
namespace cont
|
||||
{
|
||||
namespace cuda
|
||||
{
|
||||
|
||||
struct VTKM_ALWAYS_EXPORT StorageTagCuda
|
||||
{
|
||||
};
|
||||
|
||||
} // namespace cuda
|
||||
} // namespace cont
|
||||
} // namespace vtkm
|
||||
|
||||
namespace vtkm
|
||||
{
|
||||
namespace cont
|
||||
{
|
||||
namespace cuda
|
||||
{
|
||||
namespace internal
|
||||
{
|
||||
|
||||
/// \brief An array portal for cuda arrays.
|
||||
///
|
||||
template <typename T>
|
||||
class ArrayPortalCuda
|
||||
{
|
||||
public:
|
||||
typedef T ValueType;
|
||||
typedef thrust::system::cuda::pointer<ValueType> DevicePointer;
|
||||
|
||||
VTKM_CONT
|
||||
ArrayPortalCuda()
|
||||
: Data()
|
||||
, NumberOfValues(0)
|
||||
{
|
||||
}
|
||||
|
||||
VTKM_CONT
|
||||
ArrayPortalCuda(ValueType* d, vtkm::Id numberOfValues)
|
||||
: Data(d)
|
||||
, NumberOfValues(numberOfValues)
|
||||
{
|
||||
}
|
||||
|
||||
VTKM_CONT
|
||||
ArrayPortalCuda(const DevicePointer& ptr, vtkm::Id numberOfValues)
|
||||
: Data(ptr)
|
||||
, NumberOfValues(numberOfValues)
|
||||
{
|
||||
}
|
||||
|
||||
VTKM_CONT
|
||||
vtkm::Id GetNumberOfValues() const { return NumberOfValues; }
|
||||
|
||||
VTKM_CONT
|
||||
ValueType Get(vtkm::Id index) const
|
||||
{
|
||||
throw vtkm::cont::ErrorBadType("ArrayHandleCuda only provides access to the device pointer.");
|
||||
}
|
||||
|
||||
VTKM_CONT
|
||||
void Set(vtkm::Id vtkmNotUsed(index), T vtkmNotUsed(value)) const
|
||||
{
|
||||
throw vtkm::cont::ErrorBadType("ArrayHandleCuda only provides access to the device pointer.");
|
||||
}
|
||||
|
||||
VTKM_CONT
|
||||
DevicePointer GetDevicePointer() const { return Data; }
|
||||
private:
|
||||
DevicePointer Data;
|
||||
vtkm::Id NumberOfValues;
|
||||
};
|
||||
|
||||
} // namespace internal
|
||||
} // namespace cuda
|
||||
} // namespace cont
|
||||
} // namespace vtkm
|
||||
|
||||
namespace vtkm
|
||||
{
|
||||
namespace cont
|
||||
{
|
||||
namespace internal
|
||||
{
|
||||
|
||||
template <typename T>
|
||||
class Storage<T, vtkm::cont::cuda::StorageTagCuda>
|
||||
{
|
||||
public:
|
||||
typedef T ValueType;
|
||||
typedef thrust::system::cuda::pointer<ValueType> DevicePointer;
|
||||
typedef vtkm::cont::cuda::internal::ArrayPortalCuda<ValueType> PortalType;
|
||||
typedef vtkm::cont::cuda::internal::ArrayPortalCuda<ValueType> PortalConstType;
|
||||
|
||||
VTKM_CONT
|
||||
Storage()
|
||||
: Data()
|
||||
, NumberOfValues(0)
|
||||
, IsOwner(true)
|
||||
{
|
||||
}
|
||||
VTKM_CONT
|
||||
Storage(ValueType* d, vtkm::Id numberOfValues)
|
||||
: Data(d)
|
||||
, NumberOfValues(numberOfValues)
|
||||
, IsOwner(false)
|
||||
{
|
||||
}
|
||||
|
||||
VTKM_CONT
|
||||
PortalType GetPortal() { return PortalType(this->Data, this->NumberOfValues); }
|
||||
|
||||
VTKM_CONT
|
||||
PortalConstType GetPortalConst() const
|
||||
{
|
||||
return PortalConstType(this->Data, this->NumberOfValues);
|
||||
}
|
||||
|
||||
VTKM_CONT
|
||||
vtkm::Id GetNumberOfValues() const { return this->NumberOfValues; }
|
||||
|
||||
VTKM_CONT
|
||||
void Allocate(vtkm::Id size)
|
||||
{
|
||||
if (!this->OwnsResources())
|
||||
throw vtkm::cont::ErrorBadAllocation(
|
||||
"ArrayHandleCuda does not own its internal device memory.");
|
||||
|
||||
if (NumberOfValues != 0)
|
||||
this->ReleaseResources();
|
||||
this->Data = thrust::system::cuda::malloc<ValueType>(size);
|
||||
this->NumberOfValues = size;
|
||||
}
|
||||
|
||||
VTKM_CONT
|
||||
void Shrink(vtkm::Id numberOfValues)
|
||||
{
|
||||
VTKM_ASSERT(numberOfValues <= this->GetNumberOfValues());
|
||||
|
||||
this->NumberOfValues = numberOfValues;
|
||||
if (numberOfValues == 0 && this->OwnsResources())
|
||||
this->ReleaseResources();
|
||||
}
|
||||
|
||||
VTKM_CONT
|
||||
void ReleaseResources()
|
||||
{
|
||||
if (!this->OwnsResources())
|
||||
throw vtkm::cont::ErrorBadAllocation(
|
||||
"ArrayHandleCuda does not own its internal device memory.");
|
||||
|
||||
if (this->NumberOfValues)
|
||||
{
|
||||
thrust::system::cuda::free(this->Data);
|
||||
this->NumberOfValues = 0;
|
||||
}
|
||||
}
|
||||
|
||||
VTKM_CONT
|
||||
DevicePointer GetDevicePointer() const { return this->Data; }
|
||||
|
||||
VTKM_CONT
|
||||
bool OwnsResources() const { return this->IsOwner; }
|
||||
|
||||
private:
|
||||
DevicePointer Data;
|
||||
vtkm::Id NumberOfValues;
|
||||
bool IsOwner;
|
||||
};
|
||||
|
||||
} // namespace internal
|
||||
} // namespace cont
|
||||
} // namespace vtkm
|
||||
|
||||
#ifdef VTKM_CUDA
|
||||
namespace vtkm
|
||||
{
|
||||
namespace cont
|
||||
{
|
||||
namespace cuda
|
||||
{
|
||||
namespace internal
|
||||
{
|
||||
|
||||
template <typename T, typename U>
|
||||
class ArrayManagerExecutionThrustDevice;
|
||||
|
||||
template <typename T>
|
||||
class ArrayManagerExecutionThrustDevice<T, vtkm::cont::cuda::StorageTagCuda>
|
||||
{
|
||||
public:
|
||||
typedef T ValueType;
|
||||
typedef vtkm::cont::cuda::StorageTagCuda StorageTag;
|
||||
typedef typename thrust::system::cuda::pointer<T>::difference_type difference_type;
|
||||
|
||||
typedef vtkm::cont::internal::Storage<ValueType, StorageTag> StorageType;
|
||||
|
||||
typedef vtkm::exec::cuda::internal::ArrayPortalFromThrust<T> PortalType;
|
||||
typedef vtkm::exec::cuda::internal::ConstArrayPortalFromThrust<const T> PortalConstType;
|
||||
|
||||
VTKM_CONT
|
||||
ArrayManagerExecutionThrustDevice(StorageType* storage)
|
||||
: Storage(storage)
|
||||
{
|
||||
}
|
||||
|
||||
VTKM_CONT
|
||||
~ArrayManagerExecutionThrustDevice() {}
|
||||
|
||||
/// Returns the size of the array.
|
||||
///
|
||||
VTKM_CONT
|
||||
vtkm::Id GetNumberOfValues() const { return this->Storage->GetNumberOfValues(); }
|
||||
|
||||
/// Since memory is already on the device, there is nothing to prepare
|
||||
///
|
||||
VTKM_CONT
|
||||
PortalConstType PrepareForInput(bool)
|
||||
{
|
||||
return PortalConstType(this->Storage->GetDevicePointer(),
|
||||
this->Storage->GetDevicePointer() +
|
||||
static_cast<difference_type>(Storage->GetNumberOfValues()));
|
||||
}
|
||||
|
||||
/// Since memory is already on the device, there is nothing to prepare
|
||||
///
|
||||
VTKM_CONT
|
||||
PortalType PrepareForInPlace(bool)
|
||||
{
|
||||
return PortalType(this->Storage->GetDevicePointer(),
|
||||
this->Storage->GetDevicePointer() +
|
||||
static_cast<difference_type>(Storage->GetNumberOfValues()));
|
||||
}
|
||||
|
||||
/// Allocates the array to the given size.
|
||||
///
|
||||
VTKM_CONT
|
||||
PortalType PrepareForOutput(vtkm::Id numberOfValues)
|
||||
{
|
||||
if (this->Storage->GetNumberOfValues())
|
||||
this->Storage->ReleaseResources();
|
||||
this->Storage->Allocate(numberOfValues);
|
||||
|
||||
return PortalType(this->Storage->GetDevicePointer(),
|
||||
this->Storage->GetDevicePointer() +
|
||||
static_cast<difference_type>(Storage->GetNumberOfValues()));
|
||||
}
|
||||
|
||||
/// Since output data stays on the device, there is nothing to retrieve
|
||||
///
|
||||
VTKM_CONT
|
||||
void RetrieveOutputData(StorageType*) const {}
|
||||
|
||||
/// Resizes the device vector.
|
||||
///
|
||||
VTKM_CONT void Shrink(vtkm::Id numberOfValues)
|
||||
{
|
||||
this->Storage->Shrink(static_cast<vtkm::UInt64>(numberOfValues));
|
||||
}
|
||||
|
||||
/// Releases storage resources, if the storage owns them
|
||||
VTKM_CONT void ReleaseResources()
|
||||
{
|
||||
if (this->Storage->OwnsResources())
|
||||
this->Storage->ReleaseResources();
|
||||
}
|
||||
|
||||
private:
|
||||
ArrayManagerExecutionThrustDevice(ArrayManagerExecutionThrustDevice<T, StorageTag>&) = delete;
|
||||
void operator=(ArrayManagerExecutionThrustDevice<T, StorageTag>&) = delete;
|
||||
|
||||
StorageType* Storage;
|
||||
};
|
||||
|
||||
} //namespace internal
|
||||
} //namespace cuda
|
||||
} //namespace cont
|
||||
} //namespace vtkm
|
||||
#endif
|
||||
|
||||
namespace vtkm
|
||||
{
|
||||
namespace cont
|
||||
{
|
||||
|
||||
/// ArrayHandleCuda is a specialization of ArrayHandle, which stores an
|
||||
/// Array that has already been allocated inside CUDA
|
||||
template <typename T>
|
||||
class ArrayHandleCuda : public vtkm::cont::ArrayHandle<T, vtkm::cont::cuda::StorageTagCuda>
|
||||
{
|
||||
public:
|
||||
VTKM_ARRAY_HANDLE_SUBCLASS(ArrayHandleCuda,
|
||||
(ArrayHandleCuda<T>),
|
||||
(vtkm::cont::ArrayHandle<T, vtkm::cont::cuda::StorageTagCuda>));
|
||||
|
||||
VTKM_CONT
|
||||
ArrayHandleCuda(T* start, vtkm::Id length)
|
||||
: Superclass(vtkm::cont::internal::Storage<T, vtkm::cont::cuda::StorageTagCuda>(start, length))
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
/// A convenience function for creating an ArrayHandle from a Cuda pointer.
|
||||
///
|
||||
template <typename T>
|
||||
VTKM_CONT vtkm::cont::ArrayHandle<T, vtkm::cont::cuda::StorageTagCuda> make_ArrayHandleCuda(
|
||||
T* array,
|
||||
vtkm::Id length)
|
||||
{
|
||||
typedef vtkm::cont::cuda::StorageTagCuda StorageTag;
|
||||
typedef vtkm::cont::ArrayHandle<T, StorageTag> ArrayHandleType;
|
||||
return ArrayHandleType(array, length);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
VTKM_CONT void printSummary_ArrayHandle(
|
||||
const vtkm::cont::ArrayHandle<T, vtkm::cont::cuda::StorageTagCuda>& array,
|
||||
std::ostream& out)
|
||||
{
|
||||
vtkm::Id sz = array.GetNumberOfValues();
|
||||
out << "sz= " << sz << " [(on device)]";
|
||||
}
|
||||
|
||||
} //namespace cont
|
||||
} //namespace vtkm
|
||||
|
||||
namespace vtkm
|
||||
{
|
||||
namespace cont
|
||||
{
|
||||
namespace cuda
|
||||
{
|
||||
|
||||
template <typename T>
|
||||
class ArrayHandle : public vtkm::cont::ArrayHandleCuda<T>
|
||||
{
|
||||
public:
|
||||
VTKM_CONT
|
||||
ArrayHandle(T* start, vtkm::Id length)
|
||||
: vtkm::cont::ArrayHandleCuda<T>(start, length)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
} //namespace cuda
|
||||
} //namespace cont
|
||||
} //namespace vtkm
|
||||
|
||||
#endif //vtk_m_cont_cuda_ArrayHandleCuda_h
|
@ -19,7 +19,6 @@
|
||||
##============================================================================
|
||||
|
||||
set(headers
|
||||
ArrayHandleCuda.h
|
||||
ChooseCudaDevice.h
|
||||
DeviceAdapterCuda.h
|
||||
ErrorCuda.h
|
||||
|
@ -19,7 +19,6 @@
|
||||
##============================================================================
|
||||
|
||||
set(unit_tests
|
||||
UnitTestCudaArrayHandle.cu
|
||||
UnitTestCudaArrayHandleFancy.cu
|
||||
UnitTestCudaComputeRange.cu
|
||||
UnitTestCudaDataSetExplicit.cu
|
||||
|
@ -1,54 +0,0 @@
|
||||
//============================================================================
|
||||
// Copyright (c) Kitware, Inc.
|
||||
// All rights reserved.
|
||||
// See LICENSE.txt for details.
|
||||
// This software is distributed WITHOUT ANY WARRANTY; without even
|
||||
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
// PURPOSE. See the above copyright notice for more information.
|
||||
//
|
||||
// Copyright 2014 Sandia Corporation.
|
||||
// Copyright 2014 UT-Battelle, LLC.
|
||||
// Copyright 2014 Los Alamos National Security.
|
||||
//
|
||||
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
|
||||
// the U.S. Government retains certain rights in this software.
|
||||
//
|
||||
// Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National
|
||||
// Laboratory (LANL), the U.S. Government retains certain rights in
|
||||
// this software.
|
||||
//============================================================================
|
||||
|
||||
#ifdef VTKM_DEVICE_ADAPTER
|
||||
#undef VTKM_DEVICE_ADAPTER
|
||||
#endif
|
||||
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_ERROR
|
||||
|
||||
#include <vtkm/cont/cuda/ArrayHandleCuda.h>
|
||||
#include <vtkm/cont/cuda/DeviceAdapterCuda.h>
|
||||
|
||||
#include <vtkm/cont/cuda/internal/testing/Testing.h>
|
||||
#include <vtkm/cont/testing/TestingArrayHandles.h>
|
||||
|
||||
#include <vtkm/cont/Field.h>
|
||||
|
||||
//simple test to verify the array handle cuda compiles
|
||||
void TestCudaHandle()
|
||||
{
|
||||
//Verify that we can construct a cuda array handle using the class inside
|
||||
//the vtkm::cont::cuda namespace
|
||||
vtkm::cont::cuda::ArrayHandle<vtkm::Id> handleFoo(nullptr, 0);
|
||||
vtkm::cont::Field foo("foo", vtkm::cont::Field::ASSOC_CELL_SET, "cellset", handleFoo);
|
||||
|
||||
//Verify that we can construct a cuda array handle using the class inside
|
||||
//the vtkm::cont namespace
|
||||
vtkm::cont::ArrayHandleCuda<vtkm::Vec<vtkm::Float32, 3>> handleBar(nullptr, 0);
|
||||
vtkm::cont::Field bar("bar", vtkm::cont::Field::ASSOC_CELL_SET, "cellset", handleBar);
|
||||
}
|
||||
|
||||
int UnitTestCudaArrayHandle(int, char* [])
|
||||
{
|
||||
TestCudaHandle();
|
||||
|
||||
int result = vtkm::cont::testing::TestingArrayHandles<vtkm::cont::DeviceAdapterTagCuda>::Run();
|
||||
return vtkm::cont::cuda::internal::Testing::CheckCudaBeforeExit(result);
|
||||
}
|
@ -39,14 +39,14 @@ template <typename T, typename Storage>
|
||||
class ArrayHandleExecutionManagerBase
|
||||
{
|
||||
private:
|
||||
typedef vtkm::cont::internal::Storage<T, Storage> StorageType;
|
||||
using StorageType = vtkm::cont::internal::Storage<T, Storage>;
|
||||
|
||||
public:
|
||||
template <typename DeviceAdapter>
|
||||
struct ExecutionTypes
|
||||
{
|
||||
private:
|
||||
typedef vtkm::cont::internal::ArrayTransfer<T, Storage, DeviceAdapter> ArrayTransferType;
|
||||
using ArrayTransferType = vtkm::cont::internal::ArrayTransfer<T, Storage, DeviceAdapter>;
|
||||
|
||||
public:
|
||||
using Portal = typename ArrayTransferType::PortalExecution;
|
||||
@ -195,9 +195,9 @@ private:
|
||||
template <typename T, typename Storage, typename DeviceAdapter>
|
||||
class ArrayHandleExecutionManager : public ArrayHandleExecutionManagerBase<T, Storage>
|
||||
{
|
||||
typedef ArrayHandleExecutionManagerBase<T, Storage> Superclass;
|
||||
typedef vtkm::cont::internal::ArrayTransfer<T, Storage, DeviceAdapter> ArrayTransferType;
|
||||
typedef vtkm::cont::internal::Storage<T, Storage> StorageType;
|
||||
using Superclass = ArrayHandleExecutionManagerBase<T, Storage>;
|
||||
using ArrayTransferType = vtkm::cont::internal::ArrayTransfer<T, Storage, DeviceAdapter>;
|
||||
using StorageType = vtkm::cont::internal::Storage<T, Storage>;
|
||||
|
||||
public:
|
||||
using PortalControl = typename ArrayTransferType::PortalControl;
|
||||
|
@ -53,24 +53,24 @@ class ArrayManagerExecution
|
||||
#ifdef VTKM_DOXYGEN_ONLY
|
||||
{
|
||||
private:
|
||||
typedef vtkm::cont::internal::Storage<T, StorageTag> StorageType;
|
||||
using StorageType = vtkm::cont::internal::Storage<T, StorageTag>;
|
||||
|
||||
public:
|
||||
/// The type of value held in the array (vtkm::FloatDefault, vtkm::Vec, etc.)
|
||||
///
|
||||
typedef T ValueType;
|
||||
using ValueType = T;
|
||||
|
||||
/// An array portal that can be used in the execution environment to access
|
||||
/// portions of the arrays. This example defines the portal with a pointer,
|
||||
/// but any portal with methods that can be called and data that can be
|
||||
/// accessed from the execution environment can be used.
|
||||
///
|
||||
typedef vtkm::exec::internal::ArrayPortalFromIterators<ValueType*> PortalType;
|
||||
using PortalType = vtkm::exec::internal::ArrayPortalFromIterators<ValueType*>;
|
||||
|
||||
/// Const version of PortalType. You must be able to cast PortalType to
|
||||
/// PortalConstType.
|
||||
///
|
||||
typedef vtkm::exec::internal::ArrayPortalFromIterators<const ValueType*> PortalConstType;
|
||||
using PortalConstType = vtkm::exec::internal::ArrayPortalFromIterators<const ValueType*>;
|
||||
|
||||
/// All ArrayManagerExecution classes must have a constructor that takes a
|
||||
/// storage reference. The reference may be saved (and will remain valid
|
||||
|
@ -45,7 +45,7 @@ class ArrayManagerExecutionShareWithControl
|
||||
{
|
||||
public:
|
||||
using ValueType = T;
|
||||
typedef vtkm::cont::internal::Storage<ValueType, StorageTag> StorageType;
|
||||
using StorageType = vtkm::cont::internal::Storage<ValueType, StorageTag>;
|
||||
using PortalType = typename StorageType::PortalType;
|
||||
using PortalConstType = typename StorageType::PortalConstType;
|
||||
|
||||
|
@ -234,7 +234,7 @@ public:
|
||||
// The MSVC compiler issues warnings when using raw pointer math when in
|
||||
// debug mode. To keep the compiler happy (and add some safety checks),
|
||||
// wrap the iterator in checked_array_iterator.
|
||||
typedef stdext::checked_array_iterator<_IteratorType> IteratorType;
|
||||
using IteratorType = stdext::checked_array_iterator<_IteratorType>;
|
||||
|
||||
VTKM_SUPPRESS_EXEC_WARNINGS
|
||||
VTKM_EXEC_CONT
|
||||
|
@ -41,9 +41,9 @@ template <class PortalT>
|
||||
class ArrayPortalShrink
|
||||
{
|
||||
public:
|
||||
typedef PortalT DelegatePortalType;
|
||||
using DelegatePortalType = PortalT;
|
||||
|
||||
typedef typename DelegatePortalType::ValueType ValueType;
|
||||
using ValueType = typename DelegatePortalType::ValueType;
|
||||
|
||||
VTKM_CONT ArrayPortalShrink()
|
||||
: NumberOfValues(0)
|
||||
@ -125,8 +125,8 @@ namespace cont
|
||||
template <typename DelegatePortalType>
|
||||
class ArrayPortalToIterators<vtkm::cont::internal::ArrayPortalShrink<DelegatePortalType>>
|
||||
{
|
||||
typedef vtkm::cont::internal::ArrayPortalShrink<DelegatePortalType> PortalType;
|
||||
typedef vtkm::cont::ArrayPortalToIterators<DelegatePortalType> DelegateArrayPortalToIterators;
|
||||
using PortalType = vtkm::cont::internal::ArrayPortalShrink<DelegatePortalType>;
|
||||
using DelegateArrayPortalToIterators = vtkm::cont::ArrayPortalToIterators<DelegatePortalType>;
|
||||
|
||||
public:
|
||||
VTKM_SUPPRESS_EXEC_WARNINGS
|
||||
@ -137,7 +137,7 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
typedef typename DelegateArrayPortalToIterators::IteratorType IteratorType;
|
||||
using IteratorType = typename DelegateArrayPortalToIterators::IteratorType;
|
||||
|
||||
VTKM_SUPPRESS_EXEC_WARNINGS
|
||||
VTKM_EXEC_CONT
|
||||
|
@ -50,9 +50,9 @@ template <typename T, class StorageTag, class DeviceAdapterTag>
|
||||
class ArrayTransfer
|
||||
{
|
||||
private:
|
||||
typedef vtkm::cont::internal::Storage<T, StorageTag> StorageType;
|
||||
typedef vtkm::cont::internal::ArrayManagerExecution<T, StorageTag, DeviceAdapterTag>
|
||||
ArrayManagerType;
|
||||
using StorageType = vtkm::cont::internal::Storage<T, StorageTag>;
|
||||
using ArrayManagerType =
|
||||
vtkm::cont::internal::ArrayManagerExecution<T, StorageTag, DeviceAdapterTag>;
|
||||
|
||||
public:
|
||||
/// The type of value held in the array (vtkm::FloatDefault, vtkm::Vec, etc.)
|
||||
|
@ -46,12 +46,12 @@ void buildIndexOffsets(const NumIndicesArrayType& numIndices,
|
||||
{
|
||||
//We first need to make sure that NumIndices and IndexOffsetArrayType
|
||||
//have the same type so we can call scane exclusive
|
||||
typedef vtkm::cont::ArrayHandleCast<vtkm::Id, NumIndicesArrayType> CastedNumIndicesType;
|
||||
using CastedNumIndicesType = vtkm::cont::ArrayHandleCast<vtkm::Id, NumIndicesArrayType>;
|
||||
|
||||
// Although technically we are making changes to this object, the changes
|
||||
// are logically consistent with the previous state, so we consider it
|
||||
// valid under const.
|
||||
typedef vtkm::cont::DeviceAdapterAlgorithm<DeviceAdapterTag> Algorithm;
|
||||
using Algorithm = vtkm::cont::DeviceAdapterAlgorithm<DeviceAdapterTag>;
|
||||
Algorithm::ScanExclusive(CastedNumIndicesType(numIndices), offsets);
|
||||
}
|
||||
|
||||
@ -73,8 +73,8 @@ void buildIndexOffsets(const ArrayHandleIndices& numIndices,
|
||||
ArrayHandleOffsets offsets,
|
||||
DeviceAdapterTag tag)
|
||||
{
|
||||
typedef vtkm::cont::internal::IsWriteableArrayHandle<ArrayHandleOffsets, DeviceAdapterTag>
|
||||
IsWriteable;
|
||||
using IsWriteable =
|
||||
vtkm::cont::internal::IsWriteableArrayHandle<ArrayHandleOffsets, DeviceAdapterTag>;
|
||||
buildIndexOffsets(numIndices, offsets, tag, typename IsWriteable::type());
|
||||
}
|
||||
|
||||
@ -84,10 +84,10 @@ template <typename ShapeStorageTag = VTKM_DEFAULT_STORAGE_TAG,
|
||||
typename IndexOffsetStorageTag = VTKM_DEFAULT_STORAGE_TAG>
|
||||
struct ConnectivityExplicitInternals
|
||||
{
|
||||
typedef vtkm::cont::ArrayHandle<vtkm::UInt8, ShapeStorageTag> ShapeArrayType;
|
||||
typedef vtkm::cont::ArrayHandle<vtkm::IdComponent, NumIndicesStorageTag> NumIndicesArrayType;
|
||||
typedef vtkm::cont::ArrayHandle<vtkm::Id, ConnectivityStorageTag> ConnectivityArrayType;
|
||||
typedef vtkm::cont::ArrayHandle<vtkm::Id, IndexOffsetStorageTag> IndexOffsetArrayType;
|
||||
using ShapeArrayType = vtkm::cont::ArrayHandle<vtkm::UInt8, ShapeStorageTag>;
|
||||
using NumIndicesArrayType = vtkm::cont::ArrayHandle<vtkm::IdComponent, NumIndicesStorageTag>;
|
||||
using ConnectivityArrayType = vtkm::cont::ArrayHandle<vtkm::Id, ConnectivityStorageTag>;
|
||||
using IndexOffsetArrayType = vtkm::cont::ArrayHandle<vtkm::Id, IndexOffsetStorageTag>;
|
||||
|
||||
ShapeArrayType Shapes;
|
||||
NumIndicesArrayType NumIndices;
|
||||
|
@ -102,8 +102,8 @@ private:
|
||||
template <typename T, class CIn>
|
||||
VTKM_CONT static T GetExecutionValue(const vtkm::cont::ArrayHandle<T, CIn>& input, vtkm::Id index)
|
||||
{
|
||||
typedef vtkm::cont::ArrayHandle<T, CIn> InputArrayType;
|
||||
typedef vtkm::cont::ArrayHandle<T, vtkm::cont::StorageTagBasic> OutputArrayType;
|
||||
using InputArrayType = vtkm::cont::ArrayHandle<T, CIn>;
|
||||
using OutputArrayType = vtkm::cont::ArrayHandle<T, vtkm::cont::StorageTagBasic>;
|
||||
|
||||
OutputArrayType output;
|
||||
|
||||
@ -125,11 +125,10 @@ public:
|
||||
VTKM_CONT static void Copy(const vtkm::cont::ArrayHandle<T, CIn>& input,
|
||||
vtkm::cont::ArrayHandle<U, COut>& output)
|
||||
{
|
||||
typedef CopyKernel<
|
||||
using CopyKernelType = CopyKernel<
|
||||
typename vtkm::cont::ArrayHandle<T,
|
||||
CIn>::template ExecutionTypes<DeviceAdapterTag>::PortalConst,
|
||||
typename vtkm::cont::ArrayHandle<U, COut>::template ExecutionTypes<DeviceAdapterTag>::Portal>
|
||||
CopyKernelType;
|
||||
typename vtkm::cont::ArrayHandle<U, COut>::template ExecutionTypes<DeviceAdapterTag>::Portal>;
|
||||
const vtkm::Id inSize = input.GetNumberOfValues();
|
||||
|
||||
CopyKernelType kernel(input.PrepareForInput(DeviceAdapterTag()),
|
||||
@ -148,11 +147,12 @@ public:
|
||||
VTKM_ASSERT(input.GetNumberOfValues() == stencil.GetNumberOfValues());
|
||||
vtkm::Id arrayLength = stencil.GetNumberOfValues();
|
||||
|
||||
typedef vtkm::cont::ArrayHandle<vtkm::Id, vtkm::cont::StorageTagBasic> IndexArrayType;
|
||||
using IndexArrayType = vtkm::cont::ArrayHandle<vtkm::Id, vtkm::cont::StorageTagBasic>;
|
||||
IndexArrayType indices;
|
||||
|
||||
typedef typename vtkm::cont::ArrayHandle<U, CStencil>::template ExecutionTypes<
|
||||
DeviceAdapterTag>::PortalConst StencilPortalType;
|
||||
using StencilPortalType =
|
||||
typename vtkm::cont::ArrayHandle<U, CStencil>::template ExecutionTypes<
|
||||
DeviceAdapterTag>::PortalConst;
|
||||
StencilPortalType stencilPortal = stencil.PrepareForInput(DeviceAdapterTag());
|
||||
|
||||
using IndexPortalType =
|
||||
@ -166,13 +166,13 @@ public:
|
||||
|
||||
vtkm::Id outArrayLength = DerivedAlgorithm::ScanExclusive(indices, indices);
|
||||
|
||||
typedef typename vtkm::cont::ArrayHandle<T, CIn>::template ExecutionTypes<
|
||||
DeviceAdapterTag>::PortalConst InputPortalType;
|
||||
using InputPortalType =
|
||||
typename vtkm::cont::ArrayHandle<T,
|
||||
CIn>::template ExecutionTypes<DeviceAdapterTag>::PortalConst;
|
||||
InputPortalType inputPortal = input.PrepareForInput(DeviceAdapterTag());
|
||||
|
||||
typedef
|
||||
typename vtkm::cont::ArrayHandle<T, COut>::template ExecutionTypes<DeviceAdapterTag>::Portal
|
||||
OutputPortalType;
|
||||
using OutputPortalType =
|
||||
typename vtkm::cont::ArrayHandle<T, COut>::template ExecutionTypes<DeviceAdapterTag>::Portal;
|
||||
OutputPortalType outputPortal = output.PrepareForOutput(outArrayLength, DeviceAdapterTag());
|
||||
|
||||
CopyIfKernel<InputPortalType,
|
||||
@ -202,11 +202,10 @@ public:
|
||||
vtkm::cont::ArrayHandle<U, COut>& output,
|
||||
vtkm::Id outputIndex = 0)
|
||||
{
|
||||
typedef CopyKernel<
|
||||
using CopyKernel = CopyKernel<
|
||||
typename vtkm::cont::ArrayHandle<T,
|
||||
CIn>::template ExecutionTypes<DeviceAdapterTag>::PortalConst,
|
||||
typename vtkm::cont::ArrayHandle<U, COut>::template ExecutionTypes<DeviceAdapterTag>::Portal>
|
||||
CopyKernel;
|
||||
typename vtkm::cont::ArrayHandle<U, COut>::template ExecutionTypes<DeviceAdapterTag>::Portal>;
|
||||
|
||||
const vtkm::Id inSize = input.GetNumberOfValues();
|
||||
if (inputStartIndex < 0 || numberOfElementsToCopy < 0 || outputIndex < 0 ||
|
||||
@ -323,13 +322,14 @@ public:
|
||||
//
|
||||
//Now that we have an implicit array that is 1/16 the length of full array
|
||||
//we can use scan inclusive to compute the final sum
|
||||
typedef typename vtkm::cont::ArrayHandle<T, CIn>::template ExecutionTypes<
|
||||
DeviceAdapterTag>::PortalConst InputPortalType;
|
||||
using InputPortalType =
|
||||
typename vtkm::cont::ArrayHandle<T,
|
||||
CIn>::template ExecutionTypes<DeviceAdapterTag>::PortalConst;
|
||||
|
||||
typedef ReduceKernel<InputPortalType, U, BinaryFunctor> ReduceKernelType;
|
||||
using ReduceKernelType = ReduceKernel<InputPortalType, U, BinaryFunctor>;
|
||||
|
||||
using ReduceHandleType = vtkm::cont::ArrayHandleImplicit<ReduceKernelType>;
|
||||
typedef vtkm::cont::ArrayHandle<U, vtkm::cont::StorageTagBasic> TempArrayType;
|
||||
using TempArrayType = vtkm::cont::ArrayHandle<U, vtkm::cont::StorageTagBasic>;
|
||||
|
||||
ReduceKernelType kernel(
|
||||
input.PrepareForInput(DeviceAdapterTag()), initialValue, binary_functor);
|
||||
@ -415,8 +415,8 @@ public:
|
||||
vtkm::cont::ArrayHandle<ReduceKeySeriesStates> keystate;
|
||||
|
||||
{
|
||||
typedef typename vtkm::cont::ArrayHandle<T, KIn>::template ExecutionTypes<
|
||||
DeviceAdapterTag>::PortalConst InputPortalType;
|
||||
using InputPortalType = typename vtkm::cont::ArrayHandle<T, KIn>::template ExecutionTypes<
|
||||
DeviceAdapterTag>::PortalConst;
|
||||
|
||||
using KeyStatePortalType = typename vtkm::cont::ArrayHandle<
|
||||
ReduceKeySeriesStates>::template ExecutionTypes<DeviceAdapterTag>::Portal;
|
||||
@ -436,11 +436,11 @@ public:
|
||||
// the value summed currently, the second being 0 or 1, with 1 being used
|
||||
// when this is a value of a key we need to write ( END or START_AND_END)
|
||||
{
|
||||
typedef vtkm::cont::ArrayHandle<U, VIn> ValueInHandleType;
|
||||
typedef vtkm::cont::ArrayHandle<U, VOut> ValueOutHandleType;
|
||||
using ValueInHandleType = vtkm::cont::ArrayHandle<U, VIn>;
|
||||
using ValueOutHandleType = vtkm::cont::ArrayHandle<U, VOut>;
|
||||
using StencilHandleType = vtkm::cont::ArrayHandle<ReduceKeySeriesStates>;
|
||||
typedef vtkm::cont::ArrayHandleZip<ValueInHandleType, StencilHandleType> ZipInHandleType;
|
||||
typedef vtkm::cont::ArrayHandleZip<ValueOutHandleType, StencilHandleType> ZipOutHandleType;
|
||||
using ZipInHandleType = vtkm::cont::ArrayHandleZip<ValueInHandleType, StencilHandleType>;
|
||||
using ZipOutHandleType = vtkm::cont::ArrayHandleZip<ValueOutHandleType, StencilHandleType>;
|
||||
|
||||
StencilHandleType stencil;
|
||||
ValueOutHandleType reducedValues;
|
||||
@ -474,8 +474,8 @@ public:
|
||||
BinaryFunctor binaryFunctor,
|
||||
const T& initialValue)
|
||||
{
|
||||
typedef vtkm::cont::ArrayHandle<T, vtkm::cont::StorageTagBasic> TempArrayType;
|
||||
typedef vtkm::cont::ArrayHandle<T, COut> OutputArrayType;
|
||||
using TempArrayType = vtkm::cont::ArrayHandle<T, vtkm::cont::StorageTagBasic>;
|
||||
using OutputArrayType = vtkm::cont::ArrayHandle<T, COut>;
|
||||
|
||||
using SrcPortalType =
|
||||
typename TempArrayType::template ExecutionTypes<DeviceAdapterTag>::PortalConst;
|
||||
@ -542,8 +542,8 @@ public:
|
||||
vtkm::cont::ArrayHandle<ReduceKeySeriesStates> keystate;
|
||||
|
||||
{
|
||||
typedef typename vtkm::cont::ArrayHandle<T, KIn>::template ExecutionTypes<
|
||||
DeviceAdapterTag>::PortalConst InputPortalType;
|
||||
using InputPortalType = typename vtkm::cont::ArrayHandle<T, KIn>::template ExecutionTypes<
|
||||
DeviceAdapterTag>::PortalConst;
|
||||
|
||||
using KeyStatePortalType = typename vtkm::cont::ArrayHandle<
|
||||
ReduceKeySeriesStates>::template ExecutionTypes<DeviceAdapterTag>::Portal;
|
||||
@ -557,14 +557,14 @@ public:
|
||||
}
|
||||
|
||||
// 2. Shift input and initialize elements at head flags position to initValue
|
||||
typedef typename vtkm::cont::ArrayHandle<T, vtkm::cont::StorageTagBasic> TempArrayType;
|
||||
typedef
|
||||
using TempArrayType = typename vtkm::cont::ArrayHandle<T, vtkm::cont::StorageTagBasic>;
|
||||
using TempPortalType =
|
||||
typename vtkm::cont::ArrayHandle<T, vtkm::cont::StorageTagBasic>::template ExecutionTypes<
|
||||
DeviceAdapterTag>::Portal TempPortalType;
|
||||
DeviceAdapterTag>::Portal;
|
||||
TempArrayType temp;
|
||||
{
|
||||
typedef typename vtkm::cont::ArrayHandle<T, KIn>::template ExecutionTypes<
|
||||
DeviceAdapterTag>::PortalConst InputPortalType;
|
||||
using InputPortalType = typename vtkm::cont::ArrayHandle<T, KIn>::template ExecutionTypes<
|
||||
DeviceAdapterTag>::PortalConst;
|
||||
|
||||
using KeyStatePortalType = typename vtkm::cont::ArrayHandle<
|
||||
ReduceKeySeriesStates>::template ExecutionTypes<DeviceAdapterTag>::PortalConst;
|
||||
@ -659,11 +659,10 @@ public:
|
||||
vtkm::cont::ArrayHandle<T, COut>& output,
|
||||
BinaryFunctor binary_functor)
|
||||
{
|
||||
typedef
|
||||
typename vtkm::cont::ArrayHandle<T, COut>::template ExecutionTypes<DeviceAdapterTag>::Portal
|
||||
PortalType;
|
||||
using PortalType =
|
||||
typename vtkm::cont::ArrayHandle<T, COut>::template ExecutionTypes<DeviceAdapterTag>::Portal;
|
||||
|
||||
typedef ScanKernel<PortalType, BinaryFunctor> ScanKernelType;
|
||||
using ScanKernelType = ScanKernel<PortalType, BinaryFunctor>;
|
||||
|
||||
DerivedAlgorithm::Copy(input, output);
|
||||
|
||||
@ -721,8 +720,8 @@ public:
|
||||
vtkm::cont::ArrayHandle<ReduceKeySeriesStates> keystate;
|
||||
|
||||
{
|
||||
typedef typename vtkm::cont::ArrayHandle<T, KIn>::template ExecutionTypes<
|
||||
DeviceAdapterTag>::PortalConst InputPortalType;
|
||||
using InputPortalType = typename vtkm::cont::ArrayHandle<T, KIn>::template ExecutionTypes<
|
||||
DeviceAdapterTag>::PortalConst;
|
||||
|
||||
using KeyStatePortalType = typename vtkm::cont::ArrayHandle<
|
||||
ReduceKeySeriesStates>::template ExecutionTypes<DeviceAdapterTag>::Portal;
|
||||
@ -742,11 +741,11 @@ public:
|
||||
// the value summed currently, the second being 0 or 1, with 1 being used
|
||||
// when this is a value of a key we need to write ( END or START_AND_END)
|
||||
{
|
||||
typedef vtkm::cont::ArrayHandle<U, VIn> ValueInHandleType;
|
||||
typedef vtkm::cont::ArrayHandle<U, VOut> ValueOutHandleType;
|
||||
using ValueInHandleType = vtkm::cont::ArrayHandle<U, VIn>;
|
||||
using ValueOutHandleType = vtkm::cont::ArrayHandle<U, VOut>;
|
||||
using StencilHandleType = vtkm::cont::ArrayHandle<ReduceKeySeriesStates>;
|
||||
typedef vtkm::cont::ArrayHandleZip<ValueInHandleType, StencilHandleType> ZipInHandleType;
|
||||
typedef vtkm::cont::ArrayHandleZip<ValueOutHandleType, StencilHandleType> ZipOutHandleType;
|
||||
using ZipInHandleType = vtkm::cont::ArrayHandleZip<ValueInHandleType, StencilHandleType>;
|
||||
using ZipOutHandleType = vtkm::cont::ArrayHandleZip<ValueOutHandleType, StencilHandleType>;
|
||||
|
||||
StencilHandleType stencil;
|
||||
|
||||
@ -788,8 +787,8 @@ public:
|
||||
}
|
||||
numThreads /= 2;
|
||||
|
||||
typedef BitonicSortMergeKernel<PortalType, BinaryCompare> MergeKernel;
|
||||
typedef BitonicSortCrossoverKernel<PortalType, BinaryCompare> CrossoverKernel;
|
||||
using MergeKernel = BitonicSortMergeKernel<PortalType, BinaryCompare>;
|
||||
using CrossoverKernel = BitonicSortCrossoverKernel<PortalType, BinaryCompare>;
|
||||
|
||||
for (vtkm::Id crossoverSize = 1; crossoverSize < numValues; crossoverSize *= 2)
|
||||
{
|
||||
@ -821,7 +820,7 @@ public:
|
||||
using KeyType = vtkm::cont::ArrayHandle<T, StorageT>;
|
||||
;
|
||||
using ValueType = vtkm::cont::ArrayHandle<U, StorageU>;
|
||||
typedef vtkm::cont::ArrayHandleZip<KeyType, ValueType> ZipHandleType;
|
||||
using ZipHandleType = vtkm::cont::ArrayHandleZip<KeyType, ValueType>;
|
||||
|
||||
ZipHandleType zipHandle = vtkm::cont::make_ArrayHandleZip(keys, values);
|
||||
DerivedAlgorithm::Sort(zipHandle, internal::KeyCompare<T, U>());
|
||||
@ -839,7 +838,7 @@ public:
|
||||
using KeyType = vtkm::cont::ArrayHandle<T, StorageT>;
|
||||
;
|
||||
using ValueType = vtkm::cont::ArrayHandle<U, StorageU>;
|
||||
typedef vtkm::cont::ArrayHandleZip<KeyType, ValueType> ZipHandleType;
|
||||
using ZipHandleType = vtkm::cont::ArrayHandleZip<KeyType, ValueType>;
|
||||
|
||||
ZipHandleType zipHandle = vtkm::cont::make_ArrayHandleZip(keys, values);
|
||||
DerivedAlgorithm::Sort(zipHandle, internal::KeyCompare<T, U, BinaryCompare>(binary_compare));
|
||||
@ -860,7 +859,7 @@ public:
|
||||
vtkm::cont::ArrayHandle<vtkm::Id, vtkm::cont::StorageTagBasic> stencilArray;
|
||||
vtkm::Id inputSize = values.GetNumberOfValues();
|
||||
|
||||
typedef internal::WrappedBinaryOperator<bool, BinaryCompare> WrappedBOpType;
|
||||
using WrappedBOpType = internal::WrappedBinaryOperator<bool, BinaryCompare>;
|
||||
WrappedBOpType wrappedCompare(binary_compare);
|
||||
|
||||
ClassifyUniqueComparisonKernel<
|
||||
@ -969,7 +968,7 @@ public:
|
||||
{
|
||||
T* lockedValue;
|
||||
#if defined(_ITERATOR_DEBUG_LEVEL) && _ITERATOR_DEBUG_LEVEL > 0
|
||||
typedef typename vtkm::cont::ArrayPortalToIterators<PortalType>::IteratorType IteratorType;
|
||||
using IteratorType = typename vtkm::cont::ArrayPortalToIterators<PortalType>::IteratorType;
|
||||
typename IteratorType::pointer temp =
|
||||
&(*(Iterators.GetBegin() + static_cast<std::ptrdiff_t>(index)));
|
||||
lockedValue = temp;
|
||||
@ -985,7 +984,7 @@ public:
|
||||
{
|
||||
T* lockedValue;
|
||||
#if defined(_ITERATOR_DEBUG_LEVEL) && _ITERATOR_DEBUG_LEVEL > 0
|
||||
typedef typename vtkm::cont::ArrayPortalToIterators<PortalType>::IteratorType IteratorType;
|
||||
using IteratorType = typename vtkm::cont::ArrayPortalToIterators<PortalType>::IteratorType;
|
||||
typename IteratorType::pointer temp =
|
||||
&(*(Iterators.GetBegin() + static_cast<std::ptrdiff_t>(index)));
|
||||
lockedValue = temp;
|
||||
@ -997,8 +996,9 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
typedef typename vtkm::cont::ArrayHandle<T, vtkm::cont::StorageTagBasic>::template ExecutionTypes<
|
||||
DeviceTag>::Portal PortalType;
|
||||
using PortalType =
|
||||
typename vtkm::cont::ArrayHandle<T, vtkm::cont::StorageTagBasic>::template ExecutionTypes<
|
||||
DeviceTag>::Portal;
|
||||
using IteratorsType = vtkm::cont::ArrayPortalToIterators<PortalType>;
|
||||
IteratorsType Iterators;
|
||||
|
||||
|
@ -274,7 +274,7 @@ struct ReduceByKeyAdd
|
||||
const vtkm::Pair<T, ReduceKeySeriesStates>& a,
|
||||
const vtkm::Pair<T, ReduceKeySeriesStates>& b) const
|
||||
{
|
||||
typedef vtkm::Pair<T, ReduceKeySeriesStates> ReturnType;
|
||||
using ReturnType = vtkm::Pair<T, ReduceKeySeriesStates>;
|
||||
//need too handle how we are going to add two numbers together
|
||||
//based on the keyStates that they have
|
||||
|
||||
|
@ -36,11 +36,10 @@ const vtkm::Id ARRAY_SIZE = 10;
|
||||
template <typename T>
|
||||
struct TemplatedTests
|
||||
{
|
||||
typedef vtkm::cont::internal::ArrayManagerExecutionShareWithControl<T,
|
||||
vtkm::cont::StorageTagBasic>
|
||||
ArrayManagerType;
|
||||
typedef typename ArrayManagerType::ValueType ValueType;
|
||||
typedef vtkm::cont::internal::Storage<T, vtkm::cont::StorageTagBasic> StorageType;
|
||||
using ArrayManagerType =
|
||||
vtkm::cont::internal::ArrayManagerExecutionShareWithControl<T, vtkm::cont::StorageTagBasic>;
|
||||
using ValueType = typename ArrayManagerType::ValueType;
|
||||
using StorageType = vtkm::cont::internal::Storage<T, vtkm::cont::StorageTagBasic>;
|
||||
|
||||
void SetStorage(StorageType& array, const ValueType& value)
|
||||
{
|
||||
|
@ -31,8 +31,8 @@ struct TemplatedTests
|
||||
{
|
||||
static const vtkm::Id ARRAY_SIZE = 10;
|
||||
|
||||
typedef T ValueType;
|
||||
typedef typename vtkm::VecTraits<ValueType>::ComponentType ComponentType;
|
||||
using ValueType = T;
|
||||
using ComponentType = typename vtkm::VecTraits<ValueType>::ComponentType;
|
||||
|
||||
ValueType ExpectedValue(vtkm::Id index, ComponentType value)
|
||||
{
|
||||
|
@ -33,8 +33,8 @@ struct TemplatedTests
|
||||
{
|
||||
static const vtkm::Id ARRAY_SIZE = 10;
|
||||
|
||||
typedef T ValueType;
|
||||
typedef typename vtkm::VecTraits<ValueType>::ComponentType ComponentType;
|
||||
using ValueType = T;
|
||||
using ComponentType = typename vtkm::VecTraits<ValueType>::ComponentType;
|
||||
|
||||
ValueType ExpectedValue(vtkm::Id index, ComponentType value)
|
||||
{
|
||||
@ -79,7 +79,7 @@ struct TemplatedTests
|
||||
template <class ArrayPortalType>
|
||||
void TestIteratorRead(ArrayPortalType portal)
|
||||
{
|
||||
typedef vtkm::cont::internal::IteratorFromArrayPortal<ArrayPortalType> IteratorType;
|
||||
using IteratorType = vtkm::cont::internal::IteratorFromArrayPortal<ArrayPortalType>;
|
||||
|
||||
IteratorType begin = vtkm::cont::internal::make_IteratorBegin(portal);
|
||||
IteratorType end = vtkm::cont::internal::make_IteratorEnd(portal);
|
||||
@ -110,7 +110,7 @@ struct TemplatedTests
|
||||
template <class ArrayPortalType>
|
||||
void TestIteratorWrite(ArrayPortalType portal)
|
||||
{
|
||||
typedef vtkm::cont::internal::IteratorFromArrayPortal<ArrayPortalType> IteratorType;
|
||||
using IteratorType = vtkm::cont::internal::IteratorFromArrayPortal<ArrayPortalType>;
|
||||
|
||||
IteratorType begin = vtkm::cont::internal::make_IteratorBegin(portal);
|
||||
IteratorType end = vtkm::cont::internal::make_IteratorEnd(portal);
|
||||
|
@ -44,9 +44,7 @@ set(headers
|
||||
PointElevation.h
|
||||
PolicyBase.h
|
||||
PolicyDefault.h
|
||||
ResultBase.h
|
||||
ResultDataSet.h
|
||||
ResultField.h
|
||||
Result.h
|
||||
SurfaceNormals.h
|
||||
Tetrahedralize.h
|
||||
Threshold.h
|
||||
|
@ -42,12 +42,11 @@ public:
|
||||
CellAverage();
|
||||
|
||||
template <typename T, typename StorageType, typename DerivedPolicy, typename DeviceAdapter>
|
||||
VTKM_CONT vtkm::filter::ResultField DoExecute(
|
||||
const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& field,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
const DeviceAdapter& tag);
|
||||
VTKM_CONT vtkm::filter::Result DoExecute(const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& field,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
const DeviceAdapter& tag);
|
||||
|
||||
private:
|
||||
vtkm::worklet::CellAverage Worklet;
|
||||
|
@ -36,7 +36,7 @@ inline VTKM_CONT CellAverage::CellAverage()
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename T, typename StorageType, typename DerivedPolicy, typename DeviceAdapter>
|
||||
inline VTKM_CONT vtkm::filter::ResultField CellAverage::DoExecute(
|
||||
inline VTKM_CONT vtkm::filter::Result CellAverage::DoExecute(
|
||||
const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& inField,
|
||||
const vtkm::filter::FieldMetadata& fieldMetadata,
|
||||
@ -45,7 +45,7 @@ inline VTKM_CONT vtkm::filter::ResultField CellAverage::DoExecute(
|
||||
{
|
||||
if (!fieldMetadata.IsPointField())
|
||||
{
|
||||
return vtkm::filter::ResultField();
|
||||
return vtkm::filter::Result();
|
||||
}
|
||||
|
||||
vtkm::cont::DynamicCellSet cellSet = input.GetCellSet(this->GetActiveCellSetIndex());
|
||||
@ -66,7 +66,7 @@ inline VTKM_CONT vtkm::filter::ResultField CellAverage::DoExecute(
|
||||
outputName = fieldMetadata.GetName();
|
||||
}
|
||||
|
||||
return vtkm::filter::ResultField(
|
||||
return vtkm::filter::Result(
|
||||
input, outArray, outputName, vtkm::cont::Field::ASSOC_CELL_SET, cellSet.GetName());
|
||||
}
|
||||
}
|
||||
|
@ -58,12 +58,12 @@ public:
|
||||
void SetCompactPointFields(bool flag) { this->CompactPointFields = flag; }
|
||||
|
||||
template <typename Policy, typename Device>
|
||||
VTKM_CONT vtkm::filter::ResultDataSet DoExecute(const vtkm::cont::DataSet& inData,
|
||||
vtkm::filter::PolicyBase<Policy> policy,
|
||||
Device);
|
||||
VTKM_CONT vtkm::filter::Result DoExecute(const vtkm::cont::DataSet& inData,
|
||||
vtkm::filter::PolicyBase<Policy> policy,
|
||||
Device);
|
||||
|
||||
template <typename ValueType, typename Storage, typename Policy, typename Device>
|
||||
VTKM_CONT bool DoMapField(vtkm::filter::ResultDataSet& result,
|
||||
VTKM_CONT bool DoMapField(vtkm::filter::Result& result,
|
||||
const vtkm::cont::ArrayHandle<ValueType, Storage>& input,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
vtkm::filter::PolicyBase<Policy>,
|
||||
|
@ -66,10 +66,9 @@ inline VTKM_CONT CleanGrid::CleanGrid()
|
||||
}
|
||||
|
||||
template <typename Policy, typename Device>
|
||||
inline VTKM_CONT vtkm::filter::ResultDataSet CleanGrid::DoExecute(
|
||||
const vtkm::cont::DataSet& inData,
|
||||
vtkm::filter::PolicyBase<Policy> policy,
|
||||
Device)
|
||||
inline VTKM_CONT vtkm::filter::Result CleanGrid::DoExecute(const vtkm::cont::DataSet& inData,
|
||||
vtkm::filter::PolicyBase<Policy> policy,
|
||||
Device)
|
||||
{
|
||||
VTKM_IS_DEVICE_ADAPTER_TAG(Device);
|
||||
|
||||
@ -144,7 +143,7 @@ inline VTKM_CONT vtkm::filter::ResultDataSet CleanGrid::DoExecute(
|
||||
|
||||
template <typename ValueType, typename Storage, typename Policy, typename Device>
|
||||
inline VTKM_CONT bool CleanGrid::DoMapField(
|
||||
vtkm::filter::ResultDataSet& result,
|
||||
vtkm::filter::Result& result,
|
||||
const vtkm::cont::ArrayHandle<ValueType, Storage>& input,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
vtkm::filter::PolicyBase<Policy>,
|
||||
|
@ -47,17 +47,16 @@ public:
|
||||
vtkm::Float64 GetClipValue() const { return this->ClipValue; }
|
||||
|
||||
template <typename T, typename StorageType, typename DerivedPolicy, typename DeviceAdapter>
|
||||
VTKM_CONT vtkm::filter::ResultDataSet DoExecute(
|
||||
const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& field,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
const DeviceAdapter& tag);
|
||||
VTKM_CONT vtkm::filter::Result DoExecute(const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& field,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
const DeviceAdapter& tag);
|
||||
|
||||
//Map a new field onto the resulting dataset after running the filter.
|
||||
//This call is only valid after Execute has been called.
|
||||
template <typename T, typename StorageType, typename DerivedPolicy, typename DeviceAdapter>
|
||||
VTKM_CONT bool DoMapField(vtkm::filter::ResultDataSet& result,
|
||||
VTKM_CONT bool DoMapField(vtkm::filter::Result& result,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& input,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
|
@ -65,7 +65,7 @@ inline VTKM_CONT ClipWithField::ClipWithField()
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename T, typename StorageType, typename DerivedPolicy, typename DeviceAdapter>
|
||||
inline VTKM_CONT vtkm::filter::ResultDataSet ClipWithField::DoExecute(
|
||||
inline VTKM_CONT vtkm::filter::Result ClipWithField::DoExecute(
|
||||
const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& field,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
@ -78,7 +78,7 @@ inline VTKM_CONT vtkm::filter::ResultDataSet ClipWithField::DoExecute(
|
||||
{
|
||||
//todo: we need to mark this as a failure of input, not a failure
|
||||
//of the algorithm
|
||||
return vtkm::filter::ResultDataSet();
|
||||
return vtkm::filter::Result();
|
||||
}
|
||||
|
||||
//get the cells and coordinates of the dataset
|
||||
@ -100,7 +100,7 @@ inline VTKM_CONT vtkm::filter::ResultDataSet ClipWithField::DoExecute(
|
||||
vtkm::filter::ApplyPolicy(inputCoords, policy).CastAndCall(pointMapper);
|
||||
vtkm::cont::CoordinateSystem outputCoords(inputCoords.GetName(), outputCoordsArray);
|
||||
output.AddCoordinateSystem(outputCoords);
|
||||
vtkm::filter::ResultDataSet result(output);
|
||||
vtkm::filter::Result result(output);
|
||||
|
||||
return result;
|
||||
}
|
||||
@ -108,7 +108,7 @@ inline VTKM_CONT vtkm::filter::ResultDataSet ClipWithField::DoExecute(
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename T, typename StorageType, typename DerivedPolicy, typename DeviceAdapter>
|
||||
inline VTKM_CONT bool ClipWithField::DoMapField(
|
||||
vtkm::filter::ResultDataSet& result,
|
||||
vtkm::filter::Result& result,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& input,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>&,
|
||||
|
@ -56,14 +56,14 @@ public:
|
||||
}
|
||||
|
||||
template <typename DerivedPolicy, typename DeviceAdapter>
|
||||
vtkm::filter::ResultDataSet DoExecute(const vtkm::cont::DataSet& input,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
const DeviceAdapter& tag);
|
||||
vtkm::filter::Result DoExecute(const vtkm::cont::DataSet& input,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
const DeviceAdapter& tag);
|
||||
|
||||
//Map a new field onto the resulting dataset after running the filter.
|
||||
//This call is only valid after Execute has been called.
|
||||
template <typename T, typename StorageType, typename DerivedPolicy, typename DeviceAdapter>
|
||||
bool DoMapField(vtkm::filter::ResultDataSet& result,
|
||||
bool DoMapField(vtkm::filter::Result& result,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& input,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
|
@ -65,7 +65,7 @@ inline void ClipWithImplicitFunction::SetImplicitFunction(
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename DerivedPolicy, typename DeviceAdapter>
|
||||
inline vtkm::filter::ResultDataSet ClipWithImplicitFunction::DoExecute(
|
||||
inline vtkm::filter::Result ClipWithImplicitFunction::DoExecute(
|
||||
const vtkm::cont::DataSet& input,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
const DeviceAdapter& device)
|
||||
@ -92,14 +92,14 @@ inline vtkm::filter::ResultDataSet ClipWithImplicitFunction::DoExecute(
|
||||
output.AddCellSet(outputCellSet);
|
||||
output.AddCoordinateSystem(outputCoords);
|
||||
|
||||
vtkm::filter::ResultDataSet result(output);
|
||||
vtkm::filter::Result result(output);
|
||||
return result;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename T, typename StorageType, typename DerivedPolicy, typename DeviceAdapter>
|
||||
inline bool ClipWithImplicitFunction::DoMapField(
|
||||
vtkm::filter::ResultDataSet& result,
|
||||
vtkm::filter::Result& result,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& input,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>&,
|
||||
|
@ -88,12 +88,11 @@ public:
|
||||
|
||||
/// Output field
|
||||
template <typename T, typename StorageType, typename DerivedPolicy, typename DeviceAdapter>
|
||||
VTKM_CONT vtkm::filter::ResultField DoExecute(
|
||||
const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& field,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
const DeviceAdapter& tag);
|
||||
VTKM_CONT vtkm::filter::Result DoExecute(const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& field,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
const DeviceAdapter& tag);
|
||||
};
|
||||
|
||||
template <>
|
||||
@ -117,12 +116,11 @@ public:
|
||||
|
||||
/// Output field "saddlePeak" which is pairs of vertex ids indicating saddle and peak of contour
|
||||
template <typename T, typename StorageType, typename DerivedPolicy, typename DeviceAdapter>
|
||||
VTKM_CONT vtkm::filter::ResultField DoExecute(
|
||||
const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& field,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
const DeviceAdapter& tag);
|
||||
VTKM_CONT vtkm::filter::Result DoExecute(const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& field,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
const DeviceAdapter& tag);
|
||||
};
|
||||
|
||||
template <>
|
||||
|
@ -79,7 +79,7 @@ ContourTreeMesh2D::ContourTreeMesh2D()
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename T, typename StorageType, typename DerivedPolicy, typename DeviceAdapter>
|
||||
vtkm::filter::ResultField ContourTreeMesh2D::DoExecute(
|
||||
vtkm::filter::Result ContourTreeMesh2D::DoExecute(
|
||||
const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& field,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
@ -89,7 +89,7 @@ vtkm::filter::ResultField ContourTreeMesh2D::DoExecute(
|
||||
if (fieldMeta.IsPointField() == false)
|
||||
{
|
||||
std::cout << "ERROR: Point field expected" << std::endl;
|
||||
return vtkm::filter::ResultField();
|
||||
return vtkm::filter::Result();
|
||||
}
|
||||
|
||||
// Collect sizing information from the dataset
|
||||
@ -108,11 +108,11 @@ vtkm::filter::ResultField ContourTreeMesh2D::DoExecute(
|
||||
vtkm::worklet::ContourTreeMesh2D worklet;
|
||||
worklet.Run(field, nRows, nCols, saddlePeak, device);
|
||||
|
||||
return vtkm::filter::ResultField(input,
|
||||
saddlePeak,
|
||||
this->GetOutputFieldName(),
|
||||
fieldMeta.GetAssociation(),
|
||||
fieldMeta.GetCellSetName());
|
||||
return vtkm::filter::Result(input,
|
||||
saddlePeak,
|
||||
this->GetOutputFieldName(),
|
||||
fieldMeta.GetAssociation(),
|
||||
fieldMeta.GetCellSetName());
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
ContourTreeMesh3D::ContourTreeMesh3D()
|
||||
@ -122,7 +122,7 @@ ContourTreeMesh3D::ContourTreeMesh3D()
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename T, typename StorageType, typename DerivedPolicy, typename DeviceAdapter>
|
||||
vtkm::filter::ResultField ContourTreeMesh3D::DoExecute(
|
||||
vtkm::filter::Result ContourTreeMesh3D::DoExecute(
|
||||
const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& field,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
@ -132,7 +132,7 @@ vtkm::filter::ResultField ContourTreeMesh3D::DoExecute(
|
||||
if (fieldMeta.IsPointField() == false)
|
||||
{
|
||||
std::cout << "ERROR: Point field expected" << std::endl;
|
||||
return vtkm::filter::ResultField();
|
||||
return vtkm::filter::Result();
|
||||
}
|
||||
|
||||
// Collect sizing information from the dataset
|
||||
@ -152,11 +152,11 @@ vtkm::filter::ResultField ContourTreeMesh3D::DoExecute(
|
||||
vtkm::worklet::ContourTreeMesh3D worklet;
|
||||
worklet.Run(field, nRows, nCols, nSlices, saddlePeak, device);
|
||||
|
||||
return vtkm::filter::ResultField(input,
|
||||
saddlePeak,
|
||||
this->GetOutputFieldName(),
|
||||
fieldMeta.GetAssociation(),
|
||||
fieldMeta.GetCellSetName());
|
||||
return vtkm::filter::Result(input,
|
||||
saddlePeak,
|
||||
this->GetOutputFieldName(),
|
||||
fieldMeta.GetAssociation(),
|
||||
fieldMeta.GetCellSetName());
|
||||
}
|
||||
}
|
||||
} // namespace vtkm::filter
|
||||
|
@ -43,12 +43,11 @@ public:
|
||||
void SetNumberOfBins(vtkm::Id count) { this->NumberOfBins = count; }
|
||||
|
||||
template <typename T, typename StorageType, typename DerivedPolicy, typename DeviceAdapter>
|
||||
VTKM_CONT vtkm::filter::ResultField DoExecute(
|
||||
const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& field,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
const DeviceAdapter& tag);
|
||||
VTKM_CONT vtkm::filter::Result DoExecute(const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& field,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
const DeviceAdapter& tag);
|
||||
|
||||
private:
|
||||
vtkm::Id NumberOfBins;
|
||||
|
@ -21,29 +21,26 @@
|
||||
#include <vtkm/worklet/DispatcherMapField.h>
|
||||
#include <vtkm/worklet/FieldEntropy.h>
|
||||
|
||||
namespace vtkm {
|
||||
namespace filter {
|
||||
namespace vtkm
|
||||
{
|
||||
namespace filter
|
||||
{
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
inline VTKM_CONT
|
||||
Entropy::Entropy():
|
||||
NumberOfBins(10)
|
||||
inline VTKM_CONT Entropy::Entropy()
|
||||
: NumberOfBins(10)
|
||||
{
|
||||
this->SetOutputFieldName("entropy");
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template<typename T,
|
||||
typename StorageType,
|
||||
typename DerivedPolicy,
|
||||
typename DeviceAdapter>
|
||||
inline VTKM_CONT
|
||||
vtkm::filter::ResultField
|
||||
Entropy::DoExecute(const vtkm::cont::DataSet &inDataSet,
|
||||
const vtkm::cont::ArrayHandle<T,StorageType> &field,
|
||||
const vtkm::filter::FieldMetadata &fieldMetadata,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>&,
|
||||
const DeviceAdapter& device)
|
||||
template <typename T, typename StorageType, typename DerivedPolicy, typename DeviceAdapter>
|
||||
inline VTKM_CONT vtkm::filter::Result Entropy::DoExecute(
|
||||
const vtkm::cont::DataSet& inDataSet,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& field,
|
||||
const vtkm::filter::FieldMetadata& fieldMetadata,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>&,
|
||||
const DeviceAdapter& device)
|
||||
{
|
||||
vtkm::worklet::FieldEntropy worklet;
|
||||
|
||||
@ -54,11 +51,11 @@ Entropy::DoExecute(const vtkm::cont::DataSet &inDataSet,
|
||||
entropy.Allocate(1);
|
||||
entropy.GetPortalControl().Set(0, e);
|
||||
|
||||
return vtkm::filter::ResultField(inDataSet,
|
||||
entropy,
|
||||
this->GetOutputFieldName(),
|
||||
fieldMetadata.GetAssociation(),
|
||||
fieldMetadata.GetCellSetName());
|
||||
return vtkm::filter::Result(inDataSet,
|
||||
entropy,
|
||||
this->GetOutputFieldName(),
|
||||
fieldMetadata.GetAssociation(),
|
||||
fieldMetadata.GetCellSetName());
|
||||
}
|
||||
}
|
||||
} // namespace vtkm::filter
|
||||
|
@ -64,15 +64,14 @@ public:
|
||||
}
|
||||
|
||||
template <typename DerivedPolicy, typename DeviceAdapter>
|
||||
VTKM_CONT vtkm::filter::ResultDataSet DoExecute(
|
||||
const vtkm::cont::DataSet& input,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
const DeviceAdapter& tag);
|
||||
VTKM_CONT vtkm::filter::Result DoExecute(const vtkm::cont::DataSet& input,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
const DeviceAdapter& tag);
|
||||
|
||||
//Map a new field onto the resulting dataset after running the filter
|
||||
//this call is only valid
|
||||
template <typename T, typename StorageType, typename DerivedPolicy, typename DeviceAdapter>
|
||||
VTKM_CONT bool DoMapField(vtkm::filter::ResultDataSet& result,
|
||||
VTKM_CONT bool DoMapField(vtkm::filter::Result& result,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& input,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
|
@ -52,7 +52,7 @@ inline vtkm::filter::PolicyBase<CellSetExplicitPolicy<DerivedPolicy>> GetCellSet
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename DerivedPolicy, typename DeviceAdapter>
|
||||
inline VTKM_CONT vtkm::filter::ResultDataSet ExternalFaces::DoExecute(
|
||||
inline VTKM_CONT vtkm::filter::Result ExternalFaces::DoExecute(
|
||||
const vtkm::cont::DataSet& input,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
const DeviceAdapter&)
|
||||
@ -107,14 +107,14 @@ inline VTKM_CONT vtkm::filter::ResultDataSet ExternalFaces::DoExecute(
|
||||
}
|
||||
else
|
||||
{
|
||||
return vtkm::filter::ResultDataSet(output);
|
||||
return vtkm::filter::Result(output);
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename T, typename StorageType, typename DerivedPolicy, typename DeviceAdapter>
|
||||
inline VTKM_CONT bool ExternalFaces::DoMapField(
|
||||
vtkm::filter::ResultDataSet& result,
|
||||
vtkm::filter::Result& result,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& input,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
|
@ -95,13 +95,13 @@ public:
|
||||
void ExtractOnlyBoundaryCellsOff() { this->ExtractOnlyBoundaryCells = false; }
|
||||
|
||||
template <typename DerivedPolicy, typename DeviceAdapter>
|
||||
vtkm::filter::ResultDataSet DoExecute(const vtkm::cont::DataSet& input,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
const DeviceAdapter& tag);
|
||||
vtkm::filter::Result DoExecute(const vtkm::cont::DataSet& input,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
const DeviceAdapter& tag);
|
||||
|
||||
//Map a new field onto the resulting dataset after running the filter
|
||||
template <typename T, typename StorageType, typename DerivedPolicy, typename DeviceAdapter>
|
||||
bool DoMapField(vtkm::filter::ResultDataSet& result,
|
||||
bool DoMapField(vtkm::filter::Result& result,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& input,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
|
@ -96,7 +96,7 @@ inline VTKM_CONT ExtractGeometry::ExtractGeometry()
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename DerivedPolicy, typename DeviceAdapter>
|
||||
inline VTKM_CONT vtkm::filter::ResultDataSet ExtractGeometry::DoExecute(
|
||||
inline VTKM_CONT vtkm::filter::Result ExtractGeometry::DoExecute(
|
||||
const vtkm::cont::DataSet& input,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
const DeviceAdapter&)
|
||||
@ -127,7 +127,7 @@ inline VTKM_CONT vtkm::filter::ResultDataSet ExtractGeometry::DoExecute(
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename T, typename StorageType, typename DerivedPolicy, typename DeviceAdapter>
|
||||
inline VTKM_CONT bool ExtractGeometry::DoMapField(
|
||||
vtkm::filter::ResultDataSet& result,
|
||||
vtkm::filter::Result& result,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& input,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>&,
|
||||
|
@ -79,13 +79,13 @@ public:
|
||||
void ExtractInsideOff() { this->ExtractInside = false; }
|
||||
|
||||
template <typename DerivedPolicy, typename DeviceAdapter>
|
||||
vtkm::filter::ResultDataSet DoExecute(const vtkm::cont::DataSet& input,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
const DeviceAdapter& tag);
|
||||
vtkm::filter::Result DoExecute(const vtkm::cont::DataSet& input,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
const DeviceAdapter& tag);
|
||||
|
||||
//Map a new field onto the resulting dataset after running the filter
|
||||
template <typename T, typename StorageType, typename DerivedPolicy, typename DeviceAdapter>
|
||||
bool DoMapField(vtkm::filter::ResultDataSet& result,
|
||||
bool DoMapField(vtkm::filter::Result& result,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& input,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
|
@ -63,7 +63,7 @@ inline VTKM_CONT ExtractPoints::ExtractPoints()
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename DerivedPolicy, typename DeviceAdapter>
|
||||
inline vtkm::filter::ResultDataSet ExtractPoints::DoExecute(
|
||||
inline vtkm::filter::Result ExtractPoints::DoExecute(
|
||||
const vtkm::cont::DataSet& input,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
const DeviceAdapter& device)
|
||||
@ -96,14 +96,14 @@ inline vtkm::filter::ResultDataSet ExtractPoints::DoExecute(
|
||||
}
|
||||
else
|
||||
{
|
||||
return vtkm::filter::ResultDataSet(output);
|
||||
return vtkm::filter::Result(output);
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename T, typename StorageType, typename DerivedPolicy, typename DeviceAdapter>
|
||||
inline VTKM_CONT bool ExtractPoints::DoMapField(
|
||||
vtkm::filter::ResultDataSet& result,
|
||||
vtkm::filter::Result& result,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& input,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
|
@ -89,14 +89,13 @@ public:
|
||||
void SetIncludeBoundary(bool value) { this->IncludeBoundary = value; }
|
||||
|
||||
template <typename DerivedPolicy, typename DeviceAdapter>
|
||||
VTKM_CONT vtkm::filter::ResultDataSet DoExecute(
|
||||
const vtkm::cont::DataSet& input,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
const DeviceAdapter& tag);
|
||||
VTKM_CONT vtkm::filter::Result DoExecute(const vtkm::cont::DataSet& input,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
const DeviceAdapter& tag);
|
||||
|
||||
// Map new field onto the resulting dataset after running the filter
|
||||
template <typename T, typename StorageType, typename DerivedPolicy, typename DeviceAdapter>
|
||||
VTKM_CONT bool DoMapField(vtkm::filter::ResultDataSet& result,
|
||||
VTKM_CONT bool DoMapField(vtkm::filter::Result& result,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& input,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
|
@ -37,7 +37,7 @@ inline VTKM_CONT ExtractStructured::ExtractStructured()
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename DerivedPolicy, typename DeviceAdapter>
|
||||
inline VTKM_CONT vtkm::filter::ResultDataSet ExtractStructured::DoExecute(
|
||||
inline VTKM_CONT vtkm::filter::Result ExtractStructured::DoExecute(
|
||||
const vtkm::cont::DataSet& input,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
const DeviceAdapter& device)
|
||||
@ -60,13 +60,13 @@ inline VTKM_CONT vtkm::filter::ResultDataSet ExtractStructured::DoExecute(
|
||||
vtkm::cont::DataSet output;
|
||||
output.AddCellSet(vtkm::cont::DynamicCellSet(cellset));
|
||||
output.AddCoordinateSystem(outputCoordinates);
|
||||
return vtkm::filter::ResultDataSet(output);
|
||||
return vtkm::filter::Result(output);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename T, typename StorageType, typename DerivedPolicy, typename DeviceAdapter>
|
||||
inline VTKM_CONT bool ExtractStructured::DoMapField(
|
||||
vtkm::filter::ResultDataSet& result,
|
||||
vtkm::filter::Result& result,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& input,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>&,
|
||||
|
@ -28,7 +28,7 @@
|
||||
#include <vtkm/cont/RuntimeDeviceTracker.h>
|
||||
|
||||
#include <vtkm/filter/PolicyBase.h>
|
||||
#include <vtkm/filter/ResultDataSet.h>
|
||||
#include <vtkm/filter/Result.h>
|
||||
|
||||
namespace vtkm
|
||||
{
|
||||
@ -67,11 +67,11 @@ public:
|
||||
const vtkm::cont::RuntimeDeviceTracker& GetRuntimeDeviceTracker() const { return this->Tracker; }
|
||||
|
||||
VTKM_CONT
|
||||
ResultDataSet Execute(const vtkm::cont::DataSet& input);
|
||||
Result Execute(const vtkm::cont::DataSet& input);
|
||||
|
||||
template <typename DerivedPolicy>
|
||||
VTKM_CONT ResultDataSet Execute(const vtkm::cont::DataSet& input,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy);
|
||||
VTKM_CONT Result Execute(const vtkm::cont::DataSet& input,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy);
|
||||
|
||||
//From the field we can extract the association component
|
||||
// ASSOC_ANY -> unable to map
|
||||
@ -80,18 +80,17 @@ public:
|
||||
// ASSOC_CELL_SET -> how do we map this?
|
||||
// ASSOC_LOGICAL_DIM -> unable to map?
|
||||
VTKM_CONT
|
||||
bool MapFieldOntoOutput(ResultDataSet& result, const vtkm::cont::Field& field);
|
||||
bool MapFieldOntoOutput(Result& result, const vtkm::cont::Field& field);
|
||||
|
||||
template <typename DerivedPolicy>
|
||||
VTKM_CONT bool MapFieldOntoOutput(ResultDataSet& result,
|
||||
VTKM_CONT bool MapFieldOntoOutput(Result& result,
|
||||
const vtkm::cont::Field& field,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy);
|
||||
|
||||
private:
|
||||
template <typename DerivedPolicy>
|
||||
VTKM_CONT ResultDataSet
|
||||
PrepareForExecution(const vtkm::cont::DataSet& input,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy);
|
||||
VTKM_CONT Result PrepareForExecution(const vtkm::cont::DataSet& input,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy);
|
||||
|
||||
std::string OutputFieldName;
|
||||
vtkm::Id CellSetIndex;
|
||||
|
@ -55,7 +55,7 @@ inline VTKM_CONT FilterDataSet<Derived>::~FilterDataSet()
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename Derived>
|
||||
inline VTKM_CONT ResultDataSet FilterDataSet<Derived>::Execute(const vtkm::cont::DataSet& input)
|
||||
inline VTKM_CONT Result FilterDataSet<Derived>::Execute(const vtkm::cont::DataSet& input)
|
||||
{
|
||||
return this->Execute(input, vtkm::filter::PolicyDefault());
|
||||
}
|
||||
@ -63,7 +63,7 @@ inline VTKM_CONT ResultDataSet FilterDataSet<Derived>::Execute(const vtkm::cont:
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename Derived>
|
||||
template <typename DerivedPolicy>
|
||||
inline VTKM_CONT ResultDataSet
|
||||
inline VTKM_CONT Result
|
||||
FilterDataSet<Derived>::Execute(const vtkm::cont::DataSet& input,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy)
|
||||
{
|
||||
@ -76,7 +76,7 @@ namespace detail
|
||||
template <typename Derived, typename DerivedPolicy>
|
||||
struct FilterDataSetPrepareForExecutionFunctor
|
||||
{
|
||||
vtkm::filter::ResultDataSet Result;
|
||||
vtkm::filter::Result Result;
|
||||
Derived* Self;
|
||||
const vtkm::cont::DataSet& Input;
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& Policy;
|
||||
@ -95,7 +95,7 @@ struct FilterDataSetPrepareForExecutionFunctor
|
||||
VTKM_CONT bool operator()(Device)
|
||||
{
|
||||
this->Result = this->Self->DoExecute(this->Input, this->Policy, Device());
|
||||
return this->Result.IsValid();
|
||||
return this->Result.IsDataSetValid();
|
||||
}
|
||||
|
||||
private:
|
||||
@ -105,7 +105,7 @@ private:
|
||||
|
||||
template <typename Derived>
|
||||
template <typename DerivedPolicy>
|
||||
inline VTKM_CONT ResultDataSet
|
||||
inline VTKM_CONT Result
|
||||
FilterDataSet<Derived>::PrepareForExecution(const vtkm::cont::DataSet& input,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy)
|
||||
{
|
||||
@ -120,7 +120,7 @@ FilterDataSet<Derived>::PrepareForExecution(const vtkm::cont::DataSet& input,
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename Derived>
|
||||
inline VTKM_CONT bool FilterDataSet<Derived>::MapFieldOntoOutput(ResultDataSet& result,
|
||||
inline VTKM_CONT bool FilterDataSet<Derived>::MapFieldOntoOutput(Result& result,
|
||||
const vtkm::cont::Field& field)
|
||||
{
|
||||
return this->MapFieldOntoOutput(result, field, vtkm::filter::PolicyDefault());
|
||||
@ -130,12 +130,12 @@ inline VTKM_CONT bool FilterDataSet<Derived>::MapFieldOntoOutput(ResultDataSet&
|
||||
template <typename Derived>
|
||||
template <typename DerivedPolicy>
|
||||
inline VTKM_CONT bool FilterDataSet<Derived>::MapFieldOntoOutput(
|
||||
ResultDataSet& result,
|
||||
Result& result,
|
||||
const vtkm::cont::Field& field,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy)
|
||||
{
|
||||
bool valid = false;
|
||||
if (result.IsValid())
|
||||
if (result.IsDataSetValid())
|
||||
{
|
||||
vtkm::filter::FieldMetadata metaData(field);
|
||||
typedef internal::ResolveFieldTypeAndMap<Derived, DerivedPolicy> FunctorType;
|
||||
@ -148,7 +148,7 @@ inline VTKM_CONT bool FilterDataSet<Derived>::MapFieldOntoOutput(
|
||||
|
||||
//the bool valid will be modified by the map algorithm to hold if the
|
||||
//mapping occurred or not. If the mapping was good a new field has been
|
||||
//added to the ResultDataSet that was passed in.
|
||||
//added to the Result that was passed in.
|
||||
return valid;
|
||||
}
|
||||
}
|
||||
|
@ -28,7 +28,7 @@
|
||||
#include <vtkm/cont/RuntimeDeviceTracker.h>
|
||||
|
||||
#include <vtkm/filter/PolicyBase.h>
|
||||
#include <vtkm/filter/ResultDataSet.h>
|
||||
#include <vtkm/filter/Result.h>
|
||||
|
||||
namespace vtkm
|
||||
{
|
||||
@ -67,29 +67,28 @@ public:
|
||||
const vtkm::cont::RuntimeDeviceTracker& GetRuntimeDeviceTracker() const { return this->Tracker; }
|
||||
|
||||
VTKM_CONT
|
||||
ResultDataSet Execute(const vtkm::cont::DataSet& input, const std::string& inFieldName);
|
||||
Result Execute(const vtkm::cont::DataSet& input, const std::string& inFieldName);
|
||||
|
||||
VTKM_CONT
|
||||
ResultDataSet Execute(const vtkm::cont::DataSet& input, const vtkm::cont::Field& field);
|
||||
Result Execute(const vtkm::cont::DataSet& input, const vtkm::cont::Field& field);
|
||||
|
||||
VTKM_CONT
|
||||
ResultDataSet Execute(const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::CoordinateSystem& field);
|
||||
Result Execute(const vtkm::cont::DataSet& input, const vtkm::cont::CoordinateSystem& field);
|
||||
|
||||
template <typename DerivedPolicy>
|
||||
VTKM_CONT ResultDataSet Execute(const vtkm::cont::DataSet& input,
|
||||
const std::string& inFieldName,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy);
|
||||
VTKM_CONT Result Execute(const vtkm::cont::DataSet& input,
|
||||
const std::string& inFieldName,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy);
|
||||
|
||||
template <typename DerivedPolicy>
|
||||
VTKM_CONT ResultDataSet Execute(const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::Field& field,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy);
|
||||
VTKM_CONT Result Execute(const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::Field& field,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy);
|
||||
|
||||
template <typename DerivedPolicy>
|
||||
VTKM_CONT ResultDataSet Execute(const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::CoordinateSystem& field,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy);
|
||||
VTKM_CONT Result Execute(const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::CoordinateSystem& field,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy);
|
||||
|
||||
//From the field we can extract the association component
|
||||
// ASSOC_ANY -> unable to map
|
||||
@ -98,26 +97,24 @@ public:
|
||||
// ASSOC_CELL_SET -> how do we map this?
|
||||
// ASSOC_LOGICAL_DIM -> unable to map?
|
||||
VTKM_CONT
|
||||
bool MapFieldOntoOutput(ResultDataSet& result, const vtkm::cont::Field& field);
|
||||
bool MapFieldOntoOutput(Result& result, const vtkm::cont::Field& field);
|
||||
|
||||
template <typename DerivedPolicy>
|
||||
VTKM_CONT bool MapFieldOntoOutput(ResultDataSet& result,
|
||||
VTKM_CONT bool MapFieldOntoOutput(Result& result,
|
||||
const vtkm::cont::Field& field,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy);
|
||||
|
||||
private:
|
||||
template <typename DerivedPolicy>
|
||||
VTKM_CONT ResultDataSet
|
||||
PrepareForExecution(const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::Field& field,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy);
|
||||
VTKM_CONT Result PrepareForExecution(const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::Field& field,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy);
|
||||
|
||||
//How do we specify float/double coordinate types?
|
||||
template <typename DerivedPolicy>
|
||||
VTKM_CONT ResultDataSet
|
||||
PrepareForExecution(const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::CoordinateSystem& field,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy);
|
||||
VTKM_CONT Result PrepareForExecution(const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::CoordinateSystem& field,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy);
|
||||
|
||||
std::string OutputFieldName;
|
||||
vtkm::Id CellSetIndex;
|
||||
|
@ -55,25 +55,23 @@ inline VTKM_CONT FilterDataSetWithField<Derived>::~FilterDataSetWithField()
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename Derived>
|
||||
inline VTKM_CONT ResultDataSet
|
||||
FilterDataSetWithField<Derived>::Execute(const vtkm::cont::DataSet& input,
|
||||
const std::string& inFieldName)
|
||||
inline VTKM_CONT Result FilterDataSetWithField<Derived>::Execute(const vtkm::cont::DataSet& input,
|
||||
const std::string& inFieldName)
|
||||
{
|
||||
return this->Execute(input, input.GetField(inFieldName), vtkm::filter::PolicyDefault());
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename Derived>
|
||||
inline VTKM_CONT ResultDataSet
|
||||
FilterDataSetWithField<Derived>::Execute(const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::Field& field)
|
||||
inline VTKM_CONT Result FilterDataSetWithField<Derived>::Execute(const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::Field& field)
|
||||
{
|
||||
return this->Execute(input, field, vtkm::filter::PolicyDefault());
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename Derived>
|
||||
inline VTKM_CONT ResultDataSet
|
||||
inline VTKM_CONT Result
|
||||
FilterDataSetWithField<Derived>::Execute(const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::CoordinateSystem& field)
|
||||
{
|
||||
@ -83,7 +81,7 @@ FilterDataSetWithField<Derived>::Execute(const vtkm::cont::DataSet& input,
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename Derived>
|
||||
template <typename DerivedPolicy>
|
||||
inline VTKM_CONT ResultDataSet
|
||||
inline VTKM_CONT Result
|
||||
FilterDataSetWithField<Derived>::Execute(const vtkm::cont::DataSet& input,
|
||||
const std::string& inFieldName,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy)
|
||||
@ -94,7 +92,7 @@ FilterDataSetWithField<Derived>::Execute(const vtkm::cont::DataSet& input,
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename Derived>
|
||||
template <typename DerivedPolicy>
|
||||
inline VTKM_CONT ResultDataSet
|
||||
inline VTKM_CONT Result
|
||||
FilterDataSetWithField<Derived>::Execute(const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::Field& field,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy)
|
||||
@ -105,7 +103,7 @@ FilterDataSetWithField<Derived>::Execute(const vtkm::cont::DataSet& input,
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename Derived>
|
||||
template <typename DerivedPolicy>
|
||||
inline VTKM_CONT ResultDataSet
|
||||
inline VTKM_CONT Result
|
||||
FilterDataSetWithField<Derived>::Execute(const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::CoordinateSystem& field,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy)
|
||||
@ -118,15 +116,15 @@ FilterDataSetWithField<Derived>::Execute(const vtkm::cont::DataSet& input,
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename Derived>
|
||||
template <typename DerivedPolicy>
|
||||
inline VTKM_CONT ResultDataSet FilterDataSetWithField<Derived>::PrepareForExecution(
|
||||
inline VTKM_CONT Result FilterDataSetWithField<Derived>::PrepareForExecution(
|
||||
const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::Field& field,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy)
|
||||
{
|
||||
vtkm::filter::FieldMetadata metaData(field);
|
||||
ResultDataSet result;
|
||||
Result result;
|
||||
|
||||
typedef internal::ResolveFieldTypeAndExecute<Derived, DerivedPolicy, ResultDataSet> FunctorType;
|
||||
typedef internal::ResolveFieldTypeAndExecute<Derived, DerivedPolicy, Result> FunctorType;
|
||||
FunctorType functor(static_cast<Derived*>(this), input, metaData, policy, this->Tracker, result);
|
||||
|
||||
typedef vtkm::filter::FilterTraits<Derived> Traits;
|
||||
@ -137,7 +135,7 @@ inline VTKM_CONT ResultDataSet FilterDataSetWithField<Derived>::PrepareForExecut
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename Derived>
|
||||
template <typename DerivedPolicy>
|
||||
inline VTKM_CONT ResultDataSet FilterDataSetWithField<Derived>::PrepareForExecution(
|
||||
inline VTKM_CONT Result FilterDataSetWithField<Derived>::PrepareForExecution(
|
||||
const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::CoordinateSystem& field,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy)
|
||||
@ -147,8 +145,8 @@ inline VTKM_CONT ResultDataSet FilterDataSetWithField<Derived>::PrepareForExecut
|
||||
vtkm::filter::FieldMetadata metaData(field);
|
||||
|
||||
//determine the field type first
|
||||
ResultDataSet result;
|
||||
typedef internal::ResolveFieldTypeAndExecute<Derived, DerivedPolicy, ResultDataSet> FunctorType;
|
||||
Result result;
|
||||
typedef internal::ResolveFieldTypeAndExecute<Derived, DerivedPolicy, Result> FunctorType;
|
||||
FunctorType functor(static_cast<Derived*>(this), input, metaData, policy, this->Tracker, result);
|
||||
|
||||
typedef vtkm::filter::FilterTraits<Derived> Traits;
|
||||
@ -160,7 +158,7 @@ inline VTKM_CONT ResultDataSet FilterDataSetWithField<Derived>::PrepareForExecut
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename Derived>
|
||||
inline VTKM_CONT bool FilterDataSetWithField<Derived>::MapFieldOntoOutput(
|
||||
ResultDataSet& result,
|
||||
Result& result,
|
||||
const vtkm::cont::Field& field)
|
||||
{
|
||||
return this->MapFieldOntoOutput(result, field, vtkm::filter::PolicyDefault());
|
||||
@ -170,12 +168,12 @@ inline VTKM_CONT bool FilterDataSetWithField<Derived>::MapFieldOntoOutput(
|
||||
template <typename Derived>
|
||||
template <typename DerivedPolicy>
|
||||
inline VTKM_CONT bool FilterDataSetWithField<Derived>::MapFieldOntoOutput(
|
||||
ResultDataSet& result,
|
||||
Result& result,
|
||||
const vtkm::cont::Field& field,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy)
|
||||
{
|
||||
bool valid = false;
|
||||
if (result.IsValid())
|
||||
if (result.IsDataSetValid())
|
||||
{
|
||||
vtkm::filter::FieldMetadata metaData(field);
|
||||
typedef internal::ResolveFieldTypeAndMap<Derived, DerivedPolicy> FunctorType;
|
||||
@ -187,7 +185,7 @@ inline VTKM_CONT bool FilterDataSetWithField<Derived>::MapFieldOntoOutput(
|
||||
|
||||
//the bool valid will be modified by the map algorithm to hold if the
|
||||
//mapping occurred or not. If the mapping was good a new field has been
|
||||
//added to the ResultDataSet that was passed in.
|
||||
//added to the Result that was passed in.
|
||||
return valid;
|
||||
}
|
||||
}
|
||||
|
@ -27,7 +27,7 @@
|
||||
#include <vtkm/cont/RuntimeDeviceTracker.h>
|
||||
|
||||
#include <vtkm/filter/PolicyBase.h>
|
||||
#include <vtkm/filter/ResultField.h>
|
||||
#include <vtkm/filter/Result.h>
|
||||
|
||||
namespace vtkm
|
||||
{
|
||||
@ -60,39 +60,39 @@ public:
|
||||
const vtkm::cont::RuntimeDeviceTracker& GetRuntimeDeviceTracker() const { return this->Tracker; }
|
||||
|
||||
VTKM_CONT
|
||||
ResultField Execute(const vtkm::cont::DataSet& input, const std::string& inFieldName);
|
||||
Result Execute(const vtkm::cont::DataSet& input, const std::string& inFieldName);
|
||||
|
||||
VTKM_CONT
|
||||
ResultField Execute(const vtkm::cont::DataSet& input, const vtkm::cont::Field& field);
|
||||
Result Execute(const vtkm::cont::DataSet& input, const vtkm::cont::Field& field);
|
||||
|
||||
VTKM_CONT
|
||||
ResultField Execute(const vtkm::cont::DataSet& input, const vtkm::cont::CoordinateSystem& field);
|
||||
Result Execute(const vtkm::cont::DataSet& input, const vtkm::cont::CoordinateSystem& field);
|
||||
|
||||
template <typename DerivedPolicy>
|
||||
VTKM_CONT ResultField Execute(const vtkm::cont::DataSet& input,
|
||||
const std::string& inFieldName,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy);
|
||||
VTKM_CONT Result Execute(const vtkm::cont::DataSet& input,
|
||||
const std::string& inFieldName,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy);
|
||||
|
||||
template <typename DerivedPolicy>
|
||||
VTKM_CONT ResultField Execute(const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::Field& field,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy);
|
||||
VTKM_CONT Result Execute(const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::Field& field,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy);
|
||||
|
||||
template <typename DerivedPolicy>
|
||||
VTKM_CONT ResultField Execute(const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::CoordinateSystem& field,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy);
|
||||
VTKM_CONT Result Execute(const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::CoordinateSystem& field,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy);
|
||||
|
||||
private:
|
||||
template <typename DerivedPolicy>
|
||||
VTKM_CONT ResultField PrepareForExecution(const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::Field& field,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy);
|
||||
VTKM_CONT Result PrepareForExecution(const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::Field& field,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy);
|
||||
|
||||
template <typename DerivedPolicy>
|
||||
VTKM_CONT ResultField PrepareForExecution(const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::CoordinateSystem& field,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy);
|
||||
VTKM_CONT Result PrepareForExecution(const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::CoordinateSystem& field,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy);
|
||||
|
||||
std::string OutputFieldName;
|
||||
vtkm::cont::RuntimeDeviceTracker Tracker;
|
||||
|
@ -51,25 +51,24 @@ inline VTKM_CONT FilterField<Derived>::~FilterField()
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename Derived>
|
||||
inline VTKM_CONT ResultField FilterField<Derived>::Execute(const vtkm::cont::DataSet& input,
|
||||
const std::string& inFieldName)
|
||||
inline VTKM_CONT Result FilterField<Derived>::Execute(const vtkm::cont::DataSet& input,
|
||||
const std::string& inFieldName)
|
||||
{
|
||||
return this->Execute(input, input.GetField(inFieldName), vtkm::filter::PolicyDefault());
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename Derived>
|
||||
inline VTKM_CONT ResultField FilterField<Derived>::Execute(const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::Field& field)
|
||||
inline VTKM_CONT Result FilterField<Derived>::Execute(const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::Field& field)
|
||||
{
|
||||
return this->Execute(input, field, vtkm::filter::PolicyDefault());
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename Derived>
|
||||
inline VTKM_CONT ResultField
|
||||
FilterField<Derived>::Execute(const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::CoordinateSystem& field)
|
||||
inline VTKM_CONT Result FilterField<Derived>::Execute(const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::CoordinateSystem& field)
|
||||
{
|
||||
return this->Execute(input, field, vtkm::filter::PolicyDefault());
|
||||
}
|
||||
@ -77,7 +76,7 @@ FilterField<Derived>::Execute(const vtkm::cont::DataSet& input,
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename Derived>
|
||||
template <typename DerivedPolicy>
|
||||
inline VTKM_CONT ResultField
|
||||
inline VTKM_CONT Result
|
||||
FilterField<Derived>::Execute(const vtkm::cont::DataSet& input,
|
||||
const std::string& inFieldName,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy)
|
||||
@ -88,7 +87,7 @@ FilterField<Derived>::Execute(const vtkm::cont::DataSet& input,
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename Derived>
|
||||
template <typename DerivedPolicy>
|
||||
inline VTKM_CONT ResultField
|
||||
inline VTKM_CONT Result
|
||||
FilterField<Derived>::Execute(const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::Field& field,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy)
|
||||
@ -99,7 +98,7 @@ FilterField<Derived>::Execute(const vtkm::cont::DataSet& input,
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename Derived>
|
||||
template <typename DerivedPolicy>
|
||||
inline VTKM_CONT ResultField
|
||||
inline VTKM_CONT Result
|
||||
FilterField<Derived>::Execute(const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::CoordinateSystem& field,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy)
|
||||
@ -112,15 +111,15 @@ FilterField<Derived>::Execute(const vtkm::cont::DataSet& input,
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename Derived>
|
||||
template <typename DerivedPolicy>
|
||||
inline VTKM_CONT ResultField
|
||||
inline VTKM_CONT Result
|
||||
FilterField<Derived>::PrepareForExecution(const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::Field& field,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy)
|
||||
{
|
||||
vtkm::filter::FieldMetadata metaData(field);
|
||||
ResultField result;
|
||||
Result result;
|
||||
|
||||
typedef internal::ResolveFieldTypeAndExecute<Derived, DerivedPolicy, ResultField> FunctorType;
|
||||
typedef internal::ResolveFieldTypeAndExecute<Derived, DerivedPolicy, Result> FunctorType;
|
||||
FunctorType functor(static_cast<Derived*>(this), input, metaData, policy, this->Tracker, result);
|
||||
|
||||
typedef vtkm::filter::FilterTraits<Derived> Traits;
|
||||
@ -131,7 +130,7 @@ FilterField<Derived>::PrepareForExecution(const vtkm::cont::DataSet& input,
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename Derived>
|
||||
template <typename DerivedPolicy>
|
||||
inline VTKM_CONT ResultField
|
||||
inline VTKM_CONT Result
|
||||
FilterField<Derived>::PrepareForExecution(const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::CoordinateSystem& field,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy)
|
||||
@ -140,9 +139,9 @@ FilterField<Derived>::PrepareForExecution(const vtkm::cont::DataSet& input,
|
||||
//the policy for the storage types and value types just for coordinate systems
|
||||
|
||||
vtkm::filter::FieldMetadata metaData(field);
|
||||
ResultField result;
|
||||
Result result;
|
||||
|
||||
typedef internal::ResolveFieldTypeAndExecute<Derived, DerivedPolicy, ResultField> FunctorType;
|
||||
typedef internal::ResolveFieldTypeAndExecute<Derived, DerivedPolicy, Result> FunctorType;
|
||||
FunctorType functor(static_cast<Derived*>(this), input, metaData, policy, this->Tracker, result);
|
||||
|
||||
typedef vtkm::filter::FilterTraits<Derived> Traits;
|
||||
|
@ -98,11 +98,11 @@ public:
|
||||
const std::string& GetQCriterionName() const { return this->QCriterionName; }
|
||||
|
||||
template <typename T, typename StorageType, typename DerivedPolicy, typename DeviceAdapter>
|
||||
vtkm::filter::ResultField DoExecute(const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& field,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
const DeviceAdapter& tag);
|
||||
vtkm::filter::Result DoExecute(const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& field,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
const DeviceAdapter& tag);
|
||||
|
||||
private:
|
||||
bool ComputePointGradient;
|
||||
|
@ -25,7 +25,7 @@ namespace
|
||||
{
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename HandleType>
|
||||
inline void add_field(vtkm::filter::ResultField& result,
|
||||
inline void add_field(vtkm::filter::Result& result,
|
||||
const HandleType& handle,
|
||||
const std::string name)
|
||||
{
|
||||
@ -80,7 +80,7 @@ Gradient::Gradient()
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename T, typename StorageType, typename DerivedPolicy, typename DeviceAdapter>
|
||||
inline vtkm::filter::ResultField Gradient::DoExecute(
|
||||
inline vtkm::filter::Result Gradient::DoExecute(
|
||||
const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& inField,
|
||||
const vtkm::filter::FieldMetadata& fieldMetadata,
|
||||
@ -92,7 +92,7 @@ inline vtkm::filter::ResultField Gradient::DoExecute(
|
||||
//we currently only support point fields, as we need to write the
|
||||
//worklet to efficiently map a cell field to the points of a cell
|
||||
//without doing a memory explosion
|
||||
return vtkm::filter::ResultField();
|
||||
return vtkm::filter::Result();
|
||||
}
|
||||
|
||||
const vtkm::cont::DynamicCellSet& cells = input.GetCellSet(this->GetActiveCellSetIndex());
|
||||
@ -141,7 +141,7 @@ inline vtkm::filter::ResultField Gradient::DoExecute(
|
||||
vtkm::cont::Field::AssociationEnum fieldAssociation(this->ComputePointGradient
|
||||
? vtkm::cont::Field::ASSOC_POINTS
|
||||
: vtkm::cont::Field::ASSOC_CELL_SET);
|
||||
vtkm::filter::ResultField result(input, outArray, outputName, fieldAssociation, cells.GetName());
|
||||
vtkm::filter::Result result(input, outArray, outputName, fieldAssociation, cells.GetName());
|
||||
|
||||
if (this->GetComputeDivergence() && isVector)
|
||||
{
|
||||
|
@ -54,12 +54,11 @@ public:
|
||||
vtkm::Range GetDataRange() const { return this->DataRange; }
|
||||
|
||||
template <typename T, typename StorageType, typename DerivedPolicy, typename DeviceAdapter>
|
||||
VTKM_CONT vtkm::filter::ResultField DoExecute(
|
||||
const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& field,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
const DeviceAdapter& tag);
|
||||
VTKM_CONT vtkm::filter::Result DoExecute(const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& field,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
const DeviceAdapter& tag);
|
||||
|
||||
private:
|
||||
vtkm::Id NumberOfBins;
|
||||
|
@ -37,7 +37,7 @@ inline VTKM_CONT Histogram::Histogram()
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename T, typename StorageType, typename DerivedPolicy, typename DeviceAdapter>
|
||||
inline VTKM_CONT vtkm::filter::ResultField Histogram::DoExecute(
|
||||
inline VTKM_CONT vtkm::filter::Result Histogram::DoExecute(
|
||||
const vtkm::cont::DataSet& inDataSet,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& field,
|
||||
const vtkm::filter::FieldMetadata& fieldMetadata,
|
||||
@ -51,11 +51,11 @@ inline VTKM_CONT vtkm::filter::ResultField Histogram::DoExecute(
|
||||
worklet.Run(field, this->NumberOfBins, this->DataRange, delta, binArray, device);
|
||||
|
||||
this->BinDelta = static_cast<vtkm::Float64>(delta);
|
||||
return vtkm::filter::ResultField(inDataSet,
|
||||
binArray,
|
||||
this->GetOutputFieldName(),
|
||||
fieldMetadata.GetAssociation(),
|
||||
fieldMetadata.GetCellSetName());
|
||||
return vtkm::filter::Result(inDataSet,
|
||||
binArray,
|
||||
this->GetOutputFieldName(),
|
||||
fieldMetadata.GetAssociation(),
|
||||
fieldMetadata.GetCellSetName());
|
||||
}
|
||||
}
|
||||
} // namespace vtkm::filter
|
||||
|
@ -106,17 +106,16 @@ public:
|
||||
const std::string& GetNormalArrayName() const { return this->NormalArrayName; }
|
||||
|
||||
template <typename T, typename StorageType, typename DerivedPolicy, typename DeviceAdapter>
|
||||
VTKM_CONT vtkm::filter::ResultDataSet DoExecute(
|
||||
const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& field,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
const DeviceAdapter& tag);
|
||||
VTKM_CONT vtkm::filter::Result DoExecute(const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& field,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
const DeviceAdapter& tag);
|
||||
|
||||
//Map a new field onto the resulting dataset after running the filter
|
||||
//this call is only valid
|
||||
template <typename T, typename StorageType, typename DerivedPolicy, typename DeviceAdapter>
|
||||
VTKM_CONT bool DoMapField(vtkm::filter::ResultDataSet& result,
|
||||
VTKM_CONT bool DoMapField(vtkm::filter::Result& result,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& input,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
|
@ -102,7 +102,7 @@ inline vtkm::Float64 MarchingCubes::GetIsoValue(vtkm::Id index) const
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename T, typename StorageType, typename DerivedPolicy, typename DeviceAdapter>
|
||||
inline VTKM_CONT vtkm::filter::ResultDataSet MarchingCubes::DoExecute(
|
||||
inline VTKM_CONT vtkm::filter::Result MarchingCubes::DoExecute(
|
||||
const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& field,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
@ -113,12 +113,12 @@ inline VTKM_CONT vtkm::filter::ResultDataSet MarchingCubes::DoExecute(
|
||||
{
|
||||
//todo: we need to mark this as a failure of input, not a failure
|
||||
//of the algorithm
|
||||
return vtkm::filter::ResultDataSet();
|
||||
return vtkm::filter::Result();
|
||||
}
|
||||
|
||||
if (this->IsoValues.size() == 0)
|
||||
{
|
||||
return vtkm::filter::ResultDataSet();
|
||||
return vtkm::filter::Result();
|
||||
}
|
||||
|
||||
// Check the fields of the dataset to see what kinds of fields are present so
|
||||
@ -212,13 +212,13 @@ inline VTKM_CONT vtkm::filter::ResultDataSet MarchingCubes::DoExecute(
|
||||
this->Worklet.ReleaseCellMapArrays();
|
||||
}
|
||||
|
||||
return vtkm::filter::ResultDataSet(output);
|
||||
return vtkm::filter::Result(output);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename T, typename StorageType, typename DerivedPolicy, typename DeviceAdapter>
|
||||
inline VTKM_CONT bool MarchingCubes::DoMapField(
|
||||
vtkm::filter::ResultDataSet& result,
|
||||
vtkm::filter::Result& result,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& input,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>&,
|
||||
|
@ -52,14 +52,13 @@ public:
|
||||
void SetStride(vtkm::Id& stride) { this->Stride = stride; }
|
||||
|
||||
template <typename DerivedPolicy, typename DeviceAdapter>
|
||||
VTKM_CONT vtkm::filter::ResultDataSet DoExecute(
|
||||
const vtkm::cont::DataSet& input,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
const DeviceAdapter& tag);
|
||||
VTKM_CONT vtkm::filter::Result DoExecute(const vtkm::cont::DataSet& input,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
const DeviceAdapter& tag);
|
||||
|
||||
//Map a new field onto the resulting dataset after running the filter
|
||||
template <typename T, typename StorageType, typename DerivedPolicy, typename DeviceAdapter>
|
||||
VTKM_CONT bool DoMapField(vtkm::filter::ResultDataSet& result,
|
||||
VTKM_CONT bool DoMapField(vtkm::filter::Result& result,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& input,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
|
@ -59,7 +59,7 @@ inline VTKM_CONT Mask::Mask()
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename DerivedPolicy, typename DeviceAdapter>
|
||||
inline VTKM_CONT vtkm::filter::ResultDataSet Mask::DoExecute(
|
||||
inline VTKM_CONT vtkm::filter::Result Mask::DoExecute(
|
||||
const vtkm::cont::DataSet& input,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
const DeviceAdapter&)
|
||||
@ -79,7 +79,7 @@ inline VTKM_CONT vtkm::filter::ResultDataSet Mask::DoExecute(
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename T, typename StorageType, typename DerivedPolicy, typename DeviceAdapter>
|
||||
inline VTKM_CONT bool Mask::DoMapField(vtkm::filter::ResultDataSet& result,
|
||||
inline VTKM_CONT bool Mask::DoMapField(vtkm::filter::Result& result,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& input,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>&,
|
||||
|
@ -52,14 +52,13 @@ public:
|
||||
void SetStride(vtkm::Id stride) { this->Stride = stride; }
|
||||
|
||||
template <typename DerivedPolicy, typename DeviceAdapter>
|
||||
VTKM_CONT vtkm::filter::ResultDataSet DoExecute(
|
||||
const vtkm::cont::DataSet& input,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
const DeviceAdapter& tag);
|
||||
VTKM_CONT vtkm::filter::Result DoExecute(const vtkm::cont::DataSet& input,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
const DeviceAdapter& tag);
|
||||
|
||||
//Map a new field onto the resulting dataset after running the filter
|
||||
template <typename T, typename StorageType, typename DerivedPolicy, typename DeviceAdapter>
|
||||
VTKM_CONT bool DoMapField(vtkm::filter::ResultDataSet& result,
|
||||
VTKM_CONT bool DoMapField(vtkm::filter::Result& result,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& input,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
|
@ -51,7 +51,7 @@ inline VTKM_CONT MaskPoints::MaskPoints()
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename DerivedPolicy, typename DeviceAdapter>
|
||||
inline VTKM_CONT vtkm::filter::ResultDataSet MaskPoints::DoExecute(
|
||||
inline VTKM_CONT vtkm::filter::Result MaskPoints::DoExecute(
|
||||
const vtkm::cont::DataSet& input,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
const DeviceAdapter& device)
|
||||
@ -74,19 +74,19 @@ inline VTKM_CONT vtkm::filter::ResultDataSet MaskPoints::DoExecute(
|
||||
if (this->CompactPoints)
|
||||
{
|
||||
this->Compactor.SetCompactPointFields(true);
|
||||
vtkm::filter::ResultDataSet result;
|
||||
vtkm::filter::Result result;
|
||||
result = this->Compactor.DoExecute(output, GetCellSetSingleTypePolicy(policy), DeviceAdapter());
|
||||
return result;
|
||||
}
|
||||
else
|
||||
{
|
||||
return vtkm::filter::ResultDataSet(output);
|
||||
return vtkm::filter::Result(output);
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename T, typename StorageType, typename DerivedPolicy, typename DeviceAdapter>
|
||||
inline VTKM_CONT bool MaskPoints::DoMapField(vtkm::filter::ResultDataSet& result,
|
||||
inline VTKM_CONT bool MaskPoints::DoMapField(vtkm::filter::Result& result,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& input,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
|
@ -41,12 +41,11 @@ public:
|
||||
PointAverage();
|
||||
|
||||
template <typename T, typename StorageType, typename DerivedPolicy, typename DeviceAdapter>
|
||||
VTKM_CONT vtkm::filter::ResultField DoExecute(
|
||||
const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& field,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
const DeviceAdapter& tag);
|
||||
VTKM_CONT vtkm::filter::Result DoExecute(const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& field,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
const DeviceAdapter& tag);
|
||||
|
||||
private:
|
||||
vtkm::worklet::PointAverage Worklet;
|
||||
|
@ -36,7 +36,7 @@ inline VTKM_CONT PointAverage::PointAverage()
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename T, typename StorageType, typename DerivedPolicy, typename DeviceAdapter>
|
||||
inline VTKM_CONT vtkm::filter::ResultField PointAverage::DoExecute(
|
||||
inline VTKM_CONT vtkm::filter::Result PointAverage::DoExecute(
|
||||
const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& inField,
|
||||
const vtkm::filter::FieldMetadata& fieldMetadata,
|
||||
@ -45,7 +45,7 @@ inline VTKM_CONT vtkm::filter::ResultField PointAverage::DoExecute(
|
||||
{
|
||||
if (!fieldMetadata.IsCellField())
|
||||
{
|
||||
return vtkm::filter::ResultField();
|
||||
return vtkm::filter::Result();
|
||||
}
|
||||
|
||||
vtkm::cont::DynamicCellSet cellSet = input.GetCellSet(this->GetActiveCellSetIndex());
|
||||
@ -66,7 +66,7 @@ inline VTKM_CONT vtkm::filter::ResultField PointAverage::DoExecute(
|
||||
outputName = fieldMetadata.GetName();
|
||||
}
|
||||
|
||||
return vtkm::filter::ResultField(
|
||||
return vtkm::filter::Result(
|
||||
input, outArray, outputName, vtkm::cont::Field::ASSOC_POINTS, cellSet.GetName());
|
||||
}
|
||||
}
|
||||
|
@ -51,12 +51,11 @@ public:
|
||||
void SetRange(vtkm::Float64 low, vtkm::Float64 high);
|
||||
|
||||
template <typename T, typename StorageType, typename DerivedPolicy, typename DeviceAdapter>
|
||||
VTKM_CONT vtkm::filter::ResultField DoExecute(
|
||||
const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& field,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
const DeviceAdapter& tag);
|
||||
VTKM_CONT vtkm::filter::Result DoExecute(const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& field,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
const DeviceAdapter& tag);
|
||||
|
||||
private:
|
||||
vtkm::worklet::PointElevation Worklet;
|
||||
|
@ -54,7 +54,7 @@ inline VTKM_CONT void PointElevation::SetRange(vtkm::Float64 low, vtkm::Float64
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename T, typename StorageType, typename DerivedPolicy, typename DeviceAdapter>
|
||||
inline VTKM_CONT vtkm::filter::ResultField PointElevation::DoExecute(
|
||||
inline VTKM_CONT vtkm::filter::Result PointElevation::DoExecute(
|
||||
const vtkm::cont::DataSet& inDataSet,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& field,
|
||||
const vtkm::filter::FieldMetadata& fieldMetadata,
|
||||
@ -69,11 +69,11 @@ inline VTKM_CONT vtkm::filter::ResultField PointElevation::DoExecute(
|
||||
//that the dispatcher should do
|
||||
dispatcher.Invoke(field, outArray);
|
||||
|
||||
return vtkm::filter::ResultField(inDataSet,
|
||||
outArray,
|
||||
this->GetOutputFieldName(),
|
||||
fieldMetadata.GetAssociation(),
|
||||
fieldMetadata.GetCellSetName());
|
||||
return vtkm::filter::Result(inDataSet,
|
||||
outArray,
|
||||
this->GetOutputFieldName(),
|
||||
fieldMetadata.GetAssociation(),
|
||||
fieldMetadata.GetCellSetName());
|
||||
}
|
||||
}
|
||||
} // namespace vtkm::filter
|
||||
|
@ -18,11 +18,11 @@
|
||||
// this software.
|
||||
//============================================================================
|
||||
|
||||
#ifndef vtk_m_filter_ResultField_h
|
||||
#define vtk_m_filter_ResultField_h
|
||||
|
||||
#include <vtkm/filter/ResultBase.h>
|
||||
#ifndef vtk_m_filter_Result_h
|
||||
#define vtk_m_filter_Result_h
|
||||
|
||||
#include <vtkm/cont/DataSet.h>
|
||||
#include <vtkm/cont/ErrorBadValue.h>
|
||||
#include <vtkm/cont/Field.h>
|
||||
|
||||
namespace vtkm
|
||||
@ -30,29 +30,49 @@ namespace vtkm
|
||||
namespace filter
|
||||
{
|
||||
|
||||
/// \brief Results for filters that create a field
|
||||
/// \brief Storage for DataSet and/or Field results returned from a filter.
|
||||
///
|
||||
/// \c ResultField contains the results for a filter that generates a new
|
||||
/// field. The geometry of the underlying data is a shallow copy of the
|
||||
/// original input.
|
||||
/// \c Result can store either a \c DataSet, or a \c DataSet and \c Field, depending
|
||||
/// on the type of filter that produced it. Use \c IsDataSetValid() and
|
||||
/// \c IsFieldValid() to identify what is stored in the \c Result.
|
||||
///
|
||||
/// This class also holds the field that has been added.
|
||||
/// The \c DataSet and \c Field may be retrieved using \c GetDataSet() and
|
||||
/// \c GetField() respectively. Attempts to retrieve an invalid result using
|
||||
/// these methods will throw an \c vtkm::cont::ErrorValue exception.
|
||||
///
|
||||
class ResultField : public vtkm::filter::ResultBase
|
||||
class Result
|
||||
{
|
||||
public:
|
||||
VTKM_CONT
|
||||
ResultField() {}
|
||||
Result()
|
||||
: DataSetValid(false)
|
||||
, FieldValid(false)
|
||||
, FieldAssociation(vtkm::cont::Field::ASSOC_ANY)
|
||||
{
|
||||
}
|
||||
|
||||
/// Use this constructor for DataSet filters (not Field filters).
|
||||
///
|
||||
VTKM_CONT
|
||||
Result(const vtkm::cont::DataSet& dataSet)
|
||||
: DataSetValid(true)
|
||||
, Data(dataSet)
|
||||
, FieldValid(false)
|
||||
, FieldAssociation(vtkm::cont::Field::ASSOC_ANY)
|
||||
{
|
||||
}
|
||||
|
||||
/// Use this constructor if the field has already been added to the data set.
|
||||
/// In this case, just tell us what the field name is (and optionally its
|
||||
/// association).
|
||||
///
|
||||
VTKM_CONT
|
||||
ResultField(const vtkm::cont::DataSet& dataSet,
|
||||
const std::string& fieldName,
|
||||
vtkm::cont::Field::AssociationEnum fieldAssociation = vtkm::cont::Field::ASSOC_ANY)
|
||||
: ResultBase(dataSet)
|
||||
Result(const vtkm::cont::DataSet& dataSet,
|
||||
const std::string& fieldName,
|
||||
vtkm::cont::Field::AssociationEnum fieldAssociation = vtkm::cont::Field::ASSOC_ANY)
|
||||
: DataSetValid(true)
|
||||
, Data(dataSet)
|
||||
, FieldValid(true)
|
||||
, FieldName(fieldName)
|
||||
, FieldAssociation(fieldAssociation)
|
||||
{
|
||||
@ -60,21 +80,20 @@ public:
|
||||
VTKM_ASSERT(dataSet.HasField(fieldName, fieldAssociation));
|
||||
}
|
||||
|
||||
/// Use this constructor if you have build a \c Field object. An output
|
||||
/// Use this constructor if you have built a \c Field object. An output
|
||||
/// \c DataSet will be created by adding the field to the input.
|
||||
///
|
||||
VTKM_CONT
|
||||
ResultField(const vtkm::cont::DataSet& inDataSet, const vtkm::cont::Field& field)
|
||||
: FieldName(field.GetName())
|
||||
Result(const vtkm::cont::DataSet& inDataSet, const vtkm::cont::Field& field)
|
||||
: DataSetValid(true)
|
||||
, Data(vtkm::cont::DataSet(inDataSet))
|
||||
, FieldValid(true)
|
||||
, FieldName(field.GetName())
|
||||
, FieldAssociation(field.GetAssociation())
|
||||
{
|
||||
this->Data.AddField(field);
|
||||
|
||||
VTKM_ASSERT(this->FieldName != "");
|
||||
|
||||
vtkm::cont::DataSet outDataSet = inDataSet;
|
||||
outDataSet.AddField(field);
|
||||
this->SetDataSet(outDataSet);
|
||||
|
||||
// Sanity check.
|
||||
VTKM_ASSERT(this->GetDataSet().HasField(this->FieldName, this->FieldAssociation));
|
||||
}
|
||||
|
||||
@ -86,34 +105,33 @@ public:
|
||||
/// for \c ASSOC_WHOLE_MESH and \c ASSOC_POINTS associations.
|
||||
///
|
||||
template <typename T, typename Storage>
|
||||
VTKM_CONT ResultField(const vtkm::cont::DataSet& inDataSet,
|
||||
const vtkm::cont::ArrayHandle<T, Storage>& fieldArray,
|
||||
const std::string& fieldName,
|
||||
vtkm::cont::Field::AssociationEnum fieldAssociation,
|
||||
const std::string& elementSetName = "")
|
||||
: FieldName(fieldName)
|
||||
VTKM_CONT Result(const vtkm::cont::DataSet& inDataSet,
|
||||
const vtkm::cont::ArrayHandle<T, Storage>& fieldArray,
|
||||
const std::string& fieldName,
|
||||
vtkm::cont::Field::AssociationEnum fieldAssociation,
|
||||
const std::string& elementSetName = "")
|
||||
: DataSetValid(true)
|
||||
, Data(vtkm::cont::DataSet(inDataSet))
|
||||
, FieldValid(true)
|
||||
, FieldName(fieldName)
|
||||
, FieldAssociation(fieldAssociation)
|
||||
{
|
||||
VTKM_ASSERT(fieldName != "");
|
||||
VTKM_ASSERT(fieldAssociation != vtkm::cont::Field::ASSOC_ANY);
|
||||
VTKM_ASSERT(fieldAssociation != vtkm::cont::Field::ASSOC_LOGICAL_DIM);
|
||||
|
||||
vtkm::cont::DataSet outDataSet = inDataSet;
|
||||
|
||||
if ((fieldAssociation == vtkm::cont::Field::ASSOC_WHOLE_MESH) ||
|
||||
(fieldAssociation == vtkm::cont::Field::ASSOC_POINTS))
|
||||
{
|
||||
vtkm::cont::Field field(fieldName, fieldAssociation, fieldArray);
|
||||
outDataSet.AddField(field);
|
||||
this->Data.AddField(field);
|
||||
}
|
||||
else
|
||||
{
|
||||
vtkm::cont::Field field(fieldName, fieldAssociation, elementSetName, fieldArray);
|
||||
outDataSet.AddField(field);
|
||||
this->Data.AddField(field);
|
||||
}
|
||||
|
||||
this->SetDataSet(outDataSet);
|
||||
|
||||
// Sanity check.
|
||||
VTKM_ASSERT(this->GetDataSet().HasField(this->FieldName, this->FieldAssociation));
|
||||
}
|
||||
@ -126,41 +144,73 @@ public:
|
||||
/// for \c ASSOC_WHOLE_MESH and \c ASSOC_POINTS associations.
|
||||
///
|
||||
VTKM_CONT
|
||||
ResultField(const vtkm::cont::DataSet& inDataSet,
|
||||
const vtkm::cont::DynamicArrayHandle& fieldArray,
|
||||
const std::string& fieldName,
|
||||
vtkm::cont::Field::AssociationEnum fieldAssociation,
|
||||
const std::string& elementSetName = "")
|
||||
: FieldName(fieldName)
|
||||
Result(const vtkm::cont::DataSet& inDataSet,
|
||||
const vtkm::cont::DynamicArrayHandle& fieldArray,
|
||||
const std::string& fieldName,
|
||||
vtkm::cont::Field::AssociationEnum fieldAssociation,
|
||||
const std::string& elementSetName = "")
|
||||
: DataSetValid(true)
|
||||
, Data(vtkm::cont::DataSet(inDataSet))
|
||||
, FieldValid(true)
|
||||
, FieldName(fieldName)
|
||||
, FieldAssociation(fieldAssociation)
|
||||
{
|
||||
VTKM_ASSERT(fieldName != "");
|
||||
VTKM_ASSERT(fieldAssociation != vtkm::cont::Field::ASSOC_ANY);
|
||||
VTKM_ASSERT(fieldAssociation != vtkm::cont::Field::ASSOC_LOGICAL_DIM);
|
||||
|
||||
vtkm::cont::DataSet outDataSet = inDataSet;
|
||||
|
||||
if ((fieldAssociation == vtkm::cont::Field::ASSOC_WHOLE_MESH) ||
|
||||
(fieldAssociation == vtkm::cont::Field::ASSOC_POINTS))
|
||||
{
|
||||
vtkm::cont::Field field(fieldName, fieldAssociation, fieldArray);
|
||||
outDataSet.AddField(field);
|
||||
this->Data.AddField(field);
|
||||
}
|
||||
else
|
||||
{
|
||||
vtkm::cont::Field field(fieldName, fieldAssociation, elementSetName, fieldArray);
|
||||
outDataSet.AddField(field);
|
||||
this->Data.AddField(field);
|
||||
}
|
||||
|
||||
this->SetDataSet(outDataSet);
|
||||
|
||||
// Sanity check.
|
||||
VTKM_ASSERT(this->GetDataSet().HasField(this->FieldName, this->FieldAssociation));
|
||||
}
|
||||
|
||||
/// Returns true if these results are from a successful execution of a
|
||||
/// filter.
|
||||
///
|
||||
VTKM_CONT
|
||||
bool IsDataSetValid() const { return this->DataSetValid; }
|
||||
|
||||
/// Returns the results of the filter in terms of a \c DataSet.
|
||||
///
|
||||
VTKM_CONT
|
||||
const vtkm::cont::DataSet& GetDataSet() const
|
||||
{
|
||||
if (!this->DataSetValid)
|
||||
{
|
||||
throw vtkm::cont::ErrorBadValue("Result object does not contain a result dataset.");
|
||||
}
|
||||
|
||||
return this->Data;
|
||||
}
|
||||
|
||||
/// Returns the results of the filter in terms of a writable \c DataSet.
|
||||
VTKM_CONT
|
||||
vtkm::cont::DataSet& GetDataSet() { return this->Data; }
|
||||
|
||||
VTKM_CONT
|
||||
bool IsFieldValid() const { return this->FieldValid; }
|
||||
|
||||
VTKM_CONT
|
||||
const vtkm::cont::Field& GetField() const
|
||||
{
|
||||
if (!this->FieldValid)
|
||||
{
|
||||
throw vtkm::cont::ErrorBadValue(
|
||||
"Result object does not contain a result field, likely because it "
|
||||
"came from a DataSet filter.");
|
||||
}
|
||||
|
||||
return this->GetDataSet().GetField(this->FieldName, this->FieldAssociation);
|
||||
}
|
||||
|
||||
@ -179,10 +229,14 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
bool DataSetValid;
|
||||
vtkm::cont::DataSet Data;
|
||||
|
||||
bool FieldValid;
|
||||
std::string FieldName;
|
||||
vtkm::cont::Field::AssociationEnum FieldAssociation;
|
||||
};
|
||||
}
|
||||
} // namespace vtkm::filter
|
||||
|
||||
#endif //vtk_m_filter_ResultField_h
|
||||
#endif //vtk_m_filter_Result_h
|
@ -1,90 +0,0 @@
|
||||
//============================================================================
|
||||
// Copyright (c) Kitware, Inc.
|
||||
// All rights reserved.
|
||||
// See LICENSE.txt for details.
|
||||
// This software is distributed WITHOUT ANY WARRANTY; without even
|
||||
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
// PURPOSE. See the above copyright notice for more information.
|
||||
//
|
||||
// Copyright 2016 Sandia Corporation.
|
||||
// Copyright 2016 UT-Battelle, LLC.
|
||||
// Copyright 2016 Los Alamos National Security.
|
||||
//
|
||||
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
|
||||
// the U.S. Government retains certain rights in this software.
|
||||
//
|
||||
// Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National
|
||||
// Laboratory (LANL), the U.S. Government retains certain rights in
|
||||
// this software.
|
||||
//============================================================================
|
||||
|
||||
#ifndef vtk_m_filter_ResultBase_h
|
||||
#define vtk_m_filter_ResultBase_h
|
||||
|
||||
#include <vtkm/cont/DataSet.h>
|
||||
|
||||
namespace vtkm
|
||||
{
|
||||
namespace filter
|
||||
{
|
||||
|
||||
/// \brief Base class for result returned from a filter.
|
||||
///
|
||||
/// \c ResultBase is the base class for the return value from any filter. It
|
||||
/// contains a valid flag that signals whether the filter successfully
|
||||
/// executed. Also, every filter produces some data on a data set. The
|
||||
/// resulting data set is also available from this base clase.
|
||||
///
|
||||
/// Subclasses may define additional data (usually subparts of the data set)
|
||||
/// specific to the type of operation.
|
||||
///
|
||||
class ResultBase
|
||||
{
|
||||
public:
|
||||
/// Returns true if these results are from a successful execution of a
|
||||
/// filter.
|
||||
///
|
||||
VTKM_CONT
|
||||
bool IsValid() const { return this->Valid; }
|
||||
|
||||
/// Returns the results of the filter in terms of a \c DataSet.
|
||||
///
|
||||
VTKM_CONT
|
||||
const vtkm::cont::DataSet& GetDataSet() const { return this->Data; }
|
||||
|
||||
/// Returns the results of the filter in terms of a writable \c DataSet.
|
||||
VTKM_CONT
|
||||
vtkm::cont::DataSet& GetDataSet() { return this->Data; }
|
||||
|
||||
protected:
|
||||
VTKM_CONT
|
||||
ResultBase()
|
||||
: Valid(false)
|
||||
{
|
||||
}
|
||||
|
||||
VTKM_CONT
|
||||
ResultBase(const vtkm::cont::DataSet& dataSet)
|
||||
: Valid(true)
|
||||
, Data(dataSet)
|
||||
{
|
||||
}
|
||||
|
||||
VTKM_CONT
|
||||
void SetValid(bool valid) { this->Valid = valid; }
|
||||
|
||||
VTKM_CONT
|
||||
void SetDataSet(const vtkm::cont::DataSet& dataSet)
|
||||
{
|
||||
this->Data = dataSet;
|
||||
this->SetValid(true);
|
||||
}
|
||||
|
||||
private:
|
||||
bool Valid;
|
||||
vtkm::cont::DataSet Data;
|
||||
};
|
||||
}
|
||||
} // namespace vtkm::filter
|
||||
|
||||
#endif //vtk_m_filter_ResultBase_h
|
@ -1,56 +0,0 @@
|
||||
//============================================================================
|
||||
// Copyright (c) Kitware, Inc.
|
||||
// All rights reserved.
|
||||
// See LICENSE.txt for details.
|
||||
// This software is distributed WITHOUT ANY WARRANTY; without even
|
||||
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
// PURPOSE. See the above copyright notice for more information.
|
||||
//
|
||||
// Copyright 2016 Sandia Corporation.
|
||||
// Copyright 2016 UT-Battelle, LLC.
|
||||
// Copyright 2016 Los Alamos National Security.
|
||||
//
|
||||
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
|
||||
// the U.S. Government retains certain rights in this software.
|
||||
//
|
||||
// Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National
|
||||
// Laboratory (LANL), the U.S. Government retains certain rights in
|
||||
// this software.
|
||||
//============================================================================
|
||||
|
||||
#ifndef vtk_m_filter_ResultDataSet_h
|
||||
#define vtk_m_filter_ResultDataSet_h
|
||||
|
||||
#include <vtkm/filter/ResultBase.h>
|
||||
|
||||
namespace vtkm
|
||||
{
|
||||
namespace filter
|
||||
{
|
||||
|
||||
/// \brief Results for filters that generate new geometry
|
||||
///
|
||||
/// \c ResultDataSet contains the results for a filter that generates
|
||||
/// a wholly new data set (new geometry). Typically little if any data
|
||||
/// is shared between the filter input and this result.
|
||||
///
|
||||
/// Also, data set filters often have secondary operations on the resulting
|
||||
/// data structure (such as interpolating fields). Thus, this class also
|
||||
/// allows you to get modifiable versions of the data set.
|
||||
///
|
||||
class ResultDataSet : public vtkm::filter::ResultBase
|
||||
{
|
||||
public:
|
||||
VTKM_CONT
|
||||
ResultDataSet() {}
|
||||
|
||||
VTKM_CONT
|
||||
ResultDataSet(const vtkm::cont::DataSet& dataSet)
|
||||
: ResultBase(dataSet)
|
||||
{
|
||||
}
|
||||
};
|
||||
}
|
||||
} // namespace vtkm::filter
|
||||
|
||||
#endif //vtk_m_filter_ResultDataSet_h
|
@ -66,15 +66,15 @@ public:
|
||||
|
||||
/// Execute the filter using the active coordinate system.
|
||||
VTKM_CONT
|
||||
vtkm::filter::ResultField Execute(const vtkm::cont::DataSet& input);
|
||||
vtkm::filter::Result Execute(const vtkm::cont::DataSet& input);
|
||||
|
||||
/// Execute the filter using the active coordinate system.
|
||||
template <typename DerivedPolicy>
|
||||
VTKM_CONT ResultField Execute(const vtkm::cont::DataSet& input,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy);
|
||||
VTKM_CONT Result Execute(const vtkm::cont::DataSet& input,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy);
|
||||
|
||||
template <typename T, typename StorageType, typename DerivedPolicy, typename DeviceAdapter>
|
||||
vtkm::filter::ResultField DoExecute(
|
||||
vtkm::filter::Result DoExecute(
|
||||
const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::ArrayHandle<vtkm::Vec<T, 3>, StorageType>& points,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
|
@ -68,13 +68,13 @@ inline SurfaceNormals::SurfaceNormals()
|
||||
{
|
||||
}
|
||||
|
||||
inline vtkm::filter::ResultField SurfaceNormals::Execute(const vtkm::cont::DataSet& input)
|
||||
inline vtkm::filter::Result SurfaceNormals::Execute(const vtkm::cont::DataSet& input)
|
||||
{
|
||||
return this->Execute(input, input.GetCoordinateSystem(this->GetActiveCoordinateSystemIndex()));
|
||||
}
|
||||
|
||||
template <typename DerivedPolicy>
|
||||
inline vtkm::filter::ResultField SurfaceNormals::Execute(
|
||||
inline vtkm::filter::Result SurfaceNormals::Execute(
|
||||
const vtkm::cont::DataSet& input,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy)
|
||||
{
|
||||
@ -83,7 +83,7 @@ inline vtkm::filter::ResultField SurfaceNormals::Execute(
|
||||
}
|
||||
|
||||
template <typename T, typename StorageType, typename DerivedPolicy, typename DeviceAdapter>
|
||||
inline vtkm::filter::ResultField SurfaceNormals::DoExecute(
|
||||
inline vtkm::filter::Result SurfaceNormals::DoExecute(
|
||||
const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::ArrayHandle<vtkm::Vec<T, 3>, StorageType>& points,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
@ -94,7 +94,7 @@ inline vtkm::filter::ResultField SurfaceNormals::DoExecute(
|
||||
|
||||
if (!this->GenerateCellNormals && !this->GeneratePointNormals)
|
||||
{
|
||||
return vtkm::filter::ResultField();
|
||||
return vtkm::filter::Result();
|
||||
}
|
||||
|
||||
const auto& cellset = input.GetCellSet(this->GetActiveCellSetIndex());
|
||||
@ -104,17 +104,17 @@ inline vtkm::filter::ResultField SurfaceNormals::DoExecute(
|
||||
faceted.SetNormalize(this->NormalizeCellNormals);
|
||||
faceted.Run(vtkm::filter::ApplyPolicy(cellset, policy), points, faceNormals, device);
|
||||
|
||||
vtkm::filter::ResultField result;
|
||||
vtkm::filter::Result result;
|
||||
if (this->GeneratePointNormals)
|
||||
{
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::FloatDefault, 3>> pointNormals;
|
||||
vtkm::worklet::SmoothSurfaceNormals smooth;
|
||||
smooth.Run(vtkm::filter::ApplyPolicy(cellset, policy), faceNormals, pointNormals, device);
|
||||
|
||||
result = vtkm::filter::ResultField(input,
|
||||
pointNormals,
|
||||
internal::ComputePointNormalsName(this),
|
||||
vtkm::cont::Field::ASSOC_POINTS);
|
||||
result = vtkm::filter::Result(input,
|
||||
pointNormals,
|
||||
internal::ComputePointNormalsName(this),
|
||||
vtkm::cont::Field::ASSOC_POINTS);
|
||||
if (this->GenerateCellNormals)
|
||||
{
|
||||
result.GetDataSet().AddField(vtkm::cont::Field(internal::ComputeCellNormalsName(this),
|
||||
@ -125,11 +125,11 @@ inline vtkm::filter::ResultField SurfaceNormals::DoExecute(
|
||||
}
|
||||
else
|
||||
{
|
||||
result = vtkm::filter::ResultField(input,
|
||||
faceNormals,
|
||||
internal::ComputeCellNormalsName(this),
|
||||
vtkm::cont::Field::ASSOC_CELL_SET,
|
||||
cellset.GetName());
|
||||
result = vtkm::filter::Result(input,
|
||||
faceNormals,
|
||||
internal::ComputeCellNormalsName(this),
|
||||
vtkm::cont::Field::ASSOC_CELL_SET,
|
||||
cellset.GetName());
|
||||
}
|
||||
|
||||
return result;
|
||||
|
@ -36,14 +36,13 @@ public:
|
||||
Tetrahedralize();
|
||||
|
||||
template <typename DerivedPolicy, typename DeviceAdapter>
|
||||
VTKM_CONT vtkm::filter::ResultDataSet DoExecute(
|
||||
const vtkm::cont::DataSet& input,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
const DeviceAdapter& tag);
|
||||
VTKM_CONT vtkm::filter::Result DoExecute(const vtkm::cont::DataSet& input,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
const DeviceAdapter& tag);
|
||||
|
||||
// Map new field onto the resulting dataset after running the filter
|
||||
template <typename T, typename StorageType, typename DerivedPolicy, typename DeviceAdapter>
|
||||
VTKM_CONT bool DoMapField(vtkm::filter::ResultDataSet& result,
|
||||
VTKM_CONT bool DoMapField(vtkm::filter::Result& result,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& input,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
|
@ -58,7 +58,7 @@ inline VTKM_CONT Tetrahedralize::Tetrahedralize()
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename DerivedPolicy, typename DeviceAdapter>
|
||||
inline VTKM_CONT vtkm::filter::ResultDataSet Tetrahedralize::DoExecute(
|
||||
inline VTKM_CONT vtkm::filter::Result Tetrahedralize::DoExecute(
|
||||
const vtkm::cont::DataSet& input,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
const DeviceAdapter&)
|
||||
@ -75,13 +75,13 @@ inline VTKM_CONT vtkm::filter::ResultDataSet Tetrahedralize::DoExecute(
|
||||
output.AddCellSet(outCellSet);
|
||||
output.AddCoordinateSystem(input.GetCoordinateSystem(this->GetActiveCoordinateSystemIndex()));
|
||||
|
||||
return vtkm::filter::ResultDataSet(output);
|
||||
return vtkm::filter::Result(output);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename T, typename StorageType, typename DerivedPolicy, typename DeviceAdapter>
|
||||
inline VTKM_CONT bool Tetrahedralize::DoMapField(
|
||||
vtkm::filter::ResultDataSet& result,
|
||||
vtkm::filter::Result& result,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& input,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>&,
|
||||
|
@ -55,17 +55,16 @@ public:
|
||||
vtkm::Float64 GetUpperThreshold() const { return this->UpperValue; }
|
||||
|
||||
template <typename T, typename StorageType, typename DerivedPolicy, typename DeviceAdapter>
|
||||
VTKM_CONT vtkm::filter::ResultDataSet DoExecute(
|
||||
const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& field,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
const DeviceAdapter& tag);
|
||||
VTKM_CONT vtkm::filter::Result DoExecute(const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& field,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
const DeviceAdapter& tag);
|
||||
|
||||
//Map a new field onto the resulting dataset after running the filter
|
||||
//this call is only valid
|
||||
template <typename T, typename StorageType, typename DerivedPolicy, typename DeviceAdapter>
|
||||
VTKM_CONT bool DoMapField(vtkm::filter::ResultDataSet& result,
|
||||
VTKM_CONT bool DoMapField(vtkm::filter::Result& result,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& input,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
|
@ -96,7 +96,7 @@ inline VTKM_CONT Threshold::Threshold()
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename T, typename StorageType, typename DerivedPolicy, typename DeviceAdapter>
|
||||
inline VTKM_CONT vtkm::filter::ResultDataSet Threshold::DoExecute(
|
||||
inline VTKM_CONT vtkm::filter::Result Threshold::DoExecute(
|
||||
const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& field,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
@ -123,7 +123,7 @@ inline VTKM_CONT vtkm::filter::ResultDataSet Threshold::DoExecute(
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename T, typename StorageType, typename DerivedPolicy, typename DeviceAdapter>
|
||||
inline VTKM_CONT bool Threshold::DoMapField(vtkm::filter::ResultDataSet& result,
|
||||
inline VTKM_CONT bool Threshold::DoMapField(vtkm::filter::Result& result,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& input,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>&,
|
||||
|
@ -61,17 +61,16 @@ public:
|
||||
void SetThresholdBetween(const vtkm::Float64 value1, const vtkm::Float64 value2);
|
||||
|
||||
template <typename T, typename StorageType, typename DerivedPolicy, typename DeviceAdapter>
|
||||
VTKM_CONT vtkm::filter::ResultDataSet DoExecute(
|
||||
const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& field,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
const DeviceAdapter& tag);
|
||||
VTKM_CONT vtkm::filter::Result DoExecute(const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& field,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
const DeviceAdapter& tag);
|
||||
|
||||
//Map a new field onto the resulting dataset after running the filter
|
||||
//this call is only valid
|
||||
template <typename T, typename StorageType, typename DerivedPolicy, typename DeviceAdapter>
|
||||
VTKM_CONT bool DoMapField(vtkm::filter::ResultDataSet& result,
|
||||
VTKM_CONT bool DoMapField(vtkm::filter::Result& result,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& input,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
|
@ -144,7 +144,7 @@ inline VTKM_CONT void ThresholdPoints::SetThresholdBetween(const vtkm::Float64 v
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename T, typename StorageType, typename DerivedPolicy, typename DeviceAdapter>
|
||||
inline VTKM_CONT vtkm::filter::ResultDataSet ThresholdPoints::DoExecute(
|
||||
inline VTKM_CONT vtkm::filter::Result ThresholdPoints::DoExecute(
|
||||
const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& field,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
@ -158,7 +158,7 @@ inline VTKM_CONT vtkm::filter::ResultDataSet ThresholdPoints::DoExecute(
|
||||
if (fieldMeta.IsPointField() == false)
|
||||
{
|
||||
//todo: we need to mark this as a failure of input, not a failure of the algorithm
|
||||
return vtkm::filter::ResultDataSet();
|
||||
return vtkm::filter::Result();
|
||||
}
|
||||
|
||||
// run the worklet on the cell set and input field
|
||||
@ -203,20 +203,20 @@ inline VTKM_CONT vtkm::filter::ResultDataSet ThresholdPoints::DoExecute(
|
||||
if (this->CompactPoints)
|
||||
{
|
||||
this->Compactor.SetCompactPointFields(true);
|
||||
vtkm::filter::ResultDataSet result;
|
||||
vtkm::filter::Result result;
|
||||
result = this->Compactor.DoExecute(output, GetCellSetSingleTypePolicy(policy), DeviceAdapter());
|
||||
return result;
|
||||
}
|
||||
else
|
||||
{
|
||||
return vtkm::filter::ResultDataSet(output);
|
||||
return vtkm::filter::Result(output);
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename T, typename StorageType, typename DerivedPolicy, typename DeviceAdapter>
|
||||
inline VTKM_CONT bool ThresholdPoints::DoMapField(
|
||||
vtkm::filter::ResultDataSet& result,
|
||||
vtkm::filter::Result& result,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& input,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
|
@ -36,14 +36,13 @@ public:
|
||||
Triangulate();
|
||||
|
||||
template <typename DerivedPolicy, typename DeviceAdapter>
|
||||
VTKM_CONT vtkm::filter::ResultDataSet DoExecute(
|
||||
const vtkm::cont::DataSet& input,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
const DeviceAdapter& tag);
|
||||
VTKM_CONT vtkm::filter::Result DoExecute(const vtkm::cont::DataSet& input,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
const DeviceAdapter& tag);
|
||||
|
||||
// Map new field onto the resulting dataset after running the filter
|
||||
template <typename T, typename StorageType, typename DerivedPolicy, typename DeviceAdapter>
|
||||
VTKM_CONT bool DoMapField(vtkm::filter::ResultDataSet& result,
|
||||
VTKM_CONT bool DoMapField(vtkm::filter::Result& result,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& input,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
|
@ -58,7 +58,7 @@ inline VTKM_CONT Triangulate::Triangulate()
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename DerivedPolicy, typename DeviceAdapter>
|
||||
inline VTKM_CONT vtkm::filter::ResultDataSet Triangulate::DoExecute(
|
||||
inline VTKM_CONT vtkm::filter::Result Triangulate::DoExecute(
|
||||
const vtkm::cont::DataSet& input,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
const DeviceAdapter&)
|
||||
@ -75,12 +75,12 @@ inline VTKM_CONT vtkm::filter::ResultDataSet Triangulate::DoExecute(
|
||||
output.AddCellSet(outCellSet);
|
||||
output.AddCoordinateSystem(input.GetCoordinateSystem(this->GetActiveCoordinateSystemIndex()));
|
||||
|
||||
return vtkm::filter::ResultDataSet(output);
|
||||
return vtkm::filter::Result(output);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename T, typename StorageType, typename DerivedPolicy, typename DeviceAdapter>
|
||||
inline VTKM_CONT bool Triangulate::DoMapField(vtkm::filter::ResultDataSet& result,
|
||||
inline VTKM_CONT bool Triangulate::DoMapField(vtkm::filter::Result& result,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& input,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>&,
|
||||
|
@ -36,12 +36,11 @@ public:
|
||||
VectorMagnitude();
|
||||
|
||||
template <typename T, typename StorageType, typename DerivedPolicy, typename DeviceAdapter>
|
||||
VTKM_CONT vtkm::filter::ResultField DoExecute(
|
||||
const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& field,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
const DeviceAdapter& tag);
|
||||
VTKM_CONT vtkm::filter::Result DoExecute(const vtkm::cont::DataSet& input,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& field,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
const DeviceAdapter& tag);
|
||||
|
||||
private:
|
||||
vtkm::worklet::Magnitude Worklet;
|
||||
|
@ -35,7 +35,7 @@ inline VTKM_CONT VectorMagnitude::VectorMagnitude()
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename T, typename StorageType, typename DerivedPolicy, typename DeviceAdapter>
|
||||
inline VTKM_CONT vtkm::filter::ResultField VectorMagnitude::DoExecute(
|
||||
inline VTKM_CONT vtkm::filter::Result VectorMagnitude::DoExecute(
|
||||
const vtkm::cont::DataSet& inDataSet,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& field,
|
||||
const vtkm::filter::FieldMetadata& fieldMetadata,
|
||||
@ -50,11 +50,11 @@ inline VTKM_CONT vtkm::filter::ResultField VectorMagnitude::DoExecute(
|
||||
|
||||
dispatcher.Invoke(field, outArray);
|
||||
|
||||
return vtkm::filter::ResultField(inDataSet,
|
||||
outArray,
|
||||
this->GetOutputFieldName(),
|
||||
fieldMetadata.GetAssociation(),
|
||||
fieldMetadata.GetCellSetName());
|
||||
return vtkm::filter::Result(inDataSet,
|
||||
outArray,
|
||||
this->GetOutputFieldName(),
|
||||
fieldMetadata.GetAssociation(),
|
||||
fieldMetadata.GetCellSetName());
|
||||
}
|
||||
}
|
||||
} // namespace vtkm::filter
|
||||
|
@ -70,15 +70,14 @@ public:
|
||||
const vtkm::Id3& GetNumberOfDivisions() const { return this->NumberOfDivisions; }
|
||||
|
||||
template <typename DerivedPolicy, typename DeviceAdapter>
|
||||
VTKM_CONT vtkm::filter::ResultDataSet DoExecute(
|
||||
const vtkm::cont::DataSet& input,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
const DeviceAdapter& tag);
|
||||
VTKM_CONT vtkm::filter::Result DoExecute(const vtkm::cont::DataSet& input,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
const DeviceAdapter& tag);
|
||||
|
||||
//Map a new field onto the resulting dataset after running the filter
|
||||
//this call is only valid
|
||||
template <typename T, typename StorageType, typename DerivedPolicy, typename DeviceAdapter>
|
||||
VTKM_CONT bool DoMapField(vtkm::filter::ResultDataSet& result,
|
||||
VTKM_CONT bool DoMapField(vtkm::filter::Result& result,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>& input,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
|
@ -32,7 +32,7 @@ inline VTKM_CONT VertexClustering::VertexClustering()
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename DerivedPolicy, typename DeviceAdapter>
|
||||
inline VTKM_CONT vtkm::filter::ResultDataSet VertexClustering::DoExecute(
|
||||
inline VTKM_CONT vtkm::filter::Result VertexClustering::DoExecute(
|
||||
const vtkm::cont::DataSet& input,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
const DeviceAdapter& tag)
|
||||
@ -52,12 +52,12 @@ inline VTKM_CONT vtkm::filter::ResultDataSet VertexClustering::DoExecute(
|
||||
this->GetNumberOfDivisions(),
|
||||
tag);
|
||||
|
||||
return vtkm::filter::ResultDataSet(outDataSet);
|
||||
return vtkm::filter::Result(outDataSet);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename T, typename StorageType, typename DerivedPolicy, typename DeviceAdapter>
|
||||
inline VTKM_CONT bool VertexClustering::DoMapField(vtkm::filter::ResultDataSet&,
|
||||
inline VTKM_CONT bool VertexClustering::DoMapField(vtkm::filter::Result&,
|
||||
const vtkm::cont::ArrayHandle<T, StorageType>&,
|
||||
const vtkm::filter::FieldMetadata&,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>&,
|
||||
|
@ -81,7 +81,7 @@ private:
|
||||
{
|
||||
this->Instance.Result = this->Instance.DerivedClass->DoExecute(
|
||||
this->Instance.InputData, this->Field, this->Instance.Metadata, this->Instance.Policy, tag);
|
||||
return this->Instance.Result.IsValid();
|
||||
return this->Instance.Result.IsFieldValid();
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -33,7 +33,7 @@ namespace vtkm
|
||||
{
|
||||
namespace filter
|
||||
{
|
||||
class ResultDataSet;
|
||||
class Result;
|
||||
}
|
||||
}
|
||||
|
||||
@ -50,14 +50,14 @@ struct ResolveFieldTypeAndMap
|
||||
typedef ResolveFieldTypeAndMap<Derived, DerivedPolicy> Self;
|
||||
|
||||
Derived* DerivedClass;
|
||||
vtkm::filter::ResultDataSet& InputResult;
|
||||
vtkm::filter::Result& InputResult;
|
||||
const vtkm::filter::FieldMetadata& Metadata;
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& Policy;
|
||||
vtkm::cont::RuntimeDeviceTracker Tracker;
|
||||
bool& RanProperly;
|
||||
|
||||
ResolveFieldTypeAndMap(Derived* derivedClass,
|
||||
vtkm::filter::ResultDataSet& inResult,
|
||||
vtkm::filter::Result& inResult,
|
||||
const vtkm::filter::FieldMetadata& fieldMeta,
|
||||
const vtkm::filter::PolicyBase<DerivedPolicy>& policy,
|
||||
const vtkm::cont::RuntimeDeviceTracker& tracker,
|
||||
|
@ -32,7 +32,7 @@ void TestCellAverageRegular3D()
|
||||
vtkm::cont::testing::MakeTestDataSet testDataSet;
|
||||
vtkm::cont::DataSet dataSet = testDataSet.Make3DUniformDataSet0();
|
||||
|
||||
vtkm::filter::ResultField result;
|
||||
vtkm::filter::Result result;
|
||||
vtkm::filter::CellAverage cellAverage;
|
||||
cellAverage.SetOutputFieldName("avgvals");
|
||||
|
||||
@ -87,7 +87,7 @@ void TestCellAverageRegular2D()
|
||||
vtkm::cont::testing::MakeTestDataSet testDataSet;
|
||||
vtkm::cont::DataSet dataSet = testDataSet.Make2DUniformDataSet0();
|
||||
|
||||
vtkm::filter::ResultField result;
|
||||
vtkm::filter::Result result;
|
||||
vtkm::filter::CellAverage cellAverage;
|
||||
|
||||
result = cellAverage.Execute(dataSet, dataSet.GetField("pointvar"));
|
||||
@ -96,11 +96,11 @@ void TestCellAverageRegular2D()
|
||||
VTKM_TEST_ASSERT(result.GetField().GetName() == "pointvar", "Field was given the wrong name.");
|
||||
VTKM_TEST_ASSERT(result.GetField().GetAssociation() == vtkm::cont::Field::ASSOC_CELL_SET,
|
||||
"Field was given the wrong association.");
|
||||
vtkm::cont::Field resultField = result.GetField();
|
||||
vtkm::cont::Field Result = result.GetField();
|
||||
vtkm::cont::ArrayHandle<vtkm::Float32> resultArrayHandle;
|
||||
resultField.GetData().CopyTo(resultArrayHandle);
|
||||
Result.GetData().CopyTo(resultArrayHandle);
|
||||
|
||||
if (result.IsValid())
|
||||
if (result.IsDataSetValid())
|
||||
{
|
||||
vtkm::Float32 expected[2] = { 30.1f, 40.1f };
|
||||
for (int i = 0; i < 2; ++i)
|
||||
@ -118,7 +118,7 @@ void TestCellAverageExplicit()
|
||||
vtkm::cont::testing::MakeTestDataSet testDataSet;
|
||||
vtkm::cont::DataSet dataSet = testDataSet.Make3DExplicitDataSet0();
|
||||
|
||||
vtkm::filter::ResultField result;
|
||||
vtkm::filter::Result result;
|
||||
vtkm::filter::CellAverage cellAverage;
|
||||
|
||||
result = cellAverage.Execute(dataSet, dataSet.GetField("pointvar"));
|
||||
|
@ -34,8 +34,8 @@ void TestUniformGrid(vtkm::filter::CleanGrid clean)
|
||||
|
||||
vtkm::cont::DataSet inData = makeData.Make2DUniformDataSet0();
|
||||
|
||||
vtkm::filter::ResultDataSet result = clean.Execute(inData);
|
||||
VTKM_TEST_ASSERT(result.IsValid(), "Filter failed to execute");
|
||||
vtkm::filter::Result result = clean.Execute(inData);
|
||||
VTKM_TEST_ASSERT(result.IsDataSetValid(), "Filter failed to execute");
|
||||
|
||||
bool success;
|
||||
success = clean.MapFieldOntoOutput(result, inData.GetField("pointvar"));
|
||||
|
@ -66,7 +66,7 @@ void TestClipExplicit()
|
||||
|
||||
vtkm::cont::DataSet ds = MakeTestDatasetExplicit();
|
||||
|
||||
vtkm::filter::ResultDataSet result;
|
||||
vtkm::filter::Result result;
|
||||
vtkm::filter::ClipWithField clip;
|
||||
clip.SetClipValue(0.5);
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user