mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-16 17:22:55 +00:00
Merge topic 'fix-ExecutionWholeArray-usage'
6b190312 Cleanup includes of ExecutionWholeArray.h 3e10b504 Replace ExecutionWholeArray with WholeArray Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1039
This commit is contained in:
commit
39dd8feeac
@ -29,14 +29,16 @@ namespace vtkm
|
||||
namespace exec
|
||||
{
|
||||
|
||||
/// The following classes have been deprecated and are meant to be used
|
||||
/// internally only. Please use the \c WholeArrayIn, \c WholeArrayOut, and
|
||||
/// \c WholeArrayInOut \c ControlSignature tags instead.
|
||||
|
||||
/// \c ExecutionWholeArray is an execution object that allows an array handle
|
||||
/// content to be a parameter in an execution environment
|
||||
/// function. This can be used to allow worklets to have a shared search
|
||||
/// structure
|
||||
/// structure.
|
||||
///
|
||||
template <typename T,
|
||||
typename StorageTag = VTKM_DEFAULT_STORAGE_TAG,
|
||||
typename DeviceAdapterTag = VTKM_DEFAULT_DEVICE_ADAPTER_TAG>
|
||||
template <typename T, typename StorageTag, typename DeviceAdapterTag>
|
||||
class ExecutionWholeArray : public vtkm::exec::ExecutionObjectBase
|
||||
{
|
||||
public:
|
||||
@ -86,9 +88,7 @@ private:
|
||||
/// function. This can be used to allow worklets to have a shared search
|
||||
/// structure
|
||||
///
|
||||
template <typename T,
|
||||
typename StorageTag = VTKM_DEFAULT_STORAGE_TAG,
|
||||
typename DeviceAdapterTag = VTKM_DEFAULT_DEVICE_ADAPTER_TAG>
|
||||
template <typename T, typename StorageTag, typename DeviceAdapterTag>
|
||||
class ExecutionWholeArrayConst : public vtkm::exec::ExecutionObjectBase
|
||||
{
|
||||
public:
|
||||
|
@ -21,7 +21,6 @@
|
||||
#include <vtkm/rendering/CanvasRayTracer.h>
|
||||
|
||||
#include <vtkm/cont/TryExecute.h>
|
||||
#include <vtkm/exec/ExecutionWholeArray.h>
|
||||
#include <vtkm/rendering/Canvas.h>
|
||||
#include <vtkm/rendering/Color.h>
|
||||
#include <vtkm/rendering/raytracing/Ray.h>
|
||||
@ -51,19 +50,21 @@ public:
|
||||
FieldIn<>,
|
||||
FieldIn<>,
|
||||
FieldIn<>,
|
||||
ExecObject,
|
||||
ExecObject);
|
||||
WholeArrayOut<vtkm::ListTagBase<vtkm::Float32>>,
|
||||
WholeArrayOut<vtkm::ListTagBase<vtkm::Vec<vtkm::Float32, 4>>>);
|
||||
typedef void ExecutionSignature(_1, _2, _3, _4, _5, _6, _7, WorkIndex);
|
||||
template <typename Precision, typename ColorPortalType>
|
||||
VTKM_EXEC void operator()(
|
||||
const vtkm::Id& pixelIndex,
|
||||
ColorPortalType& colorBufferIn,
|
||||
const Precision& inDepth,
|
||||
const vtkm::Vec<Precision, 3>& origin,
|
||||
const vtkm::Vec<Precision, 3>& dir,
|
||||
vtkm::exec::ExecutionWholeArray<vtkm::Float32>& depthBuffer,
|
||||
vtkm::exec::ExecutionWholeArray<vtkm::Vec<vtkm::Float32, 4>>& colorBuffer,
|
||||
const vtkm::Id& index) const
|
||||
template <typename Precision,
|
||||
typename ColorPortalType,
|
||||
typename DepthBufferPortalType,
|
||||
typename ColorBufferPortalType>
|
||||
VTKM_EXEC void operator()(const vtkm::Id& pixelIndex,
|
||||
ColorPortalType& colorBufferIn,
|
||||
const Precision& inDepth,
|
||||
const vtkm::Vec<Precision, 3>& origin,
|
||||
const vtkm::Vec<Precision, 3>& dir,
|
||||
DepthBufferPortalType& depthBuffer,
|
||||
ColorBufferPortalType& colorBuffer,
|
||||
const vtkm::Id& index) const
|
||||
{
|
||||
vtkm::Vec<Precision, 3> intersection = origin + inDepth * dir;
|
||||
vtkm::Vec<vtkm::Float32, 4> point;
|
||||
@ -140,14 +141,13 @@ public:
|
||||
{
|
||||
VTKM_IS_DEVICE_ADAPTER_TAG(Device);
|
||||
vtkm::worklet::DispatcherMapField<SurfaceConverter, Device>(SurfaceConverter(ViewProjMat))
|
||||
.Invoke(
|
||||
Rays.PixelIdx,
|
||||
Colors,
|
||||
Rays.Distance,
|
||||
Rays.Origin,
|
||||
Rays.Dir,
|
||||
vtkm::exec::ExecutionWholeArray<vtkm::Float32>(Canvas->GetDepthBuffer()),
|
||||
vtkm::exec::ExecutionWholeArray<vtkm::Vec<vtkm::Float32, 4>>(Canvas->GetColorBuffer()));
|
||||
.Invoke(Rays.PixelIdx,
|
||||
Colors,
|
||||
Rays.Distance,
|
||||
Rays.Origin,
|
||||
Rays.Dir,
|
||||
Canvas->GetDepthBuffer(),
|
||||
Canvas->GetColorBuffer());
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
@ -24,7 +24,6 @@
|
||||
#include <vtkm/cont/ArrayHandleCounting.h>
|
||||
#include <vtkm/cont/CellSetPermutation.h>
|
||||
#include <vtkm/cont/DataSet.h>
|
||||
#include <vtkm/exec/ExecutionWholeArray.h>
|
||||
#include <vtkm/rendering/raytracing/MeshConnectivityBuilder.h>
|
||||
#include <vtkm/worklet/DispatcherMapField.h>
|
||||
#include <vtkm/worklet/DispatcherMapTopology.h>
|
||||
@ -276,17 +275,21 @@ public:
|
||||
public:
|
||||
VTKM_CONT
|
||||
UniqueTriangles() {}
|
||||
typedef void ControlSignature(ExecObject, ExecObject);
|
||||
|
||||
typedef void ControlSignature(WholeArrayIn<vtkm::ListTagBase<vtkm::Vec<vtkm::Id, 4>>>,
|
||||
WholeArrayOut<vtkm::ListTagBase<vtkm::UInt8>>);
|
||||
typedef void ExecutionSignature(_1, _2, WorkIndex);
|
||||
|
||||
VTKM_EXEC
|
||||
bool IsTwin(const vtkm::Vec<vtkm::Id, 4>& a, const vtkm::Vec<vtkm::Id, 4>& b) const
|
||||
{
|
||||
return (a[1] == b[1] && a[2] == b[2] && a[3] == b[3]);
|
||||
}
|
||||
VTKM_EXEC
|
||||
void operator()(vtkm::exec::ExecutionWholeArrayConst<vtkm::Vec<vtkm::Id, 4>>& indices,
|
||||
vtkm::exec::ExecutionWholeArray<vtkm::UInt8>& outputFlags,
|
||||
const vtkm::Id& index) const
|
||||
|
||||
template <typename IndicesPortalType, typename OutputFlagsPortalType>
|
||||
VTKM_EXEC void operator()(const IndicesPortalType& indices,
|
||||
OutputFlagsPortalType& outputFlags,
|
||||
const vtkm::Id& index) const
|
||||
{
|
||||
if (index == 0)
|
||||
return;
|
||||
@ -612,9 +615,7 @@ public:
|
||||
flags.Allocate(outputTriangles);
|
||||
vtkm::worklet::DispatcherMapField<MemSet<vtkm::UInt8>>(MemSet<vtkm::UInt8>(1)).Invoke(flags);
|
||||
//Unique triangles will have a flag = 1
|
||||
vtkm::worklet::DispatcherMapField<UniqueTriangles>().Invoke(
|
||||
vtkm::exec::ExecutionWholeArrayConst<vtkm::Vec<vtkm::Id, 4>>(outputIndices),
|
||||
vtkm::exec::ExecutionWholeArray<vtkm::UInt8>(flags));
|
||||
vtkm::worklet::DispatcherMapField<UniqueTriangles>().Invoke(outputIndices, flags);
|
||||
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::Id, 4>> subset;
|
||||
vtkm::cont::DeviceAdapterAlgorithm<Device>::CopyIf(outputIndices, flags, subset);
|
||||
|
@ -157,7 +157,7 @@ class EdgePlotter : public vtkm::worklet::WorkletMapField
|
||||
public:
|
||||
using AtomicPackedFrameBufferHandle = vtkm::exec::AtomicArray<vtkm::Int64, DeviceTag>;
|
||||
|
||||
typedef void ControlSignature(FieldIn<>, WholeArrayIn<>, WholeArrayIn<Scalar>);
|
||||
typedef void ControlSignature(FieldIn<Id2Type>, WholeArrayIn<Vec3>, WholeArrayIn<Scalar>);
|
||||
typedef void ExecutionSignature(_1, _2, _3);
|
||||
using InputDomain = _1;
|
||||
|
||||
@ -393,14 +393,16 @@ public:
|
||||
VTKM_CONT
|
||||
BufferConverter() {}
|
||||
|
||||
typedef void ControlSignature(FieldIn<>, ExecObject, ExecObject);
|
||||
typedef void ControlSignature(FieldIn<>,
|
||||
WholeArrayOut<vtkm::ListTagBase<vtkm::Float32>>,
|
||||
WholeArrayOut<vtkm::ListTagBase<vtkm::Vec<vtkm::Float32, 4>>>);
|
||||
typedef void ExecutionSignature(_1, _2, _3, WorkIndex);
|
||||
|
||||
VTKM_EXEC
|
||||
void operator()(const vtkm::Int64& packedValue,
|
||||
vtkm::exec::ExecutionWholeArray<vtkm::Float32>& depthBuffer,
|
||||
vtkm::exec::ExecutionWholeArray<vtkm::Vec<vtkm::Float32, 4>>& colorBuffer,
|
||||
const vtkm::Id& index) const
|
||||
template <typename DepthBufferPortalType, typename ColorBufferPortalType>
|
||||
VTKM_EXEC void operator()(const vtkm::Int64& packedValue,
|
||||
DepthBufferPortalType& depthBuffer,
|
||||
ColorBufferPortalType& colorBuffer,
|
||||
const vtkm::Id& index) const
|
||||
{
|
||||
PackedValue packed;
|
||||
packed.Raw = packedValue;
|
||||
@ -551,9 +553,7 @@ private:
|
||||
|
||||
BufferConverter converter;
|
||||
vtkm::worklet::DispatcherMapField<BufferConverter, DeviceTag>(converter).Invoke(
|
||||
FrameBuffer,
|
||||
vtkm::exec::ExecutionWholeArray<vtkm::Float32>(Canvas->GetDepthBuffer()),
|
||||
vtkm::exec::ExecutionWholeArray<vtkm::Vec<vtkm::Float32, 4>>(Canvas->GetColorBuffer()));
|
||||
FrameBuffer, Canvas->GetDepthBuffer(), Canvas->GetColorBuffer());
|
||||
}
|
||||
|
||||
VTKM_CONT
|
||||
|
@ -316,22 +316,22 @@ public:
|
||||
{
|
||||
this->FlatBVH = flatBVH.PrepareForOutput((LeafCount - 1) * 4, Device());
|
||||
}
|
||||
typedef void ControlSignature(ExecObject,
|
||||
ExecObject,
|
||||
ExecObject,
|
||||
ExecObject,
|
||||
ExecObject,
|
||||
ExecObject);
|
||||
typedef void ControlSignature(WholeArrayIn<Scalar>,
|
||||
WholeArrayIn<Scalar>,
|
||||
WholeArrayIn<Scalar>,
|
||||
WholeArrayIn<Scalar>,
|
||||
WholeArrayIn<Scalar>,
|
||||
WholeArrayIn<Scalar>);
|
||||
typedef void ExecutionSignature(WorkIndex, _1, _2, _3, _4, _5, _6);
|
||||
template <typename StrorageType>
|
||||
VTKM_EXEC_CONT void operator()(
|
||||
const vtkm::Id workIndex,
|
||||
const vtkm::exec::ExecutionWholeArrayConst<vtkm::Float32, StrorageType>& xmin,
|
||||
const vtkm::exec::ExecutionWholeArrayConst<vtkm::Float32, StrorageType>& ymin,
|
||||
const vtkm::exec::ExecutionWholeArrayConst<vtkm::Float32, StrorageType>& zmin,
|
||||
const vtkm::exec::ExecutionWholeArrayConst<vtkm::Float32, StrorageType>& xmax,
|
||||
const vtkm::exec::ExecutionWholeArrayConst<vtkm::Float32, StrorageType>& ymax,
|
||||
const vtkm::exec::ExecutionWholeArrayConst<vtkm::Float32, StrorageType>& zmax) const
|
||||
|
||||
template <typename InputPortalType>
|
||||
VTKM_EXEC_CONT void operator()(const vtkm::Id workIndex,
|
||||
const InputPortalType& xmin,
|
||||
const InputPortalType& ymin,
|
||||
const InputPortalType& zmin,
|
||||
const InputPortalType& xmax,
|
||||
const InputPortalType& ymax,
|
||||
const InputPortalType& zmax) const
|
||||
{
|
||||
//move up into the inner nodes
|
||||
vtkm::Id currentNode = LeafCount - 1 + workIndex;
|
||||
@ -780,12 +780,7 @@ VTKM_CONT void LinearBVHBuilder::RunOnDevice(LinearBVH& linearBVH, Device device
|
||||
vtkm::worklet::DispatcherMapField<PropagateAABBs<Device>, Device>(
|
||||
PropagateAABBs<Device>(
|
||||
bvh.parent, bvh.leftChild, bvh.rightChild, primitiveCount, linearBVH.FlatBVH, atomicCounters))
|
||||
.Invoke(vtkm::exec::ExecutionWholeArrayConst<vtkm::Float32>(*bvh.xmins),
|
||||
vtkm::exec::ExecutionWholeArrayConst<vtkm::Float32>(*bvh.ymins),
|
||||
vtkm::exec::ExecutionWholeArrayConst<vtkm::Float32>(*bvh.zmins),
|
||||
vtkm::exec::ExecutionWholeArrayConst<vtkm::Float32>(*bvh.xmaxs),
|
||||
vtkm::exec::ExecutionWholeArrayConst<vtkm::Float32>(*bvh.ymaxs),
|
||||
vtkm::exec::ExecutionWholeArrayConst<vtkm::Float32>(*bvh.zmaxs));
|
||||
.Invoke(*bvh.xmins, *bvh.ymins, *bvh.zmins, *bvh.xmaxs, *bvh.ymaxs, *bvh.zmaxs);
|
||||
|
||||
time = timer.GetElapsedTime();
|
||||
logger->AddLogData("propagate_aabbs", time);
|
||||
|
@ -95,7 +95,7 @@ public:
|
||||
VTKM_CONT
|
||||
MortonNeighbor() {}
|
||||
typedef void ControlSignature(WholeArrayIn<>,
|
||||
ExecObject,
|
||||
WholeArrayInOut<Id3Type>,
|
||||
WholeArrayIn<>,
|
||||
WholeArrayIn<>,
|
||||
WholeArrayIn<>,
|
||||
@ -146,18 +146,18 @@ public:
|
||||
|
||||
|
||||
template <typename MortonPortalType,
|
||||
typename FaceIdPairsPortalType,
|
||||
typename ConnPortalType,
|
||||
typename ShapePortalType,
|
||||
typename OffsetPortalType,
|
||||
typename ExternalFaceFlagType>
|
||||
VTKM_EXEC inline void operator()(
|
||||
const MortonPortalType& mortonCodes,
|
||||
vtkm::exec::ExecutionWholeArray<vtkm::Vec<vtkm::Id, 3>>& faceIdPairs,
|
||||
const vtkm::Id& index,
|
||||
const ConnPortalType& connectivity,
|
||||
const ShapePortalType& shapes,
|
||||
const OffsetPortalType& offsets,
|
||||
ExternalFaceFlagType& flags) const
|
||||
VTKM_EXEC inline void operator()(const MortonPortalType& mortonCodes,
|
||||
FaceIdPairsPortalType& faceIdPairs,
|
||||
const vtkm::Id& index,
|
||||
const ConnPortalType& connectivity,
|
||||
const ShapePortalType& shapes,
|
||||
const OffsetPortalType& offsets,
|
||||
ExternalFaceFlagType& flags) const
|
||||
{
|
||||
if (index == 0)
|
||||
{
|
||||
@ -330,14 +330,16 @@ public:
|
||||
class WriteFaceConn : public vtkm::worklet::WorkletMapField
|
||||
{
|
||||
public:
|
||||
typedef void ControlSignature(FieldIn<>, WholeArrayIn<>, WholeArrayOut<IdType>);
|
||||
typedef void ExecutionSignature(_1, _2, _3);
|
||||
|
||||
VTKM_CONT
|
||||
WriteFaceConn() {}
|
||||
typedef void ControlSignature(FieldIn<>, WholeArrayIn<>, ExecObject);
|
||||
typedef void ExecutionSignature(_1, _2, _3);
|
||||
template <typename FaceOffsetsPortalType>
|
||||
|
||||
template <typename FaceOffsetsPortalType, typename FaceConnectivityPortalType>
|
||||
VTKM_EXEC inline void operator()(const vtkm::Vec<vtkm::Id, 3>& faceIdPair,
|
||||
const FaceOffsetsPortalType& faceOffsets,
|
||||
vtkm::exec::ExecutionWholeArray<vtkm::Id>& faceConn) const
|
||||
FaceConnectivityPortalType& faceConn) const
|
||||
{
|
||||
vtkm::Id cellId = faceIdPair[0];
|
||||
BOUNDS_CHECK(faceOffsets, cellId);
|
||||
@ -570,8 +572,7 @@ public:
|
||||
|
||||
// scatter the coonectivity into the original order
|
||||
vtkm::worklet::DispatcherMapField<WriteFaceConn>(WriteFaceConn())
|
||||
.Invoke(
|
||||
cellFaceId, this->FaceOffsets, vtkm::exec::ExecutionWholeArray<vtkm::Id>(faceConnectivity));
|
||||
.Invoke(cellFaceId, this->FaceOffsets, faceConnectivity);
|
||||
|
||||
|
||||
FaceConnectivity = faceConnectivity;
|
||||
@ -628,8 +629,7 @@ public:
|
||||
|
||||
// scatter the coonectivity into the original order
|
||||
vtkm::worklet::DispatcherMapField<WriteFaceConn>(WriteFaceConn())
|
||||
.Invoke(
|
||||
cellFaceId, this->FaceOffsets, vtkm::exec::ExecutionWholeArray<vtkm::Id>(faceConnectivity));
|
||||
.Invoke(cellFaceId, this->FaceOffsets, faceConnectivity);
|
||||
|
||||
FaceConnectivity = faceConnectivity;
|
||||
OutsideTriangles = externalTriangles;
|
||||
@ -754,12 +754,7 @@ protected:
|
||||
.Invoke(faceConnectivity);
|
||||
|
||||
vtkm::worklet::DispatcherMapField<MortonNeighbor, DeviceAdapter>(MortonNeighbor())
|
||||
.Invoke(faceMortonCodes,
|
||||
vtkm::exec::ExecutionWholeArray<vtkm::Vec<vtkm::Id, 3>>(cellFaceId),
|
||||
conn,
|
||||
shapes,
|
||||
shapeOffsets,
|
||||
faceConnectivity);
|
||||
.Invoke(faceMortonCodes, cellFaceId, conn, shapes, shapeOffsets, faceConnectivity);
|
||||
|
||||
vtkm::Float64 time = timer.GetElapsedTime();
|
||||
Logger::GetInstance()->AddLogData("gen_face_conn", time);
|
||||
|
@ -22,7 +22,6 @@
|
||||
#include <cstring>
|
||||
#include <vtkm/cont/ArrayHandle.h>
|
||||
#include <vtkm/cont/ArrayHandleCompositeVector.h>
|
||||
#include <vtkm/exec/ExecutionWholeArray.h>
|
||||
#include <vtkm/rendering/raytracing/BoundingVolumeHierarchy.h>
|
||||
#include <vtkm/rendering/raytracing/Ray.h>
|
||||
#include <vtkm/rendering/raytracing/RayOperations.h>
|
||||
|
@ -33,7 +33,6 @@
|
||||
#include <vtkm/cont/ImplicitFunctionHandle.h>
|
||||
#include <vtkm/cont/Timer.h>
|
||||
|
||||
#include <vtkm/exec/ExecutionWholeArray.h>
|
||||
#include <vtkm/exec/FunctorBase.h>
|
||||
|
||||
#if defined(THRUST_MAJOR_VERSION) && THRUST_MAJOR_VERSION == 1 && THRUST_MINOR_VERSION == 8 && \
|
||||
|
@ -22,8 +22,6 @@
|
||||
|
||||
#include <vtkm/Math.h>
|
||||
|
||||
#include <vtkm/exec/ExecutionWholeArray.h>
|
||||
|
||||
#include <vtkm/cont/ArrayHandle.h>
|
||||
#include <vtkm/cont/ArrayHandleCounting.h>
|
||||
#include <vtkm/cont/ArrayHandlePermutation.h>
|
||||
@ -363,16 +361,16 @@ struct KernelSplatterFilterUniformGrid
|
||||
class UpdateVoxelSplats : public vtkm::worklet::WorkletMapField
|
||||
{
|
||||
public:
|
||||
typedef void ControlSignature(FieldIn<>, FieldIn<>, ExecObject);
|
||||
typedef void ControlSignature(FieldIn<>, FieldIn<>, WholeArrayOut<Scalar>);
|
||||
typedef void ExecutionSignature(_1, _2, _3);
|
||||
|
||||
VTKM_CONT
|
||||
UpdateVoxelSplats() {}
|
||||
|
||||
VTKM_EXEC_CONT
|
||||
void operator()(const vtkm::Id& voxelIndex,
|
||||
const vtkm::Float64& splatValue,
|
||||
vtkm::exec::ExecutionWholeArray<vtkm::Float32>& execArg) const
|
||||
template <typename ExecArgPortalType>
|
||||
VTKM_EXEC_CONT void operator()(const vtkm::Id& voxelIndex,
|
||||
const vtkm::Float64& splatValue,
|
||||
ExecArgPortalType& execArg) const
|
||||
{
|
||||
execArg.Set(voxelIndex, static_cast<vtkm::Float32>(splatValue));
|
||||
}
|
||||
@ -594,9 +592,7 @@ struct KernelSplatterFilterUniformGrid
|
||||
vtkm::worklet::DispatcherMapField<UpdateVoxelSplats> scatterDispatcher;
|
||||
|
||||
START_TIMER_BLOCK(UpdateVoxelSplats)
|
||||
scatterDispatcher.Invoke(uniqueVoxelIds,
|
||||
voxelSplatSums,
|
||||
vtkm::exec::ExecutionWholeArray<vtkm::Float32>(scalarSplatOutput));
|
||||
scatterDispatcher.Invoke(uniqueVoxelIds, voxelSplatSums, scalarSplatOutput);
|
||||
END_TIMER_BLOCK(UpdateVoxelSplats)
|
||||
debug::OutputArrayDebug(scalarSplatOutput, "scalarSplatOutput");
|
||||
//
|
||||
|
@ -33,8 +33,6 @@
|
||||
#include <vtkm/worklet/ScatterUniform.h>
|
||||
#include <vtkm/worklet/WorkletMapField.h>
|
||||
|
||||
#include <vtkm/exec/ExecutionWholeArray.h>
|
||||
|
||||
namespace vtkm
|
||||
{
|
||||
|
||||
@ -166,9 +164,9 @@ public:
|
||||
public:
|
||||
typedef void ControlSignature(FieldIn<IdType> seedId,
|
||||
FieldIn<> position,
|
||||
ExecObject numIndices,
|
||||
ExecObject validPoint,
|
||||
ExecObject streamLines);
|
||||
WholeArrayOut<IdComponentType> numIndices,
|
||||
WholeArrayOut<IdComponentType> validPoint,
|
||||
WholeArrayOut<Vec3> streamLines);
|
||||
typedef void ExecutionSignature(_1, _2, _3, _4, _5, VisitIndex);
|
||||
typedef _1 InputDomain;
|
||||
|
||||
@ -200,13 +198,13 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
VTKM_EXEC
|
||||
void operator()(vtkm::Id& seedId,
|
||||
vtkm::Vec<FieldType, 3>& seedPos,
|
||||
vtkm::exec::ExecutionWholeArray<vtkm::IdComponent>& numIndices,
|
||||
vtkm::exec::ExecutionWholeArray<vtkm::IdComponent>& validPoint,
|
||||
vtkm::exec::ExecutionWholeArray<vtkm::Vec<FieldType, 3>>& slLists,
|
||||
vtkm::IdComponent visitIndex) const
|
||||
template <typename IdComponentPortalType, typename FieldVec3PortalType>
|
||||
VTKM_EXEC void operator()(vtkm::Id& seedId,
|
||||
vtkm::Vec<FieldType, 3>& seedPos,
|
||||
IdComponentPortalType& numIndices,
|
||||
IdComponentPortalType& validPoint,
|
||||
FieldVec3PortalType& slLists,
|
||||
vtkm::IdComponent visitIndex) const
|
||||
{
|
||||
// Set initial offset into the output streams array
|
||||
vtkm::Vec<FieldType, 3> pos = seedPos;
|
||||
@ -403,11 +401,7 @@ public:
|
||||
typedef typename vtkm::worklet::DispatcherMapField<MakeStreamLines> MakeStreamLinesDispatcher;
|
||||
MakeStreamLinesDispatcher makeStreamLinesDispatcher(makeStreamLines);
|
||||
makeStreamLinesDispatcher.Invoke(
|
||||
seedIdArray,
|
||||
seedPosArray,
|
||||
vtkm::exec::ExecutionWholeArray<vtkm::IdComponent>(numIndices, numCells),
|
||||
vtkm::exec::ExecutionWholeArray<vtkm::IdComponent>(validPoint, maxConnectivityLen),
|
||||
vtkm::exec::ExecutionWholeArray<vtkm::Vec<FieldType, 3>>(streamArray, maxConnectivityLen));
|
||||
seedIdArray, seedPosArray, numIndices, validPoint, streamArray);
|
||||
|
||||
// Size of connectivity based on size of returned streamlines
|
||||
vtkm::cont::ArrayHandle<vtkm::IdComponent> numIndicesOut;
|
||||
|
@ -84,7 +84,6 @@
|
||||
#ifndef vtk_m_worklet_contourtree_active_edge_transferrer_h
|
||||
#define vtk_m_worklet_contourtree_active_edge_transferrer_h
|
||||
|
||||
#include <vtkm/exec/ExecutionWholeArray.h>
|
||||
#include <vtkm/worklet/WorkletMapField.h>
|
||||
|
||||
namespace vtkm
|
||||
|
@ -83,7 +83,6 @@
|
||||
#ifndef vtkm_worklet_contourtree_chain_doubler_h
|
||||
#define vtkm_worklet_contourtree_chain_doubler_h
|
||||
|
||||
#include <vtkm/exec/ExecutionWholeArray.h>
|
||||
#include <vtkm/worklet/WorkletMapField.h>
|
||||
|
||||
namespace vtkm
|
||||
|
@ -67,7 +67,6 @@
|
||||
#ifndef vtkm_worklet_contourtree_copy_join_split_h
|
||||
#define vtkm_worklet_contourtree_copy_join_split_h
|
||||
|
||||
#include <vtkm/exec/ExecutionWholeArray.h>
|
||||
#include <vtkm/worklet/WorkletMapField.h>
|
||||
#include <vtkm/worklet/contourtree/Types.h>
|
||||
|
||||
|
@ -67,7 +67,6 @@
|
||||
#ifndef vtkm_worklet_contourtree_copy_neighbors_h
|
||||
#define vtkm_worklet_contourtree_copy_neighbors_h
|
||||
|
||||
#include <vtkm/exec/ExecutionWholeArray.h>
|
||||
#include <vtkm/worklet/WorkletMapField.h>
|
||||
#include <vtkm/worklet/contourtree/Types.h>
|
||||
|
||||
|
@ -67,7 +67,6 @@
|
||||
#ifndef vtkm_worklet_contourtree_copy_supernodes_h
|
||||
#define vtkm_worklet_contourtree_copy_supernodes_h
|
||||
|
||||
#include <vtkm/exec/ExecutionWholeArray.h>
|
||||
#include <vtkm/worklet/WorkletMapField.h>
|
||||
|
||||
namespace vtkm
|
||||
|
@ -67,7 +67,6 @@
|
||||
#ifndef vtkm_worklet_contourtree_degree_delta_h
|
||||
#define vtkm_worklet_contourtree_degree_delta_h
|
||||
|
||||
#include <vtkm/exec/ExecutionWholeArray.h>
|
||||
#include <vtkm/worklet/WorkletMapField.h>
|
||||
|
||||
namespace vtkm
|
||||
|
@ -67,7 +67,6 @@
|
||||
#ifndef vtkm_worklet_contourtree_degree_subrange_offset_h
|
||||
#define vtkm_worklet_contourtree_degree_subrange_offset_h
|
||||
|
||||
#include <vtkm/exec/ExecutionWholeArray.h>
|
||||
#include <vtkm/worklet/WorkletMapField.h>
|
||||
#include <vtkm/worklet/contourtree/Types.h>
|
||||
|
||||
|
@ -67,7 +67,6 @@
|
||||
#ifndef vtkm_worklet_contourtree_fill_supernodes_h
|
||||
#define vtkm_worklet_contourtree_fill_supernodes_h
|
||||
|
||||
#include <vtkm/exec/ExecutionWholeArray.h>
|
||||
#include <vtkm/worklet/WorkletMapField.h>
|
||||
|
||||
namespace vtkm
|
||||
|
@ -67,7 +67,6 @@
|
||||
#ifndef vtkm_worklet_contourtree_find_leaves_h
|
||||
#define vtkm_worklet_contourtree_find_leaves_h
|
||||
|
||||
#include <vtkm/exec/ExecutionWholeArray.h>
|
||||
#include <vtkm/worklet/WorkletMapField.h>
|
||||
#include <vtkm/worklet/contourtree/Types.h>
|
||||
|
||||
|
@ -83,7 +83,6 @@
|
||||
#ifndef vtkm_worklet_contourtree_governing_saddle_finder_h
|
||||
#define vtkm_worklet_contourtree_governing_saddle_finder_h
|
||||
|
||||
#include <vtkm/exec/ExecutionWholeArray.h>
|
||||
#include <vtkm/worklet/WorkletMapField.h>
|
||||
|
||||
namespace vtkm
|
||||
|
@ -83,7 +83,6 @@
|
||||
#ifndef vtkm_worklet_contourtree_join_arc_connector_h
|
||||
#define vtkm_worklet_contourtree_join_arc_connector_h
|
||||
|
||||
#include <vtkm/exec/ExecutionWholeArray.h>
|
||||
#include <vtkm/worklet/WorkletMapField.h>
|
||||
|
||||
namespace vtkm
|
||||
|
@ -89,7 +89,6 @@
|
||||
|
||||
#include "vtkm/worklet/contourtree/Types.h"
|
||||
#include "vtkm/worklet/contourtree/VertexValueComparator.h"
|
||||
#include <vtkm/exec/ExecutionWholeArray.h>
|
||||
#include <vtkm/worklet/WorkletMapField.h>
|
||||
|
||||
namespace vtkm
|
||||
|
@ -84,7 +84,6 @@
|
||||
#ifndef vtkm_worklet_contourtree_join_tree_transferrer_h
|
||||
#define vtkm_worklet_contourtree_join_tree_transferrer_h
|
||||
|
||||
#include <vtkm/exec/ExecutionWholeArray.h>
|
||||
#include <vtkm/worklet/WorkletMapField.h>
|
||||
#include <vtkm/worklet/contourtree/Types.h>
|
||||
|
||||
|
@ -83,7 +83,6 @@
|
||||
#ifndef vtkm_worklet_contourtree_mesh2d_dem_saddle_starter_h
|
||||
#define vtkm_worklet_contourtree_mesh2d_dem_saddle_starter_h
|
||||
|
||||
#include <vtkm/exec/ExecutionWholeArray.h>
|
||||
#include <vtkm/worklet/WorkletMapField.h>
|
||||
#include <vtkm/worklet/contourtree/Mesh2D_DEM_Triangulation_Macros.h>
|
||||
|
||||
|
@ -83,7 +83,6 @@
|
||||
#ifndef vtkm_worklet_contourtree_mesh2d_dem_vertex_outdegree_starter_h
|
||||
#define vtkm_worklet_contourtree_mesh2d_dem_vertex_outdegree_starter_h
|
||||
|
||||
#include <vtkm/exec/ExecutionWholeArray.h>
|
||||
#include <vtkm/worklet/WorkletMapField.h>
|
||||
#include <vtkm/worklet/contourtree/Mesh2D_DEM_Triangulation_Macros.h>
|
||||
|
||||
|
@ -83,7 +83,6 @@
|
||||
#ifndef vtkm_worklet_contourtree_mesh2d_dem_vertex_starter_h
|
||||
#define vtkm_worklet_contourtree_mesh2d_dem_vertex_starter_h
|
||||
|
||||
#include <vtkm/exec/ExecutionWholeArray.h>
|
||||
#include <vtkm/worklet/WorkletMapField.h>
|
||||
#include <vtkm/worklet/contourtree/Mesh2D_DEM_Triangulation_Macros.h>
|
||||
#include <vtkm/worklet/contourtree/VertexValueComparator.h>
|
||||
|
@ -83,7 +83,6 @@
|
||||
#ifndef vtkm_worklet_contourtree_mesh3d_dem_saddle_starter_h
|
||||
#define vtkm_worklet_contourtree_mesh3d_dem_saddle_starter_h
|
||||
|
||||
#include <vtkm/exec/ExecutionWholeArray.h>
|
||||
#include <vtkm/worklet/WorkletMapField.h>
|
||||
#include <vtkm/worklet/contourtree/LinkComponentCaseTable3D.h>
|
||||
#include <vtkm/worklet/contourtree/Mesh3D_DEM_Triangulation_Macros.h>
|
||||
|
@ -83,7 +83,6 @@
|
||||
#ifndef vtkm_worklet_contourtree_mesh3d_dem_vertex_outdegree_starter_h
|
||||
#define vtkm_worklet_contourtree_mesh3d_dem_vertex_outdegree_starter_h
|
||||
|
||||
#include <vtkm/exec/ExecutionWholeArray.h>
|
||||
#include <vtkm/worklet/WorkletMapField.h>
|
||||
#include <vtkm/worklet/contourtree/LinkComponentCaseTable3D.h>
|
||||
#include <vtkm/worklet/contourtree/Mesh3D_DEM_Triangulation_Macros.h>
|
||||
|
@ -84,7 +84,6 @@
|
||||
#define vtkm_worklet_contourtree_mesh3d_dem_vertex_starter_h
|
||||
|
||||
#include <iostream>
|
||||
#include <vtkm/exec/ExecutionWholeArray.h>
|
||||
#include <vtkm/worklet/WorkletMapField.h>
|
||||
#include <vtkm/worklet/contourtree/Mesh3D_DEM_Triangulation_Macros.h>
|
||||
#include <vtkm/worklet/contourtree/VertexValueComparator.h>
|
||||
|
@ -86,7 +86,6 @@
|
||||
#include "vtkm/worklet/contourtree/Mesh2D_DEM_Triangulation_Macros.h"
|
||||
#include "vtkm/worklet/contourtree/Types.h"
|
||||
#include "vtkm/worklet/contourtree/VertexValueComparator.h"
|
||||
#include <vtkm/exec/ExecutionWholeArray.h>
|
||||
#include <vtkm/worklet/WorkletMapField.h>
|
||||
|
||||
namespace vtkm
|
||||
|
@ -68,7 +68,6 @@
|
||||
#define vtkm_worklet_contourtree_regular_to_candidate_h
|
||||
|
||||
#include "vtkm/worklet/contourtree/Types.h"
|
||||
#include <vtkm/exec/ExecutionWholeArray.h>
|
||||
#include <vtkm/worklet/WorkletMapField.h>
|
||||
|
||||
namespace vtkm
|
||||
|
@ -67,7 +67,6 @@
|
||||
#ifndef vtkm_worklet_contourtree_regular_to_critical_down_h
|
||||
#define vtkm_worklet_contourtree_regular_to_critical_down_h
|
||||
|
||||
#include <vtkm/exec/ExecutionWholeArray.h>
|
||||
#include <vtkm/worklet/WorkletMapField.h>
|
||||
#include <vtkm/worklet/contourtree/Types.h>
|
||||
|
||||
|
@ -67,7 +67,6 @@
|
||||
#ifndef vtkm_worklet_contourtree_regular_to_critical_up_h
|
||||
#define vtkm_worklet_contourtree_regular_to_critical_up_h
|
||||
|
||||
#include <vtkm/exec/ExecutionWholeArray.h>
|
||||
#include <vtkm/worklet/WorkletMapField.h>
|
||||
|
||||
namespace vtkm
|
||||
|
@ -67,7 +67,6 @@
|
||||
#ifndef vtkm_worklet_contourtree_reset_degrees_h
|
||||
#define vtkm_worklet_contourtree_reset_degrees_h
|
||||
|
||||
#include <vtkm/exec/ExecutionWholeArray.h>
|
||||
#include <vtkm/worklet/WorkletMapField.h>
|
||||
|
||||
namespace vtkm
|
||||
|
@ -80,7 +80,6 @@
|
||||
#ifndef vtkm_worklet_contourtree_saddle_ascent_functor_h
|
||||
#define vtkm_worklet_contourtree_saddle_ascent_functor_h
|
||||
|
||||
#include <vtkm/exec/ExecutionWholeArray.h>
|
||||
#include <vtkm/worklet/WorkletMapField.h>
|
||||
#include <vtkm/worklet/contourtree/Types.h>
|
||||
|
||||
|
@ -80,7 +80,6 @@
|
||||
#ifndef vtkm_worklet_contourtree_saddle_ascent_transferrer_h
|
||||
#define vtkm_worklet_contourtree_saddle_ascent_transferrer_h
|
||||
|
||||
#include <vtkm/exec/ExecutionWholeArray.h>
|
||||
#include <vtkm/worklet/WorkletMapField.h>
|
||||
|
||||
namespace vtkm
|
||||
|
@ -67,7 +67,6 @@
|
||||
#ifndef vtkm_worklet_contourtree_set_join_and_split_arcs_h
|
||||
#define vtkm_worklet_contourtree_set_join_and_split_arcs_h
|
||||
|
||||
#include <vtkm/exec/ExecutionWholeArray.h>
|
||||
#include <vtkm/worklet/WorkletMapField.h>
|
||||
#include <vtkm/worklet/contourtree/Types.h>
|
||||
|
||||
|
@ -67,7 +67,6 @@
|
||||
#ifndef vtkm_worklet_contourtree_set_supernode_inward_h
|
||||
#define vtkm_worklet_contourtree_set_supernode_inward_h
|
||||
|
||||
#include <vtkm/exec/ExecutionWholeArray.h>
|
||||
#include <vtkm/worklet/WorkletMapField.h>
|
||||
#include <vtkm/worklet/contourtree/Types.h>
|
||||
|
||||
|
@ -67,7 +67,6 @@
|
||||
#ifndef vtkm_worklet_contourtree_skip_vertex_h
|
||||
#define vtkm_worklet_contourtree_skip_vertex_h
|
||||
|
||||
#include <vtkm/exec/ExecutionWholeArray.h>
|
||||
#include <vtkm/worklet/WorkletMapField.h>
|
||||
#include <vtkm/worklet/contourtree/Types.h>
|
||||
|
||||
|
@ -67,7 +67,6 @@
|
||||
#ifndef vtkm_worklet_contourtree_subrange_offset_h
|
||||
#define vtkm_worklet_contourtree_subrange_offset_h
|
||||
|
||||
#include <vtkm/exec/ExecutionWholeArray.h>
|
||||
#include <vtkm/worklet/WorkletMapField.h>
|
||||
|
||||
namespace vtkm
|
||||
|
@ -84,7 +84,6 @@
|
||||
#ifndef vtkm_worklet_contourtree_trunk_builder_h
|
||||
#define vtkm_worklet_contourtree_trunk_builder_h
|
||||
|
||||
#include <vtkm/exec/ExecutionWholeArray.h>
|
||||
#include <vtkm/worklet/WorkletMapField.h>
|
||||
#include <vtkm/worklet/contourtree/Types.h>
|
||||
|
||||
|
@ -67,7 +67,6 @@
|
||||
#ifndef vtkm_worklet_contourtree_update_outbound_h
|
||||
#define vtkm_worklet_contourtree_update_outbound_h
|
||||
|
||||
#include <vtkm/exec/ExecutionWholeArray.h>
|
||||
#include <vtkm/worklet/WorkletMapField.h>
|
||||
#include <vtkm/worklet/contourtree/Types.h>
|
||||
|
||||
|
@ -84,7 +84,6 @@
|
||||
#ifndef vtkm_worklet_contourtree_vertex_degree_updater_h
|
||||
#define vtkm_worklet_contourtree_vertex_degree_updater_h
|
||||
|
||||
#include <vtkm/exec/ExecutionWholeArray.h>
|
||||
#include <vtkm/worklet/WorkletMapField.h>
|
||||
|
||||
namespace vtkm
|
||||
|
@ -61,7 +61,6 @@
|
||||
#ifndef vtkm_worklet_cosmotools_compute_bin_indices_h
|
||||
#define vtkm_worklet_cosmotools_compute_bin_indices_h
|
||||
|
||||
#include <vtkm/exec/ExecutionWholeArray.h>
|
||||
#include <vtkm/worklet/WorkletMapField.h>
|
||||
|
||||
namespace vtkm
|
||||
|
@ -61,7 +61,6 @@
|
||||
#ifndef vtkm_worklet_cosmotools_compute_bin_range_h
|
||||
#define vtkm_worklet_cosmotools_compute_bin_range_h
|
||||
|
||||
#include <vtkm/exec/ExecutionWholeArray.h>
|
||||
#include <vtkm/worklet/WorkletMapField.h>
|
||||
|
||||
namespace vtkm
|
||||
|
@ -61,7 +61,6 @@
|
||||
#ifndef vtkm_worklet_cosmotools_compute_neighbor_bins_h
|
||||
#define vtkm_worklet_cosmotools_compute_neighbor_bins_h
|
||||
|
||||
#include <vtkm/exec/ExecutionWholeArray.h>
|
||||
#include <vtkm/worklet/WorkletMapField.h>
|
||||
|
||||
namespace vtkm
|
||||
|
@ -61,7 +61,6 @@
|
||||
#ifndef vtkm_worklet_cosmotools_compute_potential_h
|
||||
#define vtkm_worklet_cosmotools_compute_potential_h
|
||||
|
||||
#include <vtkm/exec/ExecutionWholeArray.h>
|
||||
#include <vtkm/worklet/WorkletMapField.h>
|
||||
|
||||
namespace vtkm
|
||||
|
@ -61,7 +61,6 @@
|
||||
#ifndef vtkm_worklet_cosmotools_compute_potential_bin_h
|
||||
#define vtkm_worklet_cosmotools_compute_potential_bin_h
|
||||
|
||||
#include <vtkm/exec/ExecutionWholeArray.h>
|
||||
#include <vtkm/worklet/WorkletMapField.h>
|
||||
|
||||
namespace vtkm
|
||||
|
@ -61,7 +61,6 @@
|
||||
#ifndef vtkm_worklet_cosmotools_compute_potential_mxn_h
|
||||
#define vtkm_worklet_cosmotools_compute_potential_mxn_h
|
||||
|
||||
#include <vtkm/exec/ExecutionWholeArray.h>
|
||||
#include <vtkm/worklet/WorkletMapField.h>
|
||||
|
||||
namespace vtkm
|
||||
|
@ -61,7 +61,6 @@
|
||||
#ifndef vtkm_worklet_cosmotools_compute_potential_neighbors_h
|
||||
#define vtkm_worklet_cosmotools_compute_potential_neighbors_h
|
||||
|
||||
#include <vtkm/exec/ExecutionWholeArray.h>
|
||||
#include <vtkm/worklet/WorkletMapField.h>
|
||||
|
||||
namespace vtkm
|
||||
|
@ -61,7 +61,6 @@
|
||||
#ifndef vtkm_worklet_cosmotools_compute_potential_nxn_h
|
||||
#define vtkm_worklet_cosmotools_compute_potential_nxn_h
|
||||
|
||||
#include <vtkm/exec/ExecutionWholeArray.h>
|
||||
#include <vtkm/worklet/WorkletMapField.h>
|
||||
|
||||
namespace vtkm
|
||||
|
@ -61,7 +61,6 @@
|
||||
#ifndef vtkm_worklet_cosmotools_compute_potential_on_candidates_h
|
||||
#define vtkm_worklet_cosmotools_compute_potential_on_candidates_h
|
||||
|
||||
#include <vtkm/exec/ExecutionWholeArray.h>
|
||||
#include <vtkm/worklet/WorkletMapField.h>
|
||||
|
||||
namespace vtkm
|
||||
|
@ -61,7 +61,6 @@
|
||||
#ifndef vtkm_worklet_cosmotools_equals_minimum_potential_h
|
||||
#define vtkm_worklet_cosmotools_equals_minimum_potential_h
|
||||
|
||||
#include <vtkm/exec/ExecutionWholeArray.h>
|
||||
#include <vtkm/worklet/WorkletMapField.h>
|
||||
|
||||
namespace vtkm
|
||||
|
@ -61,7 +61,6 @@
|
||||
#ifndef vtkm_worklet_cosmotools_graft_particle_h
|
||||
#define vtkm_worklet_cosmotools_graft_particle_h
|
||||
|
||||
#include <vtkm/exec/ExecutionWholeArray.h>
|
||||
#include <vtkm/worklet/WorkletMapField.h>
|
||||
#include <vtkm/worklet/cosmotools/TagTypes.h>
|
||||
|
||||
|
@ -61,7 +61,6 @@
|
||||
#ifndef vtkm_worklet_cosmotools_is_star_h
|
||||
#define vtkm_worklet_cosmotools_is_star_h
|
||||
|
||||
#include <vtkm/exec/ExecutionWholeArray.h>
|
||||
#include <vtkm/worklet/WorkletMapField.h>
|
||||
|
||||
namespace vtkm
|
||||
|
@ -61,7 +61,6 @@
|
||||
#ifndef vtkm_worklet_cosmotools_mark_active_neighbors_h
|
||||
#define vtkm_worklet_cosmotools_mark_active_neighbors_h
|
||||
|
||||
#include <vtkm/exec/ExecutionWholeArray.h>
|
||||
#include <vtkm/worklet/WorkletMapField.h>
|
||||
#include <vtkm/worklet/cosmotools/TagTypes.h>
|
||||
|
||||
|
@ -61,7 +61,6 @@
|
||||
#ifndef vtkm_worklet_cosmotools_pointer_jump_h
|
||||
#define vtkm_worklet_cosmotools_pointer_jump_h
|
||||
|
||||
#include <vtkm/exec/ExecutionWholeArray.h>
|
||||
#include <vtkm/worklet/WorkletMapField.h>
|
||||
|
||||
namespace vtkm
|
||||
|
@ -61,7 +61,6 @@
|
||||
#ifndef vtkm_worklet_cosmotools_set_candidate_particles_h
|
||||
#define vtkm_worklet_cosmotools_set_candidate_particles_h
|
||||
|
||||
#include <vtkm/exec/ExecutionWholeArray.h>
|
||||
#include <vtkm/worklet/WorkletMapField.h>
|
||||
|
||||
namespace vtkm
|
||||
|
@ -61,7 +61,6 @@
|
||||
#ifndef vtkm_worklet_cosmotools_valid_halo_h
|
||||
#define vtkm_worklet_cosmotools_valid_halo_h
|
||||
|
||||
#include <vtkm/exec/ExecutionWholeArray.h>
|
||||
#include <vtkm/worklet/WorkletMapField.h>
|
||||
|
||||
namespace vtkm
|
||||
|
@ -25,7 +25,6 @@
|
||||
#include <vtkm/cont/DataSetBuilderUniform.h>
|
||||
#include <vtkm/cont/DeviceAdapter.h>
|
||||
#include <vtkm/cont/testing/Testing.h>
|
||||
#include <vtkm/exec/ExecutionWholeArray.h>
|
||||
#include <vtkm/worklet/ParticleAdvection.h>
|
||||
#include <vtkm/worklet/particleadvection/GridEvaluators.h>
|
||||
#include <vtkm/worklet/particleadvection/Integrators.h>
|
||||
|
@ -24,35 +24,34 @@
|
||||
#include <vtkm/worklet/DispatcherMapField.h>
|
||||
#include <vtkm/worklet/WorkletMapField.h>
|
||||
|
||||
#include <vtkm/exec/ExecutionWholeArray.h>
|
||||
|
||||
#include <vtkm/cont/testing/Testing.h>
|
||||
|
||||
class TestExecObjectWorklet : public vtkm::worklet::WorkletMapField
|
||||
struct TestExecObjectWorklet
|
||||
{
|
||||
public:
|
||||
typedef void ControlSignature(FieldIn<>, ExecObject, ExecObject, FieldOut<>);
|
||||
typedef void ExecutionSignature(_1, _2, _3, _4);
|
||||
|
||||
template <typename T, typename StorageTag>
|
||||
VTKM_EXEC void operator()(const vtkm::Id& index,
|
||||
const vtkm::exec::ExecutionWholeArrayConst<T, StorageTag>& execIn,
|
||||
vtkm::exec::ExecutionWholeArray<T, StorageTag>& execOut,
|
||||
T& out) const
|
||||
template <typename T>
|
||||
class Worklet : public vtkm::worklet::WorkletMapField
|
||||
{
|
||||
if (!test_equal(execIn.Get(index), TestValue(index, T()) + T(100)))
|
||||
public:
|
||||
typedef void ControlSignature(FieldIn<IdType>,
|
||||
WholeArrayIn<vtkm::ListTagBase<T>>,
|
||||
WholeArrayOut<vtkm::ListTagBase<T>>,
|
||||
FieldOut<vtkm::ListTagBase<T>>);
|
||||
typedef void ExecutionSignature(_1, _2, _3, _4);
|
||||
|
||||
template <typename InPortalType, typename OutPortalType>
|
||||
VTKM_EXEC void operator()(const vtkm::Id& index,
|
||||
const InPortalType& execIn,
|
||||
OutPortalType& execOut,
|
||||
T& out) const
|
||||
{
|
||||
this->RaiseError("Got wrong input value.");
|
||||
if (!test_equal(execIn.Get(index), TestValue(index, T()) + T(100)))
|
||||
{
|
||||
this->RaiseError("Got wrong input value.");
|
||||
}
|
||||
out = execIn.Get(index) - T(100);
|
||||
execOut.Set(index, out);
|
||||
}
|
||||
out = execIn.Get(index) - T(100);
|
||||
execOut.Set(index, out);
|
||||
}
|
||||
|
||||
template <typename T1, typename T2, typename T3>
|
||||
VTKM_EXEC void operator()(const vtkm::Id&, const T1&, const T2&, const T3&) const
|
||||
{
|
||||
this->RaiseError("Cannot call this worklet with different types.");
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
namespace map_exec_field
|
||||
@ -78,13 +77,11 @@ struct DoTestWorklet
|
||||
vtkm::cont::ArrayHandle<T> inputHandle = vtkm::cont::make_ArrayHandle(inputArray, ARRAY_SIZE);
|
||||
vtkm::cont::ArrayHandle<T> outputHandle;
|
||||
vtkm::cont::ArrayHandle<T> outputFieldArray;
|
||||
outputHandle.Allocate(ARRAY_SIZE);
|
||||
|
||||
std::cout << "Create and run dispatcher." << std::endl;
|
||||
vtkm::worklet::DispatcherMapField<WorkletType> dispatcher;
|
||||
dispatcher.Invoke(counting,
|
||||
vtkm::exec::ExecutionWholeArrayConst<T>(inputHandle),
|
||||
vtkm::exec::ExecutionWholeArray<T>(outputHandle, ARRAY_SIZE),
|
||||
outputFieldArray);
|
||||
vtkm::worklet::DispatcherMapField<typename WorkletType::template Worklet<T>> dispatcher;
|
||||
dispatcher.Invoke(counting, inputHandle, outputHandle, outputFieldArray);
|
||||
|
||||
std::cout << "Check result." << std::endl;
|
||||
CheckPortal(outputHandle.GetPortalConstControl());
|
||||
@ -94,12 +91,10 @@ struct DoTestWorklet
|
||||
// Clear out output arrays.
|
||||
outputFieldArray = vtkm::cont::ArrayHandle<T>();
|
||||
outputHandle = vtkm::cont::ArrayHandle<T>();
|
||||
outputHandle.Allocate(ARRAY_SIZE);
|
||||
|
||||
vtkm::cont::DynamicArrayHandle outputFieldDynamic(outputFieldArray);
|
||||
dispatcher.Invoke(counting,
|
||||
vtkm::exec::ExecutionWholeArrayConst<T>(inputHandle),
|
||||
vtkm::exec::ExecutionWholeArray<T>(outputHandle, ARRAY_SIZE),
|
||||
outputFieldDynamic);
|
||||
dispatcher.Invoke(counting, inputHandle, outputHandle, outputFieldDynamic);
|
||||
|
||||
std::cout << "Check dynamic array result." << std::endl;
|
||||
CheckPortal(outputHandle.GetPortalConstControl());
|
||||
@ -110,7 +105,7 @@ struct DoTestWorklet
|
||||
void TestWorkletMapFieldExecArg()
|
||||
{
|
||||
typedef vtkm::cont::DeviceAdapterTraits<VTKM_DEFAULT_DEVICE_ADAPTER_TAG> DeviceAdapterTraits;
|
||||
std::cout << "Testing Worklet with ExecutionWholeArray on device adapter: "
|
||||
std::cout << "Testing Worklet with WholeArray on device adapter: "
|
||||
<< DeviceAdapterTraits::GetName() << std::endl;
|
||||
|
||||
std::cout << "--- Worklet accepting all types." << std::endl;
|
||||
|
Loading…
Reference in New Issue
Block a user