Commit af250acb authored by Matthew Letter's avatar Matthew Letter Committed by Matthew Letter
Browse files

added PrepareForExecution to compile code base

added prepare for execution function to all the execution object factories that did not have it implemented to compile the code base
parent cc7035ae
......@@ -722,7 +722,7 @@ public:
const vtkm::cont::ArrayHandle<vtkm::Vec<PointComponentType, 3>, PointStorageType>& points,
vtkm::cont::ArrayHandle<vtkm::Id>& cellIds,
vtkm::cont::ArrayHandle<FloatVec3>& parametricCoords,
DeviceAdapter device,
DeviceAdapter,
CellSetList cellSetTypes = CellSetList()) const
{
vtkm::worklet::DispatcherMapField<FindCellWorklet, DeviceAdapter>().Invoke(
......
......@@ -129,6 +129,12 @@ public:
{
}
template <typename Device>
VTKM_CONT Texture2DSampler<Device> PrepareForExecution(Device) const
{
return *this;
}
VTKM_EXEC
inline ColorType GetColor(vtkm::Float32 u, vtkm::Float32 v) const
{
......
......@@ -67,7 +67,7 @@ VTKM_EXEC_CONT vtkm::Vec<T, NumComponents> Scale(const vtkm::Vec<T, NumComponent
}
template <typename DeviceAdapter>
class ExecutionConnectivityExplicit : vtkm::cont::ExecutionObjectFactoryBase
class ExecutionObject
{
private:
using UInt8Portal =
......@@ -81,7 +81,7 @@ private:
public:
VTKM_CONT
ExecutionConnectivityExplicit()
ExecutionObject()
: Shapes()
, NumIndices()
, Connectivity()
......@@ -90,17 +90,16 @@ public:
}
VTKM_CONT
ExecutionConnectivityExplicit(const UInt8Portal& shapes,
const IdComponentPortal& numIndices,
const IdPortal& connectivity,
const IdPortal& indexOffsets)
ExecutionObject(const UInt8Portal& shapes,
const IdComponentPortal& numIndices,
const IdPortal& connectivity,
const IdPortal& indexOffsets)
: Shapes(shapes)
, NumIndices(numIndices)
, Connectivity(connectivity)
, IndexOffsets(indexOffsets)
{
}
VTKM_EXEC
void SetCellShape(vtkm::Id cellIndex, vtkm::UInt8 shape) { this->Shapes.Set(cellIndex, shape); }
......@@ -129,6 +128,55 @@ private:
IdPortal IndexOffsets;
};
template <typename DeviceAdapter>
class ExecutionConnectivityExplicit : vtkm::cont::ExecutionObjectFactoryBase
{
private:
using UInt8Portal =
typename vtkm::cont::ArrayHandle<vtkm::UInt8>::template ExecutionTypes<DeviceAdapter>::Portal;
using IdComponentPortal = typename vtkm::cont::ArrayHandle<
vtkm::IdComponent>::template ExecutionTypes<DeviceAdapter>::Portal;
using IdPortal =
typename vtkm::cont::ArrayHandle<vtkm::Id>::template ExecutionTypes<DeviceAdapter>::Portal;
public:
VTKM_CONT
ExecutionConnectivityExplicit()
: Shapes()
, NumIndices()
, Connectivity()
, IndexOffsets()
{
}
VTKM_CONT
ExecutionConnectivityExplicit(const UInt8Portal& shapes,
const IdComponentPortal& numIndices,
const IdPortal& connectivity,
const IdPortal& indexOffsets)
: Shapes(shapes)
, NumIndices(numIndices)
, Connectivity(connectivity)
, IndexOffsets(indexOffsets)
{
}
template <typename Device>
VTKM_CONT ExecutionObject<Device> PrepareForExecution(Device) const
{
ExecutionObject<Device> object(
this->Shapes, this->NumIndices, this->Connectivity, this->IndexOffsets);
return object;
}
private:
UInt8Portal Shapes;
IdComponentPortal NumIndices;
IdPortal Connectivity;
IdPortal IndexOffsets;
};
} // namespace internal
struct ClipStats
......@@ -285,20 +333,20 @@ public:
template <typename CellShapeTag,
typename ScalarsVecType,
typename IndicesVecType,
typename ExecutinoObjectType,
typename InterpolationWholeArrayType,
typename ReverseMapWholeArrayType,
typename CellMapType>
VTKM_EXEC void operator()(
CellShapeTag shape,
vtkm::Id inputCellIdx,
const ScalarsVecType& scalars,
const IndicesVecType& indices,
vtkm::Id clipTableIdx,
ClipStats cellSetIndices,
internal::ExecutionConnectivityExplicit<DeviceAdapter>& connectivityExplicit,
InterpolationWholeArrayType& interpolation,
ReverseMapWholeArrayType& newPointsConnectivityReverseMap,
CellMapType& cellMap) const
VTKM_EXEC void operator()(CellShapeTag shape,
vtkm::Id inputCellIdx,
const ScalarsVecType& scalars,
const IndicesVecType& indices,
vtkm::Id clipTableIdx,
ClipStats cellSetIndices,
ExecutinoObjectType& connectivityExplicit,
InterpolationWholeArrayType& interpolation,
ReverseMapWholeArrayType& newPointsConnectivityReverseMap,
CellMapType& cellMap) const
{
(void)shape; //C4100 false positive workaround
vtkm::Id idx = clipTableIdx;
......
......@@ -88,12 +88,16 @@ static vtkm::IdComponent TriangleIndexData[] = {
3
};
template <typename Device>
template <typename DeviceAdapter>
class TriangulateTablesExecutionObject : public vtkm::cont::ExecutionObjectFactoryBase
{
public:
using PortalType = typename TriangulateArrayHandle::ExecutionTypes<Device>::PortalConst;
using PortalType = typename TriangulateArrayHandle::ExecutionTypes<DeviceAdapter>::PortalConst;
template <typename Device>
VTKM_CONT TriangulateTablesExecutionObject PrepareForExecution(Device) const
{
return *this;
}
VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC
TriangulateTablesExecutionObject() {}
......@@ -102,9 +106,9 @@ public:
TriangulateTablesExecutionObject(const TriangulateArrayHandle& counts,
const TriangulateArrayHandle& offsets,
const TriangulateArrayHandle& indices)
: Counts(counts.PrepareForInput(Device()))
, Offsets(offsets.PrepareForInput(Device()))
, Indices(indices.PrepareForInput(Device()))
: Counts(counts.PrepareForInput(DeviceAdapter()))
, Offsets(offsets.PrepareForInput(DeviceAdapter()))
, Indices(indices.PrepareForInput(DeviceAdapter()))
{
}
......@@ -261,12 +265,16 @@ static vtkm::IdComponent TetrahedronIndexData[] = {
4
};
template <typename Device>
template <typename DeviceAdapter>
class TetrahedralizeTablesExecutionObject : public vtkm::cont::ExecutionObjectFactoryBase
{
public:
using PortalType = typename TriangulateArrayHandle::ExecutionTypes<Device>::PortalConst;
using PortalType = typename TriangulateArrayHandle::ExecutionTypes<DeviceAdapter>::PortalConst;
template <typename Device>
VTKM_CONT TetrahedralizeTablesExecutionObject PrepareForExecution(Device) const
{
return *this;
}
VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC
TetrahedralizeTablesExecutionObject() {}
......@@ -275,9 +283,9 @@ public:
TetrahedralizeTablesExecutionObject(const TriangulateArrayHandle& counts,
const TriangulateArrayHandle& offsets,
const TriangulateArrayHandle& indices)
: Counts(counts.PrepareForInput(Device()))
, Offsets(offsets.PrepareForInput(Device()))
, Indices(indices.PrepareForInput(Device()))
: Counts(counts.PrepareForInput(DeviceAdapter()))
, Offsets(offsets.PrepareForInput(DeviceAdapter()))
, Indices(indices.PrepareForInput(DeviceAdapter()))
{
}
......
......@@ -54,6 +54,12 @@ private:
DeviceAdapterTag>::Portal;
public:
template <typename Device>
VTKM_CONT Particles PrepareForExecution(Device) const
{
return *this;
}
VTKM_EXEC_CONT
Particles()
: Pos()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment