Commit 095e2883 authored by Robert Maynard's avatar Robert Maynard Committed by Kitware Robot

Merge topic 'better_scoped_rt_dt'

bcaf7d9b ScopedRuntimeDeviceTracker have better controls of setting devices.
4212d0c0 RuntimeDeviceInformation now says the AnyTag exists.
fa03dc66 ScopedRuntimeDeviceTracker requires a device to execute on when constructed.
4020f519 RuntimeDeviceTracker can't be copied and is only accessible via reference.
e9482018 ScopedRuntimeDeviceTracker has the same API as RuntimeDeviceTracker
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland's avatarKenneth Moreland <kmorel@sandia.gov>
Merge-request: !1676
parents 425fcd89 bcaf7d9b
...@@ -8,7 +8,7 @@ vtkm::cont::DeviceAdapterId id1 = vtkm::cont::make_DeviceAdapterId("cuda"); ...@@ -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 id2 = vtkm::cont::make_DeviceAdapterId("CUDA");
vtkm::cont::DeviceAdapterId id3 = 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 id4 = tracker.GetDeviceAdapterId("cuda");
vtkm::cont::DeviceAdapterId id5 = tracker.GetDeviceAdapterId("CUDA"); vtkm::cont::DeviceAdapterId id5 = tracker.GetDeviceAdapterId("CUDA");
vtkm::cont::DeviceAdapterId id6 = tracker.GetDeviceAdapterId("Cuda"); vtkm::cont::DeviceAdapterId id6 = tracker.GetDeviceAdapterId("Cuda");
...@@ -4,3 +4,87 @@ The device tracking infrastructure in VTK-m has been redesigned to ...@@ -4,3 +4,87 @@ The device tracking infrastructure in VTK-m has been redesigned to
remove multiple redundant codes paths and to simplify reasoning remove multiple redundant codes paths and to simplify reasoning
about around what an instance of RuntimeDeviceTracker will modify. 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
{
vtkm::cont::DeviceAdapterTagCuda cuda;
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::DeviceAdapterTagCuda cuda;
vtkm::cont::ScopedRuntimeDeviceTracker tracker(cuda);
vtkm::worklet::Invoker invoke;
invoke(LightTask{}, input, output);
}
//openmp/tbb/... are now again active
```
The `vtkm::cont::ScopedRuntimeDeviceTracker` is not limited to forcing
execution to occur on a single device. When constructed it can either force
execution to a device, disable a device or enable a device. These options
also work with the `DeviceAdapterTagAny`.
```cpp
{
//enable all devices
vtkm::cont::DeviceAdapterTagAny any;
vtkm::cont::ScopedRuntimeDeviceTracker tracker(any,
vtkm::cont::RuntimeDeviceTrackerMode::Enable);
...
}
{
//disable only cuda
vtkm::cont::DeviceAdapterTagCuda cuda;
vtkm::cont::ScopedRuntimeDeviceTracker tracker(cuda,
vtkm::cont::RuntimeDeviceTrackerMode::Disable);
...
}
```
...@@ -126,7 +126,7 @@ VTKM_CONT MultiDeviceGradient::MultiDeviceGradient() ...@@ -126,7 +126,7 @@ VTKM_CONT MultiDeviceGradient::MultiDeviceGradient()
, Workers() , Workers()
{ {
//Step 1. Determine the number of workers we want //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 runOnCuda = tracker.CanRunOn(vtkm::cont::DeviceAdapterTagCuda{});
const bool runOnOpenMP = tracker.CanRunOn(vtkm::cont::DeviceAdapterTagOpenMP{}); const bool runOnOpenMP = tracker.CanRunOn(vtkm::cont::DeviceAdapterTagOpenMP{});
const bool runOnTbb = tracker.CanRunOn(vtkm::cont::DeviceAdapterTagTBB{}); const bool runOnTbb = tracker.CanRunOn(vtkm::cont::DeviceAdapterTagTBB{});
......
...@@ -312,8 +312,7 @@ public: ...@@ -312,8 +312,7 @@ public:
PortalConstType GetPortalConst() const PortalConstType GetPortalConst() const
{ {
VTKM_ASSERT(this->Valid); VTKM_ASSERT(this->Valid);
vtkm::cont::ScopedRuntimeDeviceTracker trackerScope; vtkm::cont::ScopedRuntimeDeviceTracker trackerScope(vtkm::cont::DeviceAdapterTagSerial{});
vtkm::cont::GetRuntimeDeviceTracker().ForceDevice(vtkm::cont::DeviceAdapterTagSerial());
return PortalConstType(this->Array.GetPortalConstControl(), this->Functor.PrepareForControl()); return PortalConstType(this->Array.GetPortalConstControl(), this->Functor.PrepareForControl());
} }
...@@ -404,8 +403,7 @@ public: ...@@ -404,8 +403,7 @@ public:
PortalType GetPortal() PortalType GetPortal()
{ {
VTKM_ASSERT(this->Valid); VTKM_ASSERT(this->Valid);
vtkm::cont::ScopedRuntimeDeviceTracker trackerScope; vtkm::cont::ScopedRuntimeDeviceTracker trackerScope(vtkm::cont::DeviceAdapterTagSerial{});
vtkm::cont::GetRuntimeDeviceTracker().ForceDevice(vtkm::cont::DeviceAdapterTagSerial());
return PortalType(this->Array.GetPortalControl(), return PortalType(this->Array.GetPortalControl(),
this->Functor.PrepareForControl(), this->Functor.PrepareForControl(),
this->InverseFunctor.PrepareForControl()); this->InverseFunctor.PrepareForControl());
...@@ -415,8 +413,7 @@ public: ...@@ -415,8 +413,7 @@ public:
PortalConstType GetPortalConst() const PortalConstType GetPortalConst() const
{ {
VTKM_ASSERT(this->Valid); VTKM_ASSERT(this->Valid);
vtkm::cont::ScopedRuntimeDeviceTracker trackerScope; vtkm::cont::ScopedRuntimeDeviceTracker trackerScope(vtkm::cont::DeviceAdapterTagSerial{});
vtkm::cont::GetRuntimeDeviceTracker().ForceDevice(vtkm::cont::DeviceAdapterTagSerial());
return PortalConstType(this->Array.GetPortalConstControl(), return PortalConstType(this->Array.GetPortalConstControl(),
this->Functor.PrepareForControl(), this->Functor.PrepareForControl(),
this->InverseFunctor.PrepareForControl()); this->InverseFunctor.PrepareForControl());
......
...@@ -169,6 +169,11 @@ DeviceAdapterId RuntimeDeviceInformation::GetId(DeviceAdapterNameType name) cons ...@@ -169,6 +169,11 @@ DeviceAdapterId RuntimeDeviceInformation::GetId(DeviceAdapterNameType name) cons
VTKM_CONT VTKM_CONT
bool RuntimeDeviceInformation::Exists(DeviceAdapterId id) const bool RuntimeDeviceInformation::Exists(DeviceAdapterId id) const
{ {
if (id == vtkm::cont::DeviceAdapterTagAny{})
{
return true;
}
RuntimeDeviceInformationFunctor functor; RuntimeDeviceInformationFunctor functor;
vtkm::ListForEach(functor, VTKM_DEFAULT_DEVICE_ADAPTER_LIST_TAG(), id); vtkm::ListForEach(functor, VTKM_DEFAULT_DEVICE_ADAPTER_LIST_TAG(), id);
return functor.Exists; return functor.Exists;
......
...@@ -33,10 +33,14 @@ struct RuntimeDeviceTrackerInternals ...@@ -33,10 +33,14 @@ struct RuntimeDeviceTrackerInternals
} }
VTKM_CONT VTKM_CONT
RuntimeDeviceTracker::RuntimeDeviceTracker() RuntimeDeviceTracker::RuntimeDeviceTracker(detail::RuntimeDeviceTrackerInternals* details,
: Internals(std::make_shared<detail::RuntimeDeviceTrackerInternals>()) bool reset)
: Internals(details)
{ {
this->Reset(); if (reset)
{
this->Reset();
}
} }
VTKM_CONT VTKM_CONT
...@@ -57,10 +61,24 @@ void RuntimeDeviceTracker::CheckDevice(vtkm::cont::DeviceAdapterId deviceId) con ...@@ -57,10 +61,24 @@ void RuntimeDeviceTracker::CheckDevice(vtkm::cont::DeviceAdapterId deviceId) con
} }
VTKM_CONT VTKM_CONT
bool RuntimeDeviceTracker::CanRunOnImpl(vtkm::cont::DeviceAdapterId deviceId) const bool RuntimeDeviceTracker::CanRunOn(vtkm::cont::DeviceAdapterId deviceId) const
{ {
this->CheckDevice(deviceId); if (deviceId == vtkm::cont::DeviceAdapterTagAny{})
return this->Internals->RuntimeAllowed[deviceId.GetValue()]; { //If at least a single device is enabled, than any device is enabled
for (vtkm::Int8 i = 1; i < VTKM_MAX_DEVICE_ADAPTER_ID; ++i)
{
if (this->Internals->RuntimeAllowed[static_cast<std::size_t>(i)])
{
return true;
}
}
return false;
}
else
{
this->CheckDevice(deviceId);
return this->Internals->RuntimeAllowed[deviceId.GetValue()];
}
} }
VTKM_CONT VTKM_CONT
...@@ -73,6 +91,21 @@ void RuntimeDeviceTracker::SetDeviceState(vtkm::cont::DeviceAdapterId deviceId, ...@@ -73,6 +91,21 @@ void RuntimeDeviceTracker::SetDeviceState(vtkm::cont::DeviceAdapterId deviceId,
this->Internals->RuntimeAllowed[deviceId.GetValue()] = state; this->Internals->RuntimeAllowed[deviceId.GetValue()] = state;
} }
VTKM_CONT void RuntimeDeviceTracker::ResetDevice(vtkm::cont::DeviceAdapterId deviceId)
{
if (deviceId == vtkm::cont::DeviceAdapterTagAny{})
{
this->Reset();
}
else
{
vtkm::cont::RuntimeDeviceInformation runtimeDevice;
this->SetDeviceState(deviceId, runtimeDevice.Exists(deviceId));
}
}
VTKM_CONT VTKM_CONT
void RuntimeDeviceTracker::Reset() void RuntimeDeviceTracker::Reset()
{ {
...@@ -82,7 +115,7 @@ void RuntimeDeviceTracker::Reset() ...@@ -82,7 +115,7 @@ void RuntimeDeviceTracker::Reset()
// when we use logging we get better messages stating we are reseting // when we use logging we get better messages stating we are reseting
// the devices. // the devices.
vtkm::cont::RuntimeDeviceInformation runtimeDevice; vtkm::cont::RuntimeDeviceInformation runtimeDevice;
for (vtkm::Int8 i = 0; i < VTKM_MAX_DEVICE_ADAPTER_ID; ++i) for (vtkm::Int8 i = 1; i < VTKM_MAX_DEVICE_ADAPTER_ID; ++i)
{ {
vtkm::cont::DeviceAdapterId device = vtkm::cont::make_DeviceAdapterId(i); vtkm::cont::DeviceAdapterId device = vtkm::cont::make_DeviceAdapterId(i);
if (device.IsValueValid()) if (device.IsValueValid())
...@@ -95,53 +128,109 @@ void RuntimeDeviceTracker::Reset() ...@@ -95,53 +128,109 @@ void RuntimeDeviceTracker::Reset()
} }
} }
VTKM_CONT VTKM_CONT void RuntimeDeviceTracker::DisableDevice(vtkm::cont::DeviceAdapterId deviceId)
vtkm::cont::RuntimeDeviceTracker RuntimeDeviceTracker::DeepCopy() const
{ {
return vtkm::cont::RuntimeDeviceTracker(this->Internals); if (deviceId == vtkm::cont::DeviceAdapterTagAny{})
{
std::fill_n(this->Internals->RuntimeAllowed, VTKM_MAX_DEVICE_ADAPTER_ID, false);
}
else
{
this->SetDeviceState(deviceId, false);
}
} }
VTKM_CONT VTKM_CONT
void RuntimeDeviceTracker::DeepCopy(const vtkm::cont::RuntimeDeviceTracker& src) void RuntimeDeviceTracker::ForceDevice(DeviceAdapterId deviceId)
{ {
std::copy_n( if (deviceId == vtkm::cont::DeviceAdapterTagAny{})
src.Internals->RuntimeAllowed, VTKM_MAX_DEVICE_ADAPTER_ID, this->Internals->RuntimeAllowed); {
this->Reset();
}
else
{
this->CheckDevice(deviceId);
vtkm::cont::RuntimeDeviceInformation runtimeDevice;
const bool runtimeExists = runtimeDevice.Exists(deviceId);
if (!runtimeExists)
{
std::stringstream message;
message << "Cannot force to device '" << deviceId.GetName()
<< "' because that device is not available on this system";
throw vtkm::cont::ErrorBadValue(message.str());
}
VTKM_LOG_S(vtkm::cont::LogLevel::Info,
"Forcing execution to occur on device '" << deviceId.GetName() << "'");
std::fill_n(this->Internals->RuntimeAllowed, VTKM_MAX_DEVICE_ADAPTER_ID, false);
this->Internals->RuntimeAllowed[deviceId.GetValue()] = runtimeExists;
}
} }
VTKM_CONT VTKM_CONT
RuntimeDeviceTracker::RuntimeDeviceTracker( ScopedRuntimeDeviceTracker::ScopedRuntimeDeviceTracker(vtkm::cont::DeviceAdapterId device,
const std::shared_ptr<detail::RuntimeDeviceTrackerInternals>& internals) RuntimeDeviceTrackerMode mode)
: Internals(std::make_shared<detail::RuntimeDeviceTrackerInternals>()) : RuntimeDeviceTracker(GetRuntimeDeviceTracker().Internals, false)
, SavedState(new detail::RuntimeDeviceTrackerInternals())
{ {
std::copy_n( std::copy_n(
internals->RuntimeAllowed, VTKM_MAX_DEVICE_ADAPTER_ID, this->Internals->RuntimeAllowed); this->Internals->RuntimeAllowed, VTKM_MAX_DEVICE_ADAPTER_ID, this->SavedState->RuntimeAllowed);
if (mode == RuntimeDeviceTrackerMode::Force)
{
this->ForceDevice(device);
}
else if (mode == RuntimeDeviceTrackerMode::Enable)
{
this->ResetDevice(device);
}
else if (mode == RuntimeDeviceTrackerMode::Disable)
{
this->DisableDevice(device);
}
} }
VTKM_CONT VTKM_CONT
void RuntimeDeviceTracker::ForceDeviceImpl(vtkm::cont::DeviceAdapterId deviceId, bool runtimeExists) ScopedRuntimeDeviceTracker::ScopedRuntimeDeviceTracker(
vtkm::cont::DeviceAdapterId device,
RuntimeDeviceTrackerMode mode,
const vtkm::cont::RuntimeDeviceTracker& tracker)
: RuntimeDeviceTracker(tracker.Internals, false)
, SavedState(new detail::RuntimeDeviceTrackerInternals())
{ {
if (!runtimeExists) std::copy_n(
this->Internals->RuntimeAllowed, VTKM_MAX_DEVICE_ADAPTER_ID, this->SavedState->RuntimeAllowed);
if (mode == RuntimeDeviceTrackerMode::Force)
{ {
std::stringstream message; this->ForceDevice(device);
message << "Cannot force to device '" << deviceId.GetName()
<< "' because that device is not available on this system";
throw vtkm::cont::ErrorBadValue(message.str());
} }
this->CheckDevice(deviceId); else if (mode == RuntimeDeviceTrackerMode::Enable)
{
VTKM_LOG_S(vtkm::cont::LogLevel::Info, this->ResetDevice(device);
"Forcing execution to occur on device '" << deviceId.GetName() << "'"); }
else if (mode == RuntimeDeviceTrackerMode::Disable)
std::fill_n(this->Internals->RuntimeAllowed, VTKM_MAX_DEVICE_ADAPTER_ID, false); {
this->DisableDevice(device);
}
}
this->Internals->RuntimeAllowed[deviceId.GetValue()] = runtimeExists; VTKM_CONT
ScopedRuntimeDeviceTracker::ScopedRuntimeDeviceTracker(
const vtkm::cont::RuntimeDeviceTracker& tracker)
: RuntimeDeviceTracker(tracker.Internals, false)
, SavedState(new detail::RuntimeDeviceTrackerInternals())
{
std::copy_n(
this->Internals->RuntimeAllowed, VTKM_MAX_DEVICE_ADAPTER_ID, this->SavedState->RuntimeAllowed);
} }
VTKM_CONT VTKM_CONT
void RuntimeDeviceTracker::ForceDevice(DeviceAdapterId deviceId) ScopedRuntimeDeviceTracker::~ScopedRuntimeDeviceTracker()
{ {
vtkm::cont::RuntimeDeviceInformation runtimeDevice; std::copy_n(
this->ForceDeviceImpl(deviceId, runtimeDevice.Exists(deviceId)); this->SavedState->RuntimeAllowed, VTKM_MAX_DEVICE_ADAPTER_ID, this->Internals->RuntimeAllowed);
} }
VTKM_CONT VTKM_CONT
...@@ -150,6 +239,8 @@ vtkm::cont::RuntimeDeviceTracker& GetRuntimeDeviceTracker() ...@@ -150,6 +239,8 @@ vtkm::cont::RuntimeDeviceTracker& GetRuntimeDeviceTracker()
#if defined(VTKM_CLANG) && defined(__apple_build_version__) && (__apple_build_version__ < 8000000) #if defined(VTKM_CLANG) && defined(__apple_build_version__) && (__apple_build_version__ < 8000000)
static std::mutex mtx; static std::mutex mtx;
static std::map<std::thread::id, vtkm::cont::RuntimeDeviceTracker*> globalTrackers; 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::thread::id this_id = std::this_thread::get_id();
std::unique_lock<std::mutex> lock(mtx); std::unique_lock<std::mutex> lock(mtx);
...@@ -160,12 +251,15 @@ vtkm::cont::RuntimeDeviceTracker& GetRuntimeDeviceTracker() ...@@ -160,12 +251,15 @@ vtkm::cont::RuntimeDeviceTracker& GetRuntimeDeviceTracker()
} }
else 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; globalTrackers[this_id] = tracker;
globalTrackerInternals[this_id] = details;
return *tracker; return *tracker;
} }
#else #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; return runtimeDeviceTracker;
#endif #endif
} }
......
This diff is collapsed.
...@@ -22,7 +22,7 @@ namespace detail ...@@ -22,7 +22,7 @@ namespace detail
{ {
VTKM_CONT_EXPORT void HandleTryExecuteException(vtkm::cont::DeviceAdapterId deviceId, VTKM_CONT_EXPORT void HandleTryExecuteException(vtkm::cont::DeviceAdapterId deviceId,
vtkm::cont::RuntimeDeviceTracker tracker, vtkm::cont::RuntimeDeviceTracker& tracker,
const std::string& functorName) const std::string& functorName)
{ {
try try
......
...@@ -25,7 +25,7 @@ namespace detail ...@@ -25,7 +25,7 @@ namespace detail
{ {
VTKM_CONT_EXPORT void HandleTryExecuteException(vtkm::cont::DeviceAdapterId, VTKM_CONT_EXPORT void HandleTryExecuteException(vtkm::cont::DeviceAdapterId,
vtkm::cont::RuntimeDeviceTracker, vtkm::cont::RuntimeDeviceTracker&,
const std::string& functorName); const std::string& functorName);
template <typename DeviceTag, typename Functor, typename... Args> template <typename DeviceTag, typename Functor, typename... Args>
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
int UnitTestCudaArrayHandle(int argc, char* argv[]) int UnitTestCudaArrayHandle(int argc, char* argv[])
{ {
auto tracker = vtkm::cont::GetRuntimeDeviceTracker(); auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagCuda{}); tracker.ForceDevice(vtkm::cont::DeviceAdapterTagCuda{});
return vtkm::cont::testing::TestingArrayHandles<vtkm::cont::DeviceAdapterTagCuda>::Run(argc, return vtkm::cont::testing::TestingArrayHandles<vtkm::cont::DeviceAdapterTagCuda>::Run(argc,
argv); argv);
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
int UnitTestCudaArrayHandleFancy(int argc, char* argv[]) int UnitTestCudaArrayHandleFancy(int argc, char* argv[])
{ {
auto tracker = vtkm::cont::GetRuntimeDeviceTracker(); auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagCuda{}); tracker.ForceDevice(vtkm::cont::DeviceAdapterTagCuda{});
int result = vtkm::cont::testing::TestingFancyArrayHandles<vtkm::cont::DeviceAdapterTagCuda>::Run( int result = vtkm::cont::testing::TestingFancyArrayHandles<vtkm::cont::DeviceAdapterTagCuda>::Run(
argc, argv); argc, argv);
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
int UnitTestCudaArrayHandleVirtualCoordinates(int argc, char* argv[]) int UnitTestCudaArrayHandleVirtualCoordinates(int argc, char* argv[])
{ {
auto tracker = vtkm::cont::GetRuntimeDeviceTracker(); auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagCuda{}); tracker.ForceDevice(vtkm::cont::DeviceAdapterTagCuda{});
return vtkm::cont::testing::TestingArrayHandleVirtualCoordinates< return vtkm::cont::testing::TestingArrayHandleVirtualCoordinates<
vtkm::cont::DeviceAdapterTagCuda>::Run(argc, argv); vtkm::cont::DeviceAdapterTagCuda>::Run(argc, argv);
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
int UnitTestCudaBitField(int argc, char* argv[]) int UnitTestCudaBitField(int argc, char* argv[])
{ {
auto tracker = vtkm::cont::GetRuntimeDeviceTracker(); auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagCuda{}); tracker.ForceDevice(vtkm::cont::DeviceAdapterTagCuda{});
return vtkm::cont::testing::TestingBitField<vtkm::cont::DeviceAdapterTagCuda>::Run(argc, argv); return vtkm::cont::testing::TestingBitField<vtkm::cont::DeviceAdapterTagCuda>::Run(argc, argv);
} }
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
int UnitTestCudaCellLocatorRectilinearGrid(int argc, char* argv[]) int UnitTestCudaCellLocatorRectilinearGrid(int argc, char* argv[])
{ {
auto tracker = vtkm::cont::GetRuntimeDeviceTracker(); auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagCuda{}); tracker.ForceDevice(vtkm::cont::DeviceAdapterTagCuda{});
return vtkm::cont::testing::Testing::Run( return vtkm::cont::testing::Testing::Run(
TestingCellLocatorRectilinearGrid<vtkm::cont::DeviceAdapterTagCuda>(), argc, argv); TestingCellLocatorRectilinearGrid<vtkm::cont::DeviceAdapterTagCuda>(), argc, argv);
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
int UnitTestCudaCellLocatorUniformBins(int argc, char* argv[]) int UnitTestCudaCellLocatorUniformBins(int argc, char* argv[])
{ {
auto tracker = vtkm::cont::GetRuntimeDeviceTracker(); auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagCuda{}); tracker.ForceDevice(vtkm::cont::DeviceAdapterTagCuda{});
return vtkm::cont::testing::Testing::Run( return vtkm::cont::testing::Testing::Run(
TestingCellLocatorUniformBins<vtkm::cont::DeviceAdapterTagCuda>, argc, argv); TestingCellLocatorUniformBins<vtkm::cont::DeviceAdapterTagCuda>, argc, argv);
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
int UnitTestCudaCellLocatorUniformGrid(int argc, char* argv[]) int UnitTestCudaCellLocatorUniformGrid(int argc, char* argv[])
{ {
auto tracker = vtkm::cont::GetRuntimeDeviceTracker(); auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagCuda{}); tracker.ForceDevice(vtkm::cont::DeviceAdapterTagCuda{});
return vtkm::cont::testing::Testing::Run( return vtkm::cont::testing::Testing::Run(
TestingCellLocatorUniformGrid<vtkm::cont::DeviceAdapterTagCuda>(), argc, argv); TestingCellLocatorUniformGrid<vtkm::cont::DeviceAdapterTagCuda>(), argc, argv);
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
int UnitTestCudaColorTable(int argc, char* argv[]) int UnitTestCudaColorTable(int argc, char* argv[])
{ {
auto tracker = vtkm::cont::GetRuntimeDeviceTracker(); auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagCuda{}); tracker.ForceDevice(vtkm::cont::DeviceAdapterTagCuda{});
return vtkm::cont::testing::TestingColorTable<vtkm::cont::DeviceAdapterTagCuda>::Run(argc, argv); return vtkm::cont::testing::TestingColorTable<vtkm::cont::DeviceAdapterTagCuda>::Run(argc, argv);
} }
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
int UnitTestCudaComputeRange(int argc, char* argv[]) int UnitTestCudaComputeRange(int argc, char* argv[])
{ {
auto tracker = vtkm::cont::GetRuntimeDeviceTracker(); auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagCuda{}); tracker.ForceDevice(vtkm::cont::DeviceAdapterTagCuda{});
int result = int result =
vtkm::cont::testing::TestingComputeRange<vtkm::cont::DeviceAdapterTagCuda>::Run(argc, argv); vtkm::cont::testing::TestingComputeRange<vtkm::cont::DeviceAdapterTagCuda>::Run(argc, argv);
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
int UnitTestCudaDataSetExplicit(int argc, char* argv[]) int UnitTestCudaDataSetExplicit(int argc, char* argv[])
{ {
auto tracker = vtkm::cont::GetRuntimeDeviceTracker(); auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagCuda{}); tracker.ForceDevice(vtkm::cont::DeviceAdapterTagCuda{});
int result = int result =
vtkm::cont::testing::TestingDataSetExplicit<vtkm::cont::DeviceAdapterTagCuda>::Run(argc, argv); vtkm::cont::testing::TestingDataSetExplicit<vtkm::cont::DeviceAdapterTagCuda>::Run(argc, argv);
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
int UnitTestCudaDataSetSingleType(int argc, char* argv[]) int UnitTestCudaDataSetSingleType(int argc, char* argv[])
{ {
auto tracker = vtkm::cont::GetRuntimeDeviceTracker(); auto& tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagCuda{}); tracker.ForceDevice(vtkm::cont::DeviceAdapterTagCuda{});
int result = vtkm::cont::testing::TestingDataSetSingleType<vtkm::cont::DeviceAdapterTagCuda>::Run( int result = vtkm::cont::testing::TestingDataSetSingleType<vtkm::cont::DeviceAdapterTagCuda>::Run(
argc, argv); argc, argv);
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
int UnitTestCudaDeviceAdapter(int argc, char* argv[]) int UnitTestCudaDeviceAdapter(int argc, char* argv[])
{