Commit 33a30299 authored by Robert Maynard's avatar Robert Maynard Committed by Kitware Robot

Merge topic 'more_minor_style_and_export_corrections'

bdabfbe1 Make sure ArrayPortalUniformPointCoordinates constructor is explicit
b3d951b5 vtkm::Range Include function now requires half as many min/max calls
ddaa0df2 ArrayHandleVirtualCoordinates now calls the proper parent constructor
61e80037 Make sure all execution side CellLocator objects have explicit destructors
307898ff Cleanup the CellLocatorBoundingIntervalHierarchy.cxx style.
0f31c69f Remove unnecessary constructor from ParameterContainer
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !1657
parents c399a812 bdabfbe1
......@@ -136,8 +136,8 @@ struct Range
{
if (range.IsNonEmpty())
{
this->Include(range.Min);
this->Include(range.Max);
this->Min = vtkm::Min(this->Min, range.Min);
this->Max = vtkm::Max(this->Max, range.Max);
}
}
......
......@@ -37,7 +37,8 @@ public:
template <typename T, typename S>
explicit ArrayHandleVirtualCoordinates(const vtkm::cont::ArrayHandle<T, S>& ah)
: Superclass(vtkm::cont::make_ArrayHandleCast<ValueType>(ah))
: vtkm::cont::ArrayHandleVirtual<vtkm::Vec<vtkm::FloatDefault, 3>>(
vtkm::cont::make_ArrayHandleCast<ValueType>(ah))
{
}
};
......
......@@ -51,7 +51,7 @@ using SplitPropertiesArrayHandle =
namespace
{
VTKM_CONT IdArrayHandle CalculateSegmentSizes(const IdArrayHandle& segmentIds, vtkm::Id numCells)
IdArrayHandle CalculateSegmentSizes(const IdArrayHandle& segmentIds, vtkm::Id numCells)
{
IdArrayHandle discardKeys;
IdArrayHandle segmentSizes;
......@@ -63,7 +63,7 @@ VTKM_CONT IdArrayHandle CalculateSegmentSizes(const IdArrayHandle& segmentIds, v
return segmentSizes;
}
VTKM_CONT IdArrayHandle GenerateSegmentIds(const IdArrayHandle& segmentSizes, vtkm::Id numCells)
IdArrayHandle GenerateSegmentIds(const IdArrayHandle& segmentSizes, vtkm::Id numCells)
{
// Compact segment ids, removing non-contiguous values.
......@@ -77,15 +77,15 @@ VTKM_CONT IdArrayHandle GenerateSegmentIds(const IdArrayHandle& segmentSizes, vt
return segmentIds;
}
VTKM_CONT void CalculatePlaneSplitCost(vtkm::IdComponent planeIndex,
vtkm::IdComponent numPlanes,
RangePermutationArrayHandle& segmentRanges,
RangeArrayHandle& ranges,
CoordsArrayHandle& coords,
IdArrayHandle& segmentIds,
SplitPropertiesArrayHandle& splits,
vtkm::IdComponent index,
vtkm::IdComponent numTotalPlanes)
void CalculatePlaneSplitCost(vtkm::IdComponent planeIndex,
vtkm::IdComponent numPlanes,
RangePermutationArrayHandle& segmentRanges,
RangeArrayHandle& ranges,
CoordsArrayHandle& coords,
IdArrayHandle& segmentIds,
SplitPropertiesArrayHandle& splits,
vtkm::IdComponent index,
vtkm::IdComponent numTotalPlanes)
{
vtkm::worklet::Invoker invoker;
......@@ -154,12 +154,12 @@ VTKM_CONT void CalculatePlaneSplitCost(vtkm::IdComponent planeIndex,
splits);
}
VTKM_CONT void CalculateSplitCosts(vtkm::IdComponent numPlanes,
RangePermutationArrayHandle& segmentRanges,
RangeArrayHandle& ranges,
CoordsArrayHandle& coords,
IdArrayHandle& segmentIds,
SplitPropertiesArrayHandle& splits)
void CalculateSplitCosts(vtkm::IdComponent numPlanes,
RangePermutationArrayHandle& segmentRanges,
RangeArrayHandle& ranges,
CoordsArrayHandle& coords,
IdArrayHandle& segmentIds,
SplitPropertiesArrayHandle& splits)
{
for (vtkm::IdComponent planeIndex = 0; planeIndex < numPlanes; ++planeIndex)
{
......@@ -178,9 +178,9 @@ VTKM_CONT void CalculateSplitCosts(vtkm::IdComponent numPlanes,
0, 1, segmentRanges, ranges, coords, segmentIds, splits, numPlanes, numPlanes);
}
VTKM_CONT IdArrayHandle CalculateSplitScatterIndices(const IdArrayHandle& cellIds,
const IdArrayHandle& leqFlags,
const IdArrayHandle& segmentIds)
IdArrayHandle CalculateSplitScatterIndices(const IdArrayHandle& cellIds,
const IdArrayHandle& leqFlags,
const IdArrayHandle& segmentIds)
{
vtkm::worklet::Invoker invoker;
......@@ -225,9 +225,9 @@ VTKM_CONT IdArrayHandle CalculateSplitScatterIndices(const IdArrayHandle& cellId
} // anonymous namespace
VTKM_CONT CellLocatorBoundingIntervalHierarchy::~CellLocatorBoundingIntervalHierarchy() = default;
CellLocatorBoundingIntervalHierarchy::~CellLocatorBoundingIntervalHierarchy() = default;
VTKM_CONT
void CellLocatorBoundingIntervalHierarchy::Build()
{
vtkm::worklet::Invoker invoker;
......@@ -451,7 +451,7 @@ namespace
struct CellLocatorBIHPrepareForExecutionFunctor
{
template <typename DeviceAdapter, typename CellSetType>
VTKM_CONT bool operator()(
bool operator()(
DeviceAdapter,
const CellSetType& cellset,
vtkm::cont::VirtualObjectHandle<vtkm::exec::CellLocator>& bihExec,
......@@ -471,9 +471,7 @@ struct CellLocatorBIHPrepareForExecutionFunctor
struct BIHCellSetCaster
{
template <typename CellSet, typename... Args>
VTKM_CONT void operator()(CellSet&& cellset,
vtkm::cont::DeviceAdapterId device,
Args&&... args) const
void operator()(CellSet&& cellset, vtkm::cont::DeviceAdapterId device, Args&&... args) const
{
//We need to go though CastAndCall first
const bool success = vtkm::cont::TryExecuteOnDevice(
......@@ -486,7 +484,7 @@ struct BIHCellSetCaster
};
}
VTKM_CONT
const vtkm::exec::CellLocator* CellLocatorBoundingIntervalHierarchy::PrepareForExecution(
vtkm::cont::DeviceAdapterId device) const
{
......
......@@ -84,7 +84,7 @@ namespace exec
//--------------------------------------------------------------------
template <typename CellSetType, typename DeviceAdapter>
class CellLocatorUniformBins : public vtkm::exec::CellLocator
class VTKM_ALWAYS_EXPORT CellLocatorUniformBins : public vtkm::exec::CellLocator
{
private:
using DimVec3 = vtkm::internal::cl_uniform_bins::DimVec3;
......@@ -146,6 +146,12 @@ public:
{
}
VTKM_EXEC_CONT virtual ~CellLocatorUniformBins() noexcept
{
// This must not be defaulted, since defaulted virtual destructors are
// troublesome with CUDA __host__ __device__ markup.
}
VTKM_EXEC
void FindCell(const FloatVec3& point,
vtkm::Id& cellId,
......
......@@ -22,6 +22,12 @@ namespace exec
class CellLocator : public vtkm::VirtualObjectBase
{
public:
VTKM_EXEC_CONT virtual ~CellLocator() noexcept
{
// This must not be defaulted, since defaulted virtual destructors are
// troublesome with CUDA __host__ __device__ markup.
}
VTKM_EXEC
virtual void FindCell(const vtkm::Vec<vtkm::FloatDefault, 3>& point,
vtkm::Id& cellId,
......
......@@ -52,7 +52,7 @@ struct CellLocatorBoundingIntervalHierarchyNode
}; // struct CellLocatorBoundingIntervalHierarchyNode
template <typename DeviceAdapter, typename CellSetType>
class CellLocatorBoundingIntervalHierarchyExec : public vtkm::exec::CellLocator
class VTKM_ALWAYS_EXPORT CellLocatorBoundingIntervalHierarchyExec : public vtkm::exec::CellLocator
{
using NodeArrayHandle =
vtkm::cont::ArrayHandle<vtkm::exec::CellLocatorBoundingIntervalHierarchyNode>;
......@@ -75,6 +75,13 @@ public:
{
}
VTKM_EXEC_CONT virtual ~CellLocatorBoundingIntervalHierarchyExec() noexcept
{
// This must not be defaulted, since defaulted virtual destructors are
// troublesome with CUDA __host__ __device__ markup.
}
VTKM_EXEC
void FindCell(const vtkm::Vec<vtkm::FloatDefault, 3>& point,
vtkm::Id& cellId,
......
......@@ -29,7 +29,7 @@ namespace exec
{
template <typename DeviceAdapter>
class CellLocatorRectilinearGrid : public vtkm::exec::CellLocator
class VTKM_ALWAYS_EXPORT CellLocatorRectilinearGrid : public vtkm::exec::CellLocator
{
private:
using FromType = vtkm::TopologyElementTagPoint;
......@@ -71,6 +71,12 @@ public:
this->MaxPoint[2] = coords.GetPortalConstControl().GetThirdPortal().Get(PointDimensions[2] - 1);
}
VTKM_EXEC_CONT virtual ~CellLocatorRectilinearGrid() noexcept
{
// This must not be defaulted, since defaulted virtual destructors are
// troublesome with CUDA __host__ __device__ markup.
}
VTKM_EXEC
inline bool IsInside(const vtkm::Vec<vtkm::FloatDefault, 3>& point) const
{
......
......@@ -28,7 +28,7 @@ namespace exec
{
template <typename DeviceAdapter>
class CellLocatorUniformGrid : public vtkm::exec::CellLocator
class VTKM_ALWAYS_EXPORT CellLocatorUniformGrid : public vtkm::exec::CellLocator
{
private:
using FromType = vtkm::TopologyElementTagPoint;
......@@ -57,6 +57,12 @@ public:
{
}
VTKM_EXEC_CONT virtual ~CellLocatorUniformGrid() noexcept
{
// This must not be defaulted, since defaulted virtual destructors are
// troublesome with CUDA __host__ __device__ markup.
}
VTKM_EXEC
void FindCell(const vtkm::Vec<vtkm::FloatDefault, 3>& point,
vtkm::Id& cellId,
......
......@@ -25,7 +25,14 @@ class VTKM_ALWAYS_EXPORT ArrayPortalUniformPointCoordinates
public:
using ValueType = vtkm::Vec<vtkm::FloatDefault, 3>;
ArrayPortalUniformPointCoordinates() = default;
VTKM_EXEC_CONT
ArrayPortalUniformPointCoordinates()
: Dimensions(0)
, NumberOfValues(0)
, Origin(0, 0, 0)
, Spacing(1, 1, 1)
{
}
VTKM_EXEC_CONT
ArrayPortalUniformPointCoordinates(vtkm::Id3 dimensions, ValueType origin, ValueType spacing)
......
......@@ -66,16 +66,12 @@ struct ParameterContainer;
template <typename R>
struct ParameterContainer<R()>
{
VTKM_SUPPRESS_EXEC_WARNINGS
~ParameterContainer() = default;
};
template <typename R,
typename P1>
struct ParameterContainer<R(P1)>
{
VTKM_SUPPRESS_EXEC_WARNINGS
~ParameterContainer() = default;
P1 Parameter1;
};
......@@ -84,8 +80,6 @@ template <typename R,
typename P2>
struct ParameterContainer<R(P1, P2)>
{
VTKM_SUPPRESS_EXEC_WARNINGS
~ParameterContainer() = default;
P1 Parameter1;
P2 Parameter2;
};
......@@ -96,8 +90,6 @@ template <typename R,
typename P3>
struct ParameterContainer<R(P1, P2, P3)>
{
VTKM_SUPPRESS_EXEC_WARNINGS
~ParameterContainer() = default;
P1 Parameter1;
P2 Parameter2;
P3 Parameter3;
......@@ -110,8 +102,6 @@ template <typename R,
typename P4>
struct ParameterContainer<R(P1, P2, P3, P4)>
{
VTKM_SUPPRESS_EXEC_WARNINGS
~ParameterContainer() = default;
P1 Parameter1;
P2 Parameter2;
P3 Parameter3;
......@@ -126,8 +116,6 @@ template <typename R,
typename P5>
struct ParameterContainer<R(P1, P2, P3, P4, P5)>
{
VTKM_SUPPRESS_EXEC_WARNINGS
~ParameterContainer() = default;
P1 Parameter1;
P2 Parameter2;
P3 Parameter3;
......@@ -144,8 +132,6 @@ template <typename R,
typename P6>
struct ParameterContainer<R(P1, P2, P3, P4, P5, P6)>
{
VTKM_SUPPRESS_EXEC_WARNINGS
~ParameterContainer() = default;
P1 Parameter1;
P2 Parameter2;
P3 Parameter3;
......@@ -164,8 +150,6 @@ template <typename R,
typename P7>
struct ParameterContainer<R(P1, P2, P3, P4, P5, P6, P7)>
{
VTKM_SUPPRESS_EXEC_WARNINGS
~ParameterContainer() = default;
P1 Parameter1;
P2 Parameter2;
P3 Parameter3;
......@@ -186,8 +170,6 @@ template <typename R,
typename P8>
struct ParameterContainer<R(P1, P2, P3, P4, P5, P6, P7, P8)>
{
VTKM_SUPPRESS_EXEC_WARNINGS
~ParameterContainer() = default;
P1 Parameter1;
P2 Parameter2;
P3 Parameter3;
......@@ -210,8 +192,6 @@ template <typename R,
typename P9>
struct ParameterContainer<R(P1, P2, P3, P4, P5, P6, P7, P8, P9)>
{
VTKM_SUPPRESS_EXEC_WARNINGS
~ParameterContainer() = default;
P1 Parameter1;
P2 Parameter2;
P3 Parameter3;
......@@ -236,8 +216,6 @@ template <typename R,
typename P10>
struct ParameterContainer<R(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10)>
{
VTKM_SUPPRESS_EXEC_WARNINGS
~ParameterContainer() = default;
P1 Parameter1;
P2 Parameter2;
P3 Parameter3;
......@@ -264,8 +242,6 @@ template <typename R,
typename P11>
struct ParameterContainer<R(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11)>
{
VTKM_SUPPRESS_EXEC_WARNINGS
~ParameterContainer() = default;
P1 Parameter1;
P2 Parameter2;
P3 Parameter3;
......@@ -294,8 +270,6 @@ template <typename R,
typename P12>
struct ParameterContainer<R(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12)>
{
VTKM_SUPPRESS_EXEC_WARNINGS
~ParameterContainer() = default;
P1 Parameter1;
P2 Parameter2;
P3 Parameter3;
......@@ -326,8 +300,6 @@ template <typename R,
typename P13>
struct ParameterContainer<R(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13)>
{
VTKM_SUPPRESS_EXEC_WARNINGS
~ParameterContainer() = default;
P1 Parameter1;
P2 Parameter2;
P3 Parameter3;
......@@ -360,8 +332,6 @@ template <typename R,
typename P14>
struct ParameterContainer<R(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14)>
{
VTKM_SUPPRESS_EXEC_WARNINGS
~ParameterContainer() = default;
P1 Parameter1;
P2 Parameter2;
P3 Parameter3;
......@@ -396,8 +366,6 @@ template <typename R,
typename P15>
struct ParameterContainer<R(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15)>
{
VTKM_SUPPRESS_EXEC_WARNINGS
~ParameterContainer() = default;
P1 Parameter1;
P2 Parameter2;
P3 Parameter3;
......@@ -434,8 +402,6 @@ template <typename R,
typename P16>
struct ParameterContainer<R(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16)>
{
VTKM_SUPPRESS_EXEC_WARNINGS
~ParameterContainer() = default;
P1 Parameter1;
P2 Parameter2;
P3 Parameter3;
......@@ -474,8 +440,6 @@ template <typename R,
typename P17>
struct ParameterContainer<R(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17)>
{
VTKM_SUPPRESS_EXEC_WARNINGS
~ParameterContainer() = default;
P1 Parameter1;
P2 Parameter2;
P3 Parameter3;
......@@ -516,8 +480,6 @@ template <typename R,
typename P18>
struct ParameterContainer<R(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18)>
{
VTKM_SUPPRESS_EXEC_WARNINGS
~ParameterContainer() = default;
P1 Parameter1;
P2 Parameter2;
P3 Parameter3;
......@@ -560,8 +522,6 @@ template <typename R,
typename P19>
struct ParameterContainer<R(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19)>
{
VTKM_SUPPRESS_EXEC_WARNINGS
~ParameterContainer() = default;
P1 Parameter1;
P2 Parameter2;
P3 Parameter3;
......@@ -606,8 +566,6 @@ template <typename R,
typename P20>
struct ParameterContainer<R(P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19, P20)>
{
VTKM_SUPPRESS_EXEC_WARNINGS
~ParameterContainer() = default;
P1 Parameter1;
P2 Parameter2;
P3 Parameter3;
......
......@@ -113,8 +113,6 @@ $for(num_params in range(0, max_parameters+1))\
template <$template_params(num_params)>
struct ParameterContainer<$signature(num_params)>
{
VTKM_SUPPRESS_EXEC_WARNINGS
~ParameterContainer() = default;
$for(param_index in range(1, num_params+1))\
$ptype(param_index) Parameter$(param_index);
$endfor\
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment