Commit afd04091 authored by Abhishek Yenpure's avatar Abhishek Yenpure Committed by Kitware Robot

Merge topic 'code_sprint_locator_fixes'

9b56d41f Fixing Rectilinear Grid Cell Locator
10e9d47d Removing std::out print statement from test
34c7b57d Merge branch 'code_sprint_locator_fixes' of gitlab.kitware.com:ayenpure/vtk-m into code_sprint_locator_fixes
62ee1a2c Updates to the Cell Locators
7eb0de5b Merge branch 'code_sprint_locator_fixes' of gitlab.kitware.com:ayenpure/vtk-m into code_sprint_locator_fixes
866b0798 Resolving type warnings
c062f2e2 Merge branch 'master' of https://gitlab.kitware.com/vtk/vtk-m into code_sprint_locator_fixes
797c8389 Adding default constructor and removing wrong comment
...
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland's avatarKenneth Moreland <kmorel@sandia.gov>
Merge-request: !1395
parents 9bfe670e 9b56d41f
......@@ -55,7 +55,9 @@ set(headers
BoundsGlobalCompute.h
CellLocator.h
CellLocatorHelper.h
CellLocatorRectilinearGrid.h
CellLocatorTwoLevelUniformGrid.h
CellLocatorUniformGrid.h
CellSet.h
CellSetExplicit.h
CellSetListTag.h
......
......@@ -35,8 +35,6 @@ namespace cont
class CellLocator : public vtkm::cont::ExecutionObjectBase
{
private:
using HandleType = vtkm::cont::VirtualObjectHandle<vtkm::exec::CellLocator>;
public:
CellLocator()
......@@ -73,6 +71,8 @@ public:
return PrepareForExecutionImpl(device).PrepareForExecution(device);
}
using HandleType = vtkm::cont::VirtualObjectHandle<vtkm::exec::CellLocator>;
protected:
void SetDirty() { Dirty = true; }
......
//============================================================================
// 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 2018 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
// Copyright 2018 UT-Battelle, LLC.
// Copyright 2018 Los Alamos National Security.
//
// Under the terms of Contract DE-NA0003525 with NTESS,
// 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 vtkm_cont_celllocatorrectilineargrid_h
#define vtkm_cont_celllocatorrectilineargrid_h
#include <vtkm/cont/CellLocator.h>
#include <vtkm/cont/CellSetStructured.h>
#include <vtkm/cont/DeviceAdapterAlgorithm.h>
#include <vtkm/cont/ErrorBadDevice.h>
#include <vtkm/exec/CellLocatorRectilinearGrid.h>
namespace vtkm
{
namespace cont
{
class CellLocatorRectilinearGrid : public vtkm::cont::CellLocator
{
public:
using StructuredType = vtkm::cont::CellSetStructured<3>;
using AxisHandle = vtkm::cont::ArrayHandle<vtkm::FloatDefault>;
using RectilinearType =
vtkm::cont::ArrayHandleCartesianProduct<AxisHandle, AxisHandle, AxisHandle>;
VTKM_CONT
CellLocatorRectilinearGrid() = default;
VTKM_CONT
void Build() override
{
vtkm::cont::CoordinateSystem coords = this->GetCoordinates();
vtkm::cont::DynamicCellSet cellSet = this->GetCellSet();
if (!coords.GetData().IsType<RectilinearType>())
throw vtkm::cont::ErrorInternal("Coordinates are not rectilinear.");
if (!cellSet.IsSameType(StructuredType()))
throw vtkm::cont::ErrorInternal("Cells are not 3D structured.");
vtkm::Vec<vtkm::Id, 3> celldims =
cellSet.Cast<StructuredType>().GetSchedulingRange(vtkm::TopologyElementTagCell());
this->PlaneSize = celldims[0] * celldims[1];
this->RowSize = celldims[0];
}
struct PrepareForExecutionFunctor
{
template <typename DeviceAdapter>
VTKM_CONT bool operator()(DeviceAdapter,
const vtkm::cont::CellLocatorRectilinearGrid& contLocator,
HandleType& execLocator) const
{
using ExecutionType = vtkm::exec::CellLocatorRectilinearGrid<DeviceAdapter>;
ExecutionType* execObject =
new ExecutionType(contLocator.PlaneSize,
contLocator.RowSize,
contLocator.GetCellSet().template Cast<StructuredType>(),
contLocator.GetCoordinates().GetData().template Cast<RectilinearType>(),
DeviceAdapter());
execLocator.Reset(execObject);
return true;
}
};
VTKM_CONT
const HandleType PrepareForExecutionImpl(
const vtkm::cont::DeviceAdapterId deviceId) const override
{
const bool success = vtkm::cont::TryExecuteOnDevice(
deviceId, PrepareForExecutionFunctor(), *this, this->ExecHandle);
if (!success)
{
throwFailedRuntimeDeviceTransfer("CellLocatorRectilinearGrid", deviceId);
}
return this->ExecHandle;
}
private:
vtkm::Bounds Bounds;
vtkm::Id PlaneSize;
vtkm::Id RowSize;
mutable HandleType ExecHandle;
};
} //namespace cont
} //namespace vtkm
#endif //vtkm_cont_celllocatorrectilineargrid_h
//============================================================================
// 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 2019 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
// Copyright 2019 UT-Battelle, LLC.
// Copyright 2019 Los Alamos National Security.
//
// Under the terms of Contract DE-NA0003525 with NTESS,
// 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 vtkm_cont_celllocatoruniformgrid_h
#define vtkm_cont_celllocatoruniformgrid_h
#include <vtkm/cont/CellLocator.h>
#include <vtkm/cont/CellSetStructured.h>
#include <vtkm/cont/DeviceAdapterAlgorithm.h>
#include <vtkm/cont/ErrorBadDevice.h>
#include <vtkm/exec/CellLocatorUniformGrid.h>
namespace vtkm
{
namespace cont
{
class CellLocatorUniformGrid : public vtkm::cont::CellLocator
{
public:
VTKM_CONT
CellLocatorUniformGrid() = default;
VTKM_CONT
void Build() override
{
vtkm::cont::CoordinateSystem coords = this->GetCoordinates();
vtkm::cont::DynamicCellSet cellSet = this->GetCellSet();
if (!coords.GetData().IsType<UniformType>())
throw vtkm::cont::ErrorBadType("Coordinate system is not uniform type");
if (!cellSet.IsSameType(StructuredType()))
throw vtkm::cont::ErrorBadType("Cell set is not 3D structured type");
Bounds = coords.GetBounds();
vtkm::Vec<vtkm::Id, 3> celldims =
cellSet.Cast<StructuredType>().GetSchedulingRange(vtkm::TopologyElementTagCell());
RangeTransform[0] = static_cast<vtkm::FloatDefault>(celldims[0]) /
static_cast<vtkm::FloatDefault>(Bounds.X.Length());
RangeTransform[1] = static_cast<vtkm::FloatDefault>(celldims[1]) /
static_cast<vtkm::FloatDefault>(Bounds.Y.Length());
RangeTransform[2] = static_cast<vtkm::FloatDefault>(celldims[2]) /
static_cast<vtkm::FloatDefault>(Bounds.Z.Length());
PlaneSize = celldims[0] * celldims[1];
RowSize = celldims[0];
}
struct PrepareForExecutionFunctor
{
template <typename DeviceAdapter>
VTKM_CONT bool operator()(DeviceAdapter,
const vtkm::cont::CellLocatorUniformGrid& contLocator,
HandleType& execLocator) const
{
using ExecutionType = vtkm::exec::CellLocatorUniformGrid<DeviceAdapter>;
ExecutionType* execObject =
new ExecutionType(contLocator.Bounds,
contLocator.RangeTransform,
contLocator.PlaneSize,
contLocator.RowSize,
contLocator.GetCellSet().template Cast<StructuredType>(),
contLocator.GetCoordinates().GetData(),
DeviceAdapter());
execLocator.Reset(execObject);
return true;
}
};
VTKM_CONT
const HandleType PrepareForExecutionImpl(
const vtkm::cont::DeviceAdapterId deviceId) const override
{
const bool success = vtkm::cont::TryExecuteOnDevice(
deviceId, PrepareForExecutionFunctor(), *this, this->ExecHandle);
if (!success)
{
throwFailedRuntimeDeviceTransfer("CellLocatorUniformGrid", deviceId);
}
return this->ExecHandle;
}
private:
using UniformType = vtkm::cont::ArrayHandleUniformPointCoordinates;
using StructuredType = vtkm::cont::CellSetStructured<3>;
vtkm::Bounds Bounds;
vtkm::Vec<vtkm::FloatDefault, 3> RangeTransform;
vtkm::Id PlaneSize;
vtkm::Id RowSize;
mutable HandleType ExecHandle;
};
}
}
#endif //vtkm_cont_celllocatoruniformgrid_h
......@@ -38,11 +38,11 @@ public:
{
}
vtkm::cont::CoordinateSystem GetCoords() const { return coordinates; }
vtkm::cont::CoordinateSystem GetCoordinates() const { return Coords; }
void SetCoords(const vtkm::cont::CoordinateSystem& coords)
void SetCoordinates(const vtkm::cont::CoordinateSystem& coords)
{
coordinates = coords;
Coords = coords;
dirty = true;
}
......@@ -58,15 +58,15 @@ public:
template <typename DeviceAdapter>
VTKM_CONT const vtkm::exec::PointLocator* PrepareForExecution(DeviceAdapter device) const
{
return PrepareForExecutionImp(device).PrepareForExecution(device);
return PrepareForExecutionImpl(device).PrepareForExecution(device);
}
using HandleType = vtkm::cont::VirtualObjectHandle<vtkm::exec::PointLocator>;
VTKM_CONT virtual const HandleType PrepareForExecutionImp(
VTKM_CONT virtual const HandleType PrepareForExecutionImpl(
vtkm::cont::DeviceAdapterId deviceId) const = 0;
private:
vtkm::cont::CoordinateSystem coordinates;
vtkm::cont::CoordinateSystem Coords;
bool dirty;
};
......
......@@ -79,7 +79,7 @@ public:
void Build() override
{
// Save training data points.
vtkm::cont::ArrayCopy(this->GetCoords().GetData(), this->coords);
vtkm::cont::ArrayCopy(this->GetCoordinates().GetData(), this->coords);
// generate unique id for each input point
vtkm::cont::ArrayHandleCounting<vtkm::Id> pointCounting(0, 1, this->coords.GetNumberOfValues());
......@@ -125,7 +125,7 @@ public:
};
VTKM_CONT
const HandleType PrepareForExecutionImp(vtkm::cont::DeviceAdapterId deviceId) const override
const HandleType PrepareForExecutionImpl(vtkm::cont::DeviceAdapterId deviceId) const override
{
const bool success =
vtkm::cont::TryExecuteOnDevice(deviceId, PrepareForExecutionFunctor(), *this, ExecHandle);
......
......@@ -22,7 +22,9 @@ set(unit_tests
UnitTestCudaArrayHandle.cu
UnitTestCudaArrayHandleFancy.cu
UnitTestCudaArrayHandleVirtualCoordinates.cu
UnitTestCudaCellLocatorRectilinearGrid.cu
UnitTestCudaCellLocatorTwoLevelUniformGrid.cu
UnitTestCudaCellLocatorUniformGrid.cu
UnitTestCudaComputeRange.cu
UnitTestCudaColorTable.cu
UnitTestCudaDataSetExplicit.cu
......
//============================================================================
// 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 2019 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
// Copyright 2019 UT-Battelle, LLC.
// Copyright 2019 Los Alamos National Security.
//
// Under the terms of Contract DE-NA0003525 with NTESS,
// 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.
//============================================================================
// Make sure that the tested code is using the device adapter specified. This
// is important in the long run so we don't, for example, use the CUDA device
// for a part of an operation where the TBB device was specified.
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_ERROR
#include <vtkm/cont/testing/TestingCellLocatorRectilinearGrid.h>
int UnitTestCudaCellLocatorRectilinearGrid(int, char* [])
{
auto tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagCuda{});
return vtkm::cont::testing::Testing::Run(
TestingCellLocatorRectilinearGrid<vtkm::cont::DeviceAdapterTagCuda>());
}
//============================================================================
// 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 2019 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
// Copyright 2019 UT-Battelle, LLC.
// Copyright 2019 Los Alamos National Security.
//
// Under the terms of Contract DE-NA0003525 with NTESS,
// 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.
//============================================================================
// Make sure that the tested code is using the device adapter specified. This
// is important in the long run so we don't, for example, use the CUDA device
// for a part of an operation where the TBB device was specified.
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_ERROR
#include <vtkm/cont/testing/TestingCellLocatorUniformGrid.h>
int UnitTestCudaCellLocatorUniformGrid(int, char* [])
{
auto tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagCuda{});
return vtkm::cont::testing::Testing::Run(
TestingCellLocatorUniformGrid<vtkm::cont::DeviceAdapterTagCuda>());
}
......@@ -22,7 +22,9 @@ set(unit_tests
UnitTestOpenMPArrayHandle.cxx
UnitTestOpenMPArrayHandleFancy.cxx
UnitTestOpenMPArrayHandleVirtualCoordinates.cxx
UnitTestOpenMPCellLocatorRectilinearGrid.cxx
UnitTestOpenMPCellLocatorTwoLevelUniformGrid.cxx
UnitTestOpenMPCellLocatorUniformGrid.cxx
UnitTestOpenMPColorTable.cxx
UnitTestOpenMPComputeRange.cxx
UnitTestOpenMPDataSetExplicit.cxx
......
//============================================================================
// 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 2019 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
// Copyright 2019 UT-Battelle, LLC.
// Copyright 2019 Los Alamos National Security.
//
// Under the terms of Contract DE-NA0003525 with NTESS,
// 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.
//============================================================================
// Make sure that the tested code is using the device adapter specified. This
// is important in the long run so we don't, for example, use the CUDA device
// for a part of an operation where the TBB device was specified.
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_ERROR
#include <vtkm/cont/testing/TestingCellLocatorRectilinearGrid.h>
int UnitTestOpenMPCellLocatorRectilinearGrid(int, char* [])
{
auto tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagSerial{});
return vtkm::cont::testing::Testing::Run(
TestingCellLocatorRectilinearGrid<vtkm::cont::DeviceAdapterTagSerial>());
}
//============================================================================
// 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 2019 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
// Copyright 2019 UT-Battelle, LLC.
// Copyright 2019 Los Alamos National Security.
//
// Under the terms of Contract DE-NA0003525 with NTESS,
// 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.
//============================================================================
// Make sure that the tested code is using the device adapter specified. This
// is important in the long run so we don't, for example, use the CUDA device
// for a part of an operation where the TBB device was specified.
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_ERROR
#include <vtkm/cont/testing/TestingCellLocatorUniformGrid.h>
int UnitTestOpenMPCellLocatorUniformGrid(int, char* [])
{
auto tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagSerial{});
return vtkm::cont::testing::Testing::Run(
TestingCellLocatorUniformGrid<vtkm::cont::DeviceAdapterTagSerial>());
}
......@@ -22,7 +22,9 @@ set(unit_tests
UnitTestSerialArrayHandle.cxx
UnitTestSerialArrayHandleFancy.cxx
UnitTestSerialArrayHandleVirtualCoordinates.cxx
UnitTestSerialCellLocatorRectilinearGrid.cxx
UnitTestSerialCellLocatorTwoLevelUniformGrid.cxx
UnitTestSerialCellLocatorUniformGrid.cxx
UnitTestSerialComputeRange.cxx
UnitTestSerialColorTable.cxx
UnitTestSerialDataSetExplicit.cxx
......
//============================================================================
// 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 2019 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
// Copyright 2019 UT-Battelle, LLC.
// Copyright 2019 Los Alamos National Security.
//
// Under the terms of Contract DE-NA0003525 with NTESS,
// 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.
//============================================================================
// Make sure that the tested code is using the device adapter specified. This
// is important in the long run so we don't, for example, use the CUDA device
// for a part of an operation where the TBB device was specified.
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_ERROR
#include <vtkm/cont/testing/TestingCellLocatorRectilinearGrid.h>
int UnitTestSerialCellLocatorRectilinearGrid(int, char* [])
{
auto tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagSerial{});
return vtkm::cont::testing::Testing::Run(
TestingCellLocatorRectilinearGrid<vtkm::cont::DeviceAdapterTagSerial>());
}
//============================================================================
// 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 2019 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
// Copyright 2019 UT-Battelle, LLC.
// Copyright 2019 Los Alamos National Security.
//
// Under the terms of Contract DE-NA0003525 with NTESS,
// 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.
//============================================================================
// Make sure that the tested code is using the device adapter specified. This
// is important in the long run so we don't, for example, use the CUDA device
// for a part of an operation where the TBB device was specified.
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_ERROR
#include <vtkm/cont/testing/TestingCellLocatorUniformGrid.h>
int UnitTestSerialCellLocatorUniformGrid(int, char* [])
{
auto tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagSerial{});
return vtkm::cont::testing::Testing::Run(
TestingCellLocatorUniformGrid<vtkm::cont::DeviceAdapterTagSerial>());
}
......@@ -22,7 +22,9 @@ set(unit_tests
UnitTestTBBArrayHandle.cxx
UnitTestTBBArrayHandleFancy.cxx
UnitTestTBBArrayHandleVirtualCoordinates.cxx
UnitTestTBBCellLocatorRectilinearGrid.cxx
UnitTestTBBCellLocatorTwoLevelUniformGrid.cxx
UnitTestTBBCellLocatorUniformGrid.cxx
UnitTestTBBColorTable.cxx
UnitTestTBBComputeRange.cxx
UnitTestTBBDataSetExplicit.cxx
......
//============================================================================
// 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 2019 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
// Copyright 2019 UT-Battelle, LLC.
// Copyright 2019 Los Alamos National Security.
//
// Under the terms of Contract DE-NA0003525 with NTESS,
// 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.
//============================================================================
// Make sure that the tested code is using the device adapter specified. This
// is important in the long run so we don't, for example, use the CUDA device
// for a part of an operation where the TBB device was specified.
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_ERROR
#include <vtkm/cont/testing/TestingCellLocatorRectilinearGrid.h>
int UnitTestTBBCellLocatorRectilinearGrid(int, char* [])
{
auto tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagTBB{});
return vtkm::cont::testing::Testing::Run(
TestingCellLocatorRectilinearGrid<vtkm::cont::DeviceAdapterTagTBB>());
}
//============================================================================
// 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 2019 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
// Copyright 2019 UT-Battelle, LLC.
// Copyright 2019 Los Alamos National Security.
//
// Under the terms of Contract DE-NA0003525 with NTESS,
// 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.
//============================================================================
// Make sure that the tested code is using the device adapter specified. This
// is important in the long run so we don't, for example, use the CUDA device
// for a part of an operation where the TBB device was specified.
#define VTKM_DEVICE_ADAPTER VTKM_DEVICE_ADAPTER_ERROR
#include <vtkm/cont/testing/TestingCellLocatorUniformGrid.h>