Commit 4020f519 authored by Robert Maynard's avatar Robert Maynard

RuntimeDeviceTracker can't be copied and is only accessible via reference.

As the RuntimeDeviceTracker is a per thread construct we now make
it explicit that you can only get a reference to the per-thread
version and can't copy it.
parent e9482018
......@@ -8,7 +8,7 @@ vtkm::cont::DeviceAdapterId id1 = vtkm::cont::make_DeviceAdapterId("cuda");
vtkm::cont::DeviceAdapterId id2 = vtkm::cont::make_DeviceAdapterId("CUDA");
vtkm::cont::DeviceAdapterId id3 = vtkm::cont::make_DeviceAdapterId("Cuda");
auto tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker();
auto& tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker();
vtkm::cont::DeviceAdapterId id4 = tracker.GetDeviceAdapterId("cuda");
vtkm::cont::DeviceAdapterId id5 = tracker.GetDeviceAdapterId("CUDA");
vtkm::cont::DeviceAdapterId id6 = tracker.GetDeviceAdapterId("Cuda");
......@@ -4,3 +4,61 @@ The device tracking infrastructure in VTK-m has been redesigned to
remove multiple redundant codes paths and to simplify reasoning
about around what an instance of RuntimeDeviceTracker will modify.
`vtkm::cont::RuntimeDeviceTracker` tracks runtime information on
a per-user thread basis. This is done to allow multiple calling
threads to use different vtk-m backends such as seen in this
example:
```cpp
vtkm::cont::DeviceAdapterTagCuda cuda;
vtkm::cont::DeviceAdapterTagOpenMP openmp;
{ // thread 1
auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker->ForceDevice(cuda);
vtkm::worklet::Invoker invoke;
invoke(LightTask{}, input, output);
vtkm::cont::Algorithm::Sort(output);
invoke(HeavyTask{}, output);
}
{ // thread 2
auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker->ForceDevice(openmp);
vtkm::worklet::Invoker invoke;
invoke(LightTask{}, input, output);
vtkm::cont::Algorithm::Sort(output);
invoke(HeavyTask{}, output);
}
```
While this address the ability for threads to specify what
device they should run on. It doesn't make it easy to toggle
the status of a device in a programmatic way, for example
the following block forces execution to only occur on
`cuda` and doesn't restore previous active devices after
```cpp
{
auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker->ForceDevice(cuda);
vtkm::worklet::Invoker invoke;
invoke(LightTask{}, input, output);
}
//openmp/tbb/... still inactive
```
To resolve those issues we have `vtkm::cont::ScopedRuntimeDeviceTracker` which
has the same interface as `vtkm::cont::RuntimeDeviceTracker` but additionally
resets any per-user thread modifications when it goes out of scope. So by
switching over the previous example to use `ScopedRuntimeDeviceTracker` we
correctly restore the threads `RuntimeDeviceTracker` state when `tracker`
goes out of scope.
```cpp
{
vtkm::cont::ScopedRuntimeDeviceTracker tracker;
tracker.ForceDevice(cuda);
vtkm::worklet::Invoker invoke;
invoke(LightTask{}, input, output);
}
//openmp/tbb/... are now again active
```
......@@ -126,7 +126,7 @@ VTKM_CONT MultiDeviceGradient::MultiDeviceGradient()
, Workers()
{
//Step 1. Determine the number of workers we want
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
const bool runOnCuda = tracker.CanRunOn(vtkm::cont::DeviceAdapterTagCuda{});
const bool runOnOpenMP = tracker.CanRunOn(vtkm::cont::DeviceAdapterTagOpenMP{});
const bool runOnTbb = tracker.CanRunOn(vtkm::cont::DeviceAdapterTagTBB{});
......
......@@ -33,10 +33,14 @@ struct RuntimeDeviceTrackerInternals
}
VTKM_CONT
RuntimeDeviceTracker::RuntimeDeviceTracker()
: Internals(new detail::RuntimeDeviceTrackerInternals())
RuntimeDeviceTracker::RuntimeDeviceTracker(detail::RuntimeDeviceTrackerInternals* details,
bool reset)
: Internals(details)
{
this->Reset();
if (reset)
{
this->Reset();
}
}
VTKM_CONT
......@@ -124,7 +128,7 @@ void RuntimeDeviceTracker::ForceDevice(DeviceAdapterId deviceId)
VTKM_CONT
ScopedRuntimeDeviceTracker::ScopedRuntimeDeviceTracker()
: RuntimeDeviceTracker(GetRuntimeDeviceTracker())
: RuntimeDeviceTracker(GetRuntimeDeviceTracker().Internals, false)
, SavedState(new detail::RuntimeDeviceTrackerInternals())
{
std::copy_n(
......@@ -134,7 +138,7 @@ ScopedRuntimeDeviceTracker::ScopedRuntimeDeviceTracker()
VTKM_CONT
ScopedRuntimeDeviceTracker::ScopedRuntimeDeviceTracker(
const vtkm::cont::RuntimeDeviceTracker& tracker)
: RuntimeDeviceTracker(tracker)
: RuntimeDeviceTracker(tracker.Internals, false)
, SavedState(new detail::RuntimeDeviceTrackerInternals())
{
std::copy_n(
......@@ -154,6 +158,8 @@ vtkm::cont::RuntimeDeviceTracker& GetRuntimeDeviceTracker()
#if defined(VTKM_CLANG) && defined(__apple_build_version__) && (__apple_build_version__ < 8000000)
static std::mutex mtx;
static std::map<std::thread::id, vtkm::cont::RuntimeDeviceTracker*> globalTrackers;
static std::map<std::thread::id, vtkm::cont::detail::RuntimeDeviceTrackerInternals*>
globalTrackerInternals;
std::thread::id this_id = std::this_thread::get_id();
std::unique_lock<std::mutex> lock(mtx);
......@@ -164,12 +170,15 @@ vtkm::cont::RuntimeDeviceTracker& GetRuntimeDeviceTracker()
}
else
{
vtkm::cont::RuntimeDeviceTracker* tracker = new vtkm::cont::RuntimeDeviceTracker();
auto* details = new vtkm::cont::detail::RuntimeDeviceTrackerInternals();
vtkm::cont::RuntimeDeviceTracker* tracker = new vtkm::cont::RuntimeDeviceTracker(details, true);
globalTrackers[this_id] = tracker;
globalTrackerInternals[this_id] = details;
return *tracker;
}
#else
static thread_local vtkm::cont::RuntimeDeviceTracker runtimeDeviceTracker;
static thread_local vtkm::cont::detail::RuntimeDeviceTrackerInternals details;
static thread_local vtkm::cont::RuntimeDeviceTracker runtimeDeviceTracker(&details, true);
return runtimeDeviceTracker;
#endif
}
......
......@@ -115,10 +115,16 @@ public:
private:
friend struct ScopedRuntimeDeviceTracker;
std::shared_ptr<detail::RuntimeDeviceTrackerInternals> Internals;
detail::RuntimeDeviceTrackerInternals* Internals;
VTKM_CONT
RuntimeDeviceTracker();
RuntimeDeviceTracker(detail::RuntimeDeviceTrackerInternals* details, bool reset);
VTKM_CONT
RuntimeDeviceTracker(const RuntimeDeviceTracker&) = delete;
VTKM_CONT
RuntimeDeviceTracker& operator=(const RuntimeDeviceTracker&) = delete;
VTKM_CONT
void CheckDevice(vtkm::cont::DeviceAdapterId deviceId) const;
......@@ -150,8 +156,6 @@ struct VTKM_CONT_EXPORT ScopedRuntimeDeviceTracker : public vtkm::cont::RuntimeD
/// Destructor is not thread safe
VTKM_CONT ~ScopedRuntimeDeviceTracker();
ScopedRuntimeDeviceTracker(const ScopedRuntimeDeviceTracker&) = delete;
private:
std::unique_ptr<detail::RuntimeDeviceTrackerInternals> SavedState;
};
......@@ -164,7 +168,6 @@ private:
/// to check over and over again, VTK-m uses per thread runtime device tracker
/// so that these choices are marked and shared.
///
/// Xcode's clang only supports thread_local from version 8
VTKM_CONT_EXPORT
VTKM_CONT
vtkm::cont::RuntimeDeviceTracker& GetRuntimeDeviceTracker();
......
......@@ -22,7 +22,7 @@ namespace detail
{
VTKM_CONT_EXPORT void HandleTryExecuteException(vtkm::cont::DeviceAdapterId deviceId,
vtkm::cont::RuntimeDeviceTracker tracker,
vtkm::cont::RuntimeDeviceTracker& tracker,
const std::string& functorName)
{
try
......
......@@ -25,7 +25,7 @@ namespace detail
{
VTKM_CONT_EXPORT void HandleTryExecuteException(vtkm::cont::DeviceAdapterId,
vtkm::cont::RuntimeDeviceTracker,
vtkm::cont::RuntimeDeviceTracker&,
const std::string& functorName);
template <typename DeviceTag, typename Functor, typename... Args>
......
......@@ -13,7 +13,7 @@
int UnitTestCudaArrayHandle(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagCuda{});
return vtkm::cont::testing::TestingArrayHandles<vtkm::cont::DeviceAdapterTagCuda>::Run(argc,
argv);
......
......@@ -15,7 +15,7 @@
int UnitTestCudaArrayHandleFancy(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagCuda{});
int result = vtkm::cont::testing::TestingFancyArrayHandles<vtkm::cont::DeviceAdapterTagCuda>::Run(
argc, argv);
......
......@@ -13,7 +13,7 @@
int UnitTestCudaArrayHandleVirtualCoordinates(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagCuda{});
return vtkm::cont::testing::TestingArrayHandleVirtualCoordinates<
vtkm::cont::DeviceAdapterTagCuda>::Run(argc, argv);
......
......@@ -12,7 +12,7 @@
int UnitTestCudaBitField(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagCuda{});
return vtkm::cont::testing::TestingBitField<vtkm::cont::DeviceAdapterTagCuda>::Run(argc, argv);
}
......@@ -12,7 +12,7 @@
int UnitTestCudaCellLocatorRectilinearGrid(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagCuda{});
return vtkm::cont::testing::Testing::Run(
TestingCellLocatorRectilinearGrid<vtkm::cont::DeviceAdapterTagCuda>(), argc, argv);
......
......@@ -12,7 +12,7 @@
int UnitTestCudaCellLocatorUniformBins(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagCuda{});
return vtkm::cont::testing::Testing::Run(
TestingCellLocatorUniformBins<vtkm::cont::DeviceAdapterTagCuda>, argc, argv);
......
......@@ -12,7 +12,7 @@
int UnitTestCudaCellLocatorUniformGrid(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagCuda{});
return vtkm::cont::testing::Testing::Run(
TestingCellLocatorUniformGrid<vtkm::cont::DeviceAdapterTagCuda>(), argc, argv);
......
......@@ -14,7 +14,7 @@
int UnitTestCudaColorTable(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagCuda{});
return vtkm::cont::testing::TestingColorTable<vtkm::cont::DeviceAdapterTagCuda>::Run(argc, argv);
}
......@@ -15,7 +15,7 @@
int UnitTestCudaComputeRange(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagCuda{});
int result =
vtkm::cont::testing::TestingComputeRange<vtkm::cont::DeviceAdapterTagCuda>::Run(argc, argv);
......
......@@ -14,7 +14,7 @@
int UnitTestCudaDataSetExplicit(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagCuda{});
int result =
vtkm::cont::testing::TestingDataSetExplicit<vtkm::cont::DeviceAdapterTagCuda>::Run(argc, argv);
......
......@@ -15,7 +15,7 @@
int UnitTestCudaDataSetSingleType(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagCuda{});
int result = vtkm::cont::testing::TestingDataSetSingleType<vtkm::cont::DeviceAdapterTagCuda>::Run(
argc, argv);
......
......@@ -15,7 +15,7 @@
int UnitTestCudaDeviceAdapter(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagCuda{});
int result =
vtkm::cont::testing::TestingDeviceAdapter<vtkm::cont::DeviceAdapterTagCuda>::Run(argc, argv);
......
......@@ -14,7 +14,7 @@
int UnitTestCudaGeometry(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagCuda{});
return vtkm::cont::testing::Testing::Run(
UnitTestGeometryNamespace::RunGeometryTests<vtkm::cont::DeviceAdapterTagCuda>, argc, argv);
......
......@@ -23,7 +23,7 @@ void TestImplicitFunctions()
int UnitTestCudaImplicitFunction(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagCuda{});
return vtkm::cont::testing::Testing::Run(TestImplicitFunctions, argc, argv);
}
......@@ -166,7 +166,7 @@ void RunEdgeCases()
int UnitTestCudaMath(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagCuda{});
int tests_valid = vtkm::cont::testing::Testing::Run(
UnitTestMathNamespace::RunMathTests<vtkm::cont::DeviceAdapterTagCuda>, argc, argv);
......
......@@ -12,7 +12,7 @@
int UnitTestCudaPointLocatorUniformGrid(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagCuda{});
return vtkm::cont::testing::Testing::Run(
TestingPointLocatorUniformGrid<vtkm::cont::DeviceAdapterTagCuda>(), argc, argv);
......
......@@ -267,7 +267,7 @@ void Launch()
int UnitTestCudaShareUserProvidedManagedMemory(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagCuda{});
int ret = vtkm::cont::testing::Testing::Run(Launch, argc, argv);
return vtkm::cont::cuda::internal::Testing::CheckCudaBeforeExit(ret);
......
......@@ -15,7 +15,7 @@ namespace
void TestVirtualObjectHandle()
{
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagCuda{});
using DeviceAdapterList = vtkm::ListTagBase<vtkm::cont::DeviceAdapterTagCuda>;
......
......@@ -35,7 +35,7 @@ struct ExecuteIfValidDeviceTag
typename EnableIfValid<DeviceAdapter>::type operator()(
DeviceAdapter device,
Functor&& f,
const vtkm::cont::RuntimeDeviceTracker tracker,
const vtkm::cont::RuntimeDeviceTracker& tracker,
Args&&... args) const
{
if (tracker.CanRunOn(device))
......@@ -56,7 +56,7 @@ struct ExecuteIfValidDeviceTag
template <typename DeviceList, typename Functor, typename... Args>
VTKM_CONT void ForEachValidDevice(DeviceList devices, Functor&& functor, Args&&... args)
{
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
vtkm::ListForEach(
ExecuteIfValidDeviceTag{}, devices, functor, tracker, std::forward<Args>(args)...);
}
......
......@@ -12,7 +12,7 @@
int UnitTestOpenMPArrayHandle(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagOpenMP{});
return vtkm::cont::testing::TestingArrayHandles<vtkm::cont::DeviceAdapterTagOpenMP>::Run(argc,
argv);
......
......@@ -12,7 +12,7 @@
int UnitTestOpenMPArrayHandleFancy(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagOpenMP{});
return vtkm::cont::testing::TestingFancyArrayHandles<vtkm::cont::DeviceAdapterTagOpenMP>::Run(
argc, argv);
......
......@@ -12,7 +12,7 @@
int UnitTestOpenMPArrayHandleVirtualCoordinates(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagOpenMP{});
return vtkm::cont::testing::TestingArrayHandleVirtualCoordinates<
vtkm::cont::DeviceAdapterTagOpenMP>::Run(argc, argv);
......
......@@ -12,7 +12,7 @@
int UnitTestOpenMPBitField(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagOpenMP{});
return vtkm::cont::testing::TestingBitField<vtkm::cont::DeviceAdapterTagOpenMP>::Run(argc, argv);
}
......@@ -12,7 +12,7 @@
int UnitTestOpenMPCellLocatorRectilinearGrid(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagSerial{});
return vtkm::cont::testing::Testing::Run(
TestingCellLocatorRectilinearGrid<vtkm::cont::DeviceAdapterTagSerial>(), argc, argv);
......
......@@ -12,7 +12,7 @@
int UnitTestOpenMPCellLocatorUniformBins(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagOpenMP{});
return vtkm::cont::testing::Testing::Run(
TestingCellLocatorUniformBins<vtkm::cont::DeviceAdapterTagOpenMP>, argc, argv);
......
......@@ -12,7 +12,7 @@
int UnitTestOpenMPCellLocatorUniformGrid(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagSerial{});
return vtkm::cont::testing::Testing::Run(
TestingCellLocatorUniformGrid<vtkm::cont::DeviceAdapterTagSerial>(), argc, argv);
......
......@@ -12,7 +12,7 @@
int UnitTestOpenMPColorTable(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagOpenMP{});
return vtkm::cont::testing::TestingColorTable<vtkm::cont::DeviceAdapterTagOpenMP>::Run(argc,
argv);
......
......@@ -12,7 +12,7 @@
int UnitTestOpenMPComputeRange(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagOpenMP{});
return vtkm::cont::testing::TestingComputeRange<vtkm::cont::DeviceAdapterTagOpenMP>::Run(argc,
argv);
......
......@@ -12,7 +12,7 @@
int UnitTestOpenMPDataSetExplicit(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagOpenMP{});
return vtkm::cont::testing::TestingDataSetExplicit<vtkm::cont::DeviceAdapterTagOpenMP>::Run(argc,
argv);
......
......@@ -12,7 +12,7 @@
int UnitTestOpenMPDataSetSingleType(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagOpenMP{});
return vtkm::cont::testing::TestingDataSetSingleType<vtkm::cont::DeviceAdapterTagOpenMP>::Run(
argc, argv);
......
......@@ -13,7 +13,7 @@
int UnitTestOpenMPDeviceAdapter(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagOpenMP{});
return vtkm::cont::testing::TestingDeviceAdapter<vtkm::cont::DeviceAdapterTagOpenMP>::Run(argc,
argv);
......
......@@ -15,7 +15,7 @@ namespace
void TestImplicitFunctions()
{
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagOpenMP{});
vtkm::cont::testing::TestingImplicitFunction testing;
......
......@@ -12,7 +12,7 @@
int UnitTestOpenMPPointLocatorUniformGrid(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagOpenMP{});
return vtkm::cont::testing::Testing::Run(
TestingPointLocatorUniformGrid<vtkm::cont::DeviceAdapterTagOpenMP>(), argc, argv);
......
......@@ -20,7 +20,7 @@ void TestVirtualObjectHandle()
using DeviceAdapterList2 =
vtkm::ListTagBase<vtkm::cont::DeviceAdapterTagSerial, vtkm::cont::DeviceAdapterTagOpenMP>;
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagOpenMP{});
vtkm::cont::testing::TestingVirtualObjectHandle<DeviceAdapterList>::Run();
......
......@@ -13,7 +13,7 @@
int UnitTestSerialArrayHandle(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagSerial{});
return vtkm::cont::testing::TestingArrayHandles<vtkm::cont::DeviceAdapterTagSerial>::Run(argc,
argv);
......
......@@ -13,7 +13,7 @@
int UnitTestSerialArrayHandleFancy(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagSerial{});
return vtkm::cont::testing::TestingFancyArrayHandles<vtkm::cont::DeviceAdapterTagSerial>::Run(
argc, argv);
......
......@@ -14,7 +14,7 @@
int UnitTestSerialArrayHandleVirtualCoordinates(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagSerial{});
return vtkm::cont::testing::TestingArrayHandleVirtualCoordinates<
vtkm::cont::DeviceAdapterTagSerial>::Run(argc, argv);
......
......@@ -12,7 +12,7 @@
int UnitTestSerialBitField(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagSerial{});
return vtkm::cont::testing::TestingBitField<vtkm::cont::DeviceAdapterTagSerial>::Run(argc, argv);
}
......@@ -12,7 +12,7 @@
int UnitTestSerialCellLocatorRectilinearGrid(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagSerial{});
return vtkm::cont::testing::Testing::Run(
TestingCellLocatorRectilinearGrid<vtkm::cont::DeviceAdapterTagSerial>(), argc, argv);
......
......@@ -13,7 +13,7 @@
int UnitTestSerialCellLocatorUniformBins(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagSerial{});
return vtkm::cont::testing::Testing::Run(
TestingCellLocatorUniformBins<vtkm::cont::DeviceAdapterTagSerial>, argc, argv);
......
......@@ -12,7 +12,7 @@
int UnitTestSerialCellLocatorUniformGrid(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagSerial{});
return vtkm::cont::testing::Testing::Run(
TestingCellLocatorUniformGrid<vtkm::cont::DeviceAdapterTagSerial>(), argc, argv);
......
......@@ -13,7 +13,7 @@
int UnitTestSerialDataSetExplicit(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagSerial{});
return vtkm::cont::testing::TestingDataSetExplicit<vtkm::cont::DeviceAdapterTagSerial>::Run(argc,
argv);
......
......@@ -13,7 +13,7 @@
int UnitTestSerialDataSetSingleType(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagSerial{});
return vtkm::cont::testing::TestingDataSetSingleType<vtkm::cont::DeviceAdapterTagSerial>::Run(
argc, argv);
......
......@@ -14,7 +14,7 @@
int UnitTestSerialDeviceAdapter(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagSerial{});
return vtkm::cont::testing::TestingDeviceAdapter<vtkm::cont::DeviceAdapterTagSerial>::Run(argc,
argv);
......
......@@ -14,7 +14,7 @@
int UnitTestSerialGeometry(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagSerial{});
return vtkm::cont::testing::Testing::Run(
UnitTestGeometryNamespace::RunGeometryTests<vtkm::cont::DeviceAdapterTagSerial>, argc, argv);
......
......@@ -23,7 +23,7 @@ void TestImplicitFunctions()
int UnitTestSerialImplicitFunction(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();