Commit dcbb444a authored by Abhishek Yenpure's avatar Abhishek Yenpure Committed by Abhishek Yenpure
Browse files

Warning fixes for BoundingIntervalHierarchy

- Adding VTKM_CONT_EXPORT to CellLocator
- Removing whitespaces
- Fixing warnings of unused typedef
parent 50963290
......@@ -26,6 +26,8 @@ namespace vtkm
namespace cont
{
using HandleType = vtkm::cont::VirtualObjectHandle<vtkm::exec::CellLocator>;
VTKM_CONT
void BoundingIntervalHierarchy::Build()
{
......@@ -34,14 +36,19 @@ void BoundingIntervalHierarchy::Build()
}
VTKM_CONT
const vtkm::exec::CellLocator* BoundingIntervalHierarchy::PrepareForExecutionImpl(
const vtkm::Int8 device) const
const HandleType BoundingIntervalHierarchy::PrepareForExecutionImpl(const vtkm::Int8 deviceId) const
{
using DeviceList = VTKM_DEFAULT_DEVICE_ADAPTER_LIST_TAG;
/*using DeviceList = VTKM_DEFAULT_DEVICE_ADAPTER_LIST_TAG;
const vtkm::exec::CellLocator* toReturn;
vtkm::cont::internal::FindDeviceAdapterTagAndCall(
device, DeviceList(), PrepareForExecutionFunctor(), this, &toReturn);
return toReturn;
device, DeviceList(), PrepareForExecutionFunctor(), *this, &toReturn);
return toReturn;*/
using DeviceList = VTKM_DEFAULT_DEVICE_ADAPTER_LIST_TAG;
//HandleType ExecHandle; // = new HandleType(locator, false);
vtkm::cont::internal::FindDeviceAdapterTagAndCall(
deviceId, DeviceList(), PrepareForExecutionFunctor(), *this, this->ExecHandle);
return this->ExecHandle;
}
}
}
......@@ -43,6 +43,7 @@ private:
vtkm::cont::ArrayHandlePermutation<IdArrayHandle, RangeArrayHandle>;
using SplitPropertiesArrayHandle =
vtkm::cont::ArrayHandle<vtkm::worklet::spatialstructure::SplitProperties>;
using HandleType = vtkm::cont::VirtualObjectHandle<vtkm::exec::CellLocator>;
class BuildFunctor;
class PrepareForExecutionFunctor;
......@@ -111,13 +112,14 @@ protected:
void Build() override;
VTKM_CONT
const vtkm::exec::CellLocator* PrepareForExecutionImpl(const vtkm::Int8 device) const override;
virtual const HandleType PrepareForExecutionImpl(const vtkm::Int8 device) const override;
private:
vtkm::IdComponent NumPlanes;
vtkm::IdComponent MaxLeafSize;
vtkm::cont::ArrayHandle<BoundingIntervalHierarchyNode> Nodes;
IdArrayHandle ProcessedCellIds;
mutable HandleType ExecHandle;
};
} // namespace cont
......
......@@ -58,6 +58,9 @@ using SplitPermutationArrayHandle =
vtkm::cont::ArrayHandlePermutation<IdArrayHandle, SplitArrayHandle>;
using SplitPropertiesArrayHandle =
vtkm::cont::ArrayHandle<vtkm::worklet::spatialstructure::SplitProperties>;
using HandleType = vtkm::cont::VirtualObjectHandle<vtkm::exec::CellLocator>;
template <typename DeviceAdapter>
VTKM_CONT IdArrayHandle
......@@ -441,54 +444,53 @@ class BoundingIntervalHierarchy::PrepareForExecutionFunctor
public:
template <typename DeviceAdapter>
VTKM_CONT void operator()(DeviceAdapter,
const vtkm::cont::BoundingIntervalHierarchy* bih,
const vtkm::exec::CellLocator** bihExec) const
const vtkm::cont::BoundingIntervalHierarchy& bih,
HandleType& bihExec) const
{
using LocatorHandle = vtkm::cont::VirtualObjectHandle<vtkm::exec::CellLocator>;
vtkm::cont::DynamicCellSet cellSet = bih->GetCellSet();
vtkm::cont::DynamicCellSet cellSet = bih.GetCellSet();
if (cellSet.IsType<vtkm::cont::CellSetExplicit<>>())
{
using CellSetType = vtkm::cont::CellSetExplicit<>;
using ExecutionType = vtkm::exec::BoundingIntervalHierarchyExec<DeviceAdapter, CellSetType>;
ExecutionType* execObject = new ExecutionType(bih->Nodes,
bih->ProcessedCellIds,
bih->GetCellSet().Cast<CellSetType>(),
bih->GetCoordinates().GetData(),
ExecutionType* execObject = new ExecutionType(bih.Nodes,
bih.ProcessedCellIds,
bih.GetCellSet().Cast<CellSetType>(),
bih.GetCoordinates().GetData(),
DeviceAdapter());
*bihExec = (new LocatorHandle(execObject, false))->PrepareForExecution(DeviceAdapter());
bihExec.Reset(execObject);
}
else if (cellSet.IsType<vtkm::cont::CellSetStructured<2>>())
{
using CellSetType = vtkm::cont::CellSetStructured<2>;
using ExecutionType = vtkm::exec::BoundingIntervalHierarchyExec<DeviceAdapter, CellSetType>;
ExecutionType* execObject = new ExecutionType(bih->Nodes,
bih->ProcessedCellIds,
bih->GetCellSet().Cast<CellSetType>(),
bih->GetCoordinates().GetData(),
ExecutionType* execObject = new ExecutionType(bih.Nodes,
bih.ProcessedCellIds,
bih.GetCellSet().Cast<CellSetType>(),
bih.GetCoordinates().GetData(),
DeviceAdapter());
*bihExec = (new LocatorHandle(execObject, false))->PrepareForExecution(DeviceAdapter());
bihExec.Reset(execObject);
}
else if (cellSet.IsType<vtkm::cont::CellSetStructured<3>>())
{
using CellSetType = vtkm::cont::CellSetStructured<3>;
using ExecutionType = vtkm::exec::BoundingIntervalHierarchyExec<DeviceAdapter, CellSetType>;
ExecutionType* execObject = new ExecutionType(bih->Nodes,
bih->ProcessedCellIds,
bih->GetCellSet().Cast<CellSetType>(),
bih->GetCoordinates().GetData(),
ExecutionType* execObject = new ExecutionType(bih.Nodes,
bih.ProcessedCellIds,
bih.GetCellSet().Cast<CellSetType>(),
bih.GetCoordinates().GetData(),
DeviceAdapter());
*bihExec = (new LocatorHandle(execObject, false))->PrepareForExecution(DeviceAdapter());
bihExec.Reset(execObject);
}
else if (cellSet.IsType<vtkm::cont::CellSetSingleType<>>())
{
using CellSetType = vtkm::cont::CellSetSingleType<>;
using ExecutionType = vtkm::exec::BoundingIntervalHierarchyExec<DeviceAdapter, CellSetType>;
ExecutionType* execObject = new ExecutionType(bih->Nodes,
bih->ProcessedCellIds,
bih->GetCellSet().Cast<CellSetType>(),
bih->GetCoordinates().GetData(),
ExecutionType* execObject = new ExecutionType(bih.Nodes,
bih.ProcessedCellIds,
bih.GetCellSet().Cast<CellSetType>(),
bih.GetCoordinates().GetData(),
DeviceAdapter());
*bihExec = (new LocatorHandle(execObject, false))->PrepareForExecution(DeviceAdapter());
bihExec.Reset(execObject);
}
else
{
......
......@@ -32,8 +32,10 @@ namespace vtkm
namespace cont
{
class CellLocator : public vtkm::cont::ExecutionObjectBase
class VTKM_CONT_EXPORT CellLocator : public vtkm::cont::ExecutionObjectBase
{
private:
using HandleType = vtkm::cont::VirtualObjectHandle<vtkm::exec::CellLocator>;
public:
CellLocator()
......@@ -68,7 +70,7 @@ public:
VTKM_CONT const vtkm::exec::CellLocator* PrepareForExecution(DeviceAdapter) const
{
vtkm::cont::DeviceAdapterId deviceId = vtkm::cont::DeviceAdapterTraits<DeviceAdapter>::GetId();
return PrepareForExecutionImpl(deviceId);
return PrepareForExecutionImpl(deviceId).PrepareForExecution(DeviceAdapter());
}
protected:
......@@ -77,8 +79,7 @@ protected:
//This is going to need a TryExecute
VTKM_CONT virtual void Build() = 0;
VTKM_CONT virtual const vtkm::exec::CellLocator* PrepareForExecutionImpl(
const vtkm::Int8 device) const = 0;
VTKM_CONT virtual const HandleType PrepareForExecutionImpl(const vtkm::Int8 device) const = 0;
private:
vtkm::cont::DynamicCellSet CellSet;
......
......@@ -100,7 +100,7 @@ void TestBoundingIntervalHierarchy(vtkm::cont::DataSet dataSet, vtkm::IdComponen
std::cout << "Default stack size " << stackSizeBackup << "\n";
cudaDeviceSetLimit(cudaLimitStackSize, 1024 * 50);
cudaDeviceSetLimit(cudaLimitStackSize, 1024 * 200);
#endif
vtkm::worklet::DispatcherMapField<BoundingIntervalHierarchyTester>().Invoke(
......
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