Commit 256e0c3c authored by Robert Maynard's avatar Robert Maynard Committed by Kitware Robot

Merge topic 'rename_to_GetRuntimeDeviceTracker'

ae11e115 RuntimeDeviceTracker: Remove `Global` from names
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland's avatarKenneth Moreland <kmorel@sandia.gov>
Merge-request: !1592
parents b8d9040a ae11e115
# Renamed RuntimeDeviceTrackers to use the term Global
The `GetGlobalRuntimeDeviceTracker` never actually returned a process wide
runtime device tracker but always a unique one for each control side thread.
This was the design as it would allow for different threads to have different
runtime device settings.
By removing the term Global from the name it becomes more clear what scope this
class has.
......@@ -48,7 +48,7 @@ void process_block_tbb(RuntimeTaskQueue& queue)
//task operate only on TBB. The "global" thread tracker
//is actually thread-local, so we can use that.
//
vtkm::cont::GetGlobalRuntimeDeviceTracker().ForceDevice(vtkm::cont::DeviceAdapterTagTBB{});
vtkm::cont::GetRuntimeDeviceTracker().ForceDevice(vtkm::cont::DeviceAdapterTagTBB{});
while (queue.hasTasks())
{
......@@ -76,7 +76,7 @@ void process_block_cuda(RuntimeTaskQueue& queue, int gpuId)
//task operate only on cuda. The "global" thread tracker
//is actually thread-local, so we can use that.
//
vtkm::cont::GetGlobalRuntimeDeviceTracker().ForceDevice(vtkm::cont::DeviceAdapterTagCuda{});
vtkm::cont::GetRuntimeDeviceTracker().ForceDevice(vtkm::cont::DeviceAdapterTagCuda{});
(void)gpuId;
while (queue.hasTasks())
......@@ -107,7 +107,7 @@ VTKM_CONT MultiDeviceGradient::MultiDeviceGradient()
, Workers()
{
//Step 1. Determine the number of workers we want
vtkm::cont::RuntimeDeviceTracker tracker;
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
const bool runOnTbb = tracker.CanRunOn(vtkm::cont::DeviceAdapterTagTBB{});
const bool runOnCuda = tracker.CanRunOn(vtkm::cont::DeviceAdapterTagCuda{});
......
......@@ -84,7 +84,7 @@ template <typename InValueType, typename InStorage, typename OutValueType, typen
VTKM_CONT void ArrayCopy(
const vtkm::cont::ArrayHandle<InValueType, InStorage>& source,
vtkm::cont::ArrayHandle<OutValueType, OutStorage>& destination,
vtkm::cont::RuntimeDeviceTracker tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker())
vtkm::cont::RuntimeDeviceTracker tracker = vtkm::cont::GetRuntimeDeviceTracker())
{
detail::ArrayCopyFunctor functor;
......
......@@ -324,8 +324,8 @@ public:
PortalConstType GetPortalConst() const
{
VTKM_ASSERT(this->Valid);
vtkm::cont::ScopedGlobalRuntimeDeviceTracker trackerScope;
vtkm::cont::GetGlobalRuntimeDeviceTracker().ForceDevice(vtkm::cont::DeviceAdapterTagSerial());
vtkm::cont::ScopedRuntimeDeviceTracker trackerScope;
vtkm::cont::GetRuntimeDeviceTracker().ForceDevice(vtkm::cont::DeviceAdapterTagSerial());
return PortalConstType(this->Array.GetPortalConstControl(), this->Functor.PrepareForControl());
}
......@@ -416,8 +416,8 @@ public:
PortalType GetPortal()
{
VTKM_ASSERT(this->Valid);
vtkm::cont::ScopedGlobalRuntimeDeviceTracker trackerScope;
vtkm::cont::GetGlobalRuntimeDeviceTracker().ForceDevice(vtkm::cont::DeviceAdapterTagSerial());
vtkm::cont::ScopedRuntimeDeviceTracker trackerScope;
vtkm::cont::GetRuntimeDeviceTracker().ForceDevice(vtkm::cont::DeviceAdapterTagSerial());
return PortalType(this->Array.GetPortalControl(),
this->Functor.PrepareForControl(),
this->InverseFunctor.PrepareForControl());
......@@ -427,8 +427,8 @@ public:
PortalConstType GetPortalConst() const
{
VTKM_ASSERT(this->Valid);
vtkm::cont::ScopedGlobalRuntimeDeviceTracker trackerScope;
vtkm::cont::GetGlobalRuntimeDeviceTracker().ForceDevice(vtkm::cont::DeviceAdapterTagSerial());
vtkm::cont::ScopedRuntimeDeviceTracker trackerScope;
vtkm::cont::GetRuntimeDeviceTracker().ForceDevice(vtkm::cont::DeviceAdapterTagSerial());
return PortalConstType(this->Array.GetPortalConstControl(),
this->Functor.PrepareForControl(),
this->InverseFunctor.PrepareForControl());
......
......@@ -50,7 +50,7 @@ namespace cont
template <typename ArrayHandleType>
VTKM_CONT vtkm::cont::ArrayHandle<vtkm::Range> ArrayRangeCompute(
const ArrayHandleType& input,
vtkm::cont::RuntimeDeviceTracker tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker());
vtkm::cont::RuntimeDeviceTracker tracker = vtkm::cont::GetRuntimeDeviceTracker());
// Precompiled versions of ArrayRangeCompute
#define VTKM_ARRAY_RANGE_COMPUTE_EXPORT_T(T, Storage) \
......@@ -58,13 +58,13 @@ VTKM_CONT vtkm::cont::ArrayHandle<vtkm::Range> ArrayRangeCompute(
VTKM_CONT \
vtkm::cont::ArrayHandle<vtkm::Range> ArrayRangeCompute( \
const vtkm::cont::ArrayHandle<T, Storage>& input, \
vtkm::cont::RuntimeDeviceTracker tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker())
vtkm::cont::RuntimeDeviceTracker tracker = vtkm::cont::GetRuntimeDeviceTracker())
#define VTKM_ARRAY_RANGE_COMPUTE_EXPORT_VEC(T, N, Storage) \
VTKM_CONT_EXPORT \
VTKM_CONT \
vtkm::cont::ArrayHandle<vtkm::Range> ArrayRangeCompute( \
const vtkm::cont::ArrayHandle<vtkm::Vec<T, N>, Storage>& input, \
vtkm::cont::RuntimeDeviceTracker tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker())
vtkm::cont::RuntimeDeviceTracker tracker = vtkm::cont::GetRuntimeDeviceTracker())
VTKM_ARRAY_RANGE_COMPUTE_EXPORT_T(char, vtkm::cont::StorageTagBasic);
VTKM_ARRAY_RANGE_COMPUTE_EXPORT_T(vtkm::Int8, vtkm::cont::StorageTagBasic);
......@@ -97,22 +97,17 @@ VTKM_ARRAY_RANGE_COMPUTE_EXPORT_VEC(vtkm::Float64, 4, vtkm::cont::StorageTagBasi
#undef VTKM_ARRAY_RANGE_COMPUTE_EXPORT_T
#undef VTKM_ARRAY_RANGE_COMPUTE_EXPORT_VEC
// VTKM_CONT
// vtkm::cont::ArrayHandle<vtkm::Range> ArrayRangeCompute(
// const vtkm::cont::ArrayHandleVirtualCoordinates& input,
// vtkm::cont::RuntimeDeviceTracker tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker());
VTKM_CONT
vtkm::cont::ArrayHandle<vtkm::Range> ArrayRangeCompute(
const vtkm::cont::ArrayHandleVirtual<vtkm::Vec<vtkm::FloatDefault, 3>>& input,
vtkm::cont::RuntimeDeviceTracker tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker());
vtkm::cont::RuntimeDeviceTracker tracker = vtkm::cont::GetRuntimeDeviceTracker());
VTKM_CONT_EXPORT
VTKM_CONT
vtkm::cont::ArrayHandle<vtkm::Range> ArrayRangeCompute(
const vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::FloatDefault, 3>,
vtkm::cont::ArrayHandleUniformPointCoordinates::StorageTag>& array,
vtkm::cont::RuntimeDeviceTracker = vtkm::cont::GetGlobalRuntimeDeviceTracker());
vtkm::cont::RuntimeDeviceTracker = vtkm::cont::GetRuntimeDeviceTracker());
// Implementation of composite vectors
VTKM_CONT_EXPORT
......@@ -123,7 +118,7 @@ vtkm::cont::ArrayHandle<vtkm::Range> ArrayRangeCompute(
vtkm::cont::ArrayHandle<vtkm::Float32>,
vtkm::cont::ArrayHandle<vtkm::Float32>,
vtkm::cont::ArrayHandle<vtkm::Float32>>::StorageTag>& input,
vtkm::cont::RuntimeDeviceTracker tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker());
vtkm::cont::RuntimeDeviceTracker tracker = vtkm::cont::GetRuntimeDeviceTracker());
VTKM_CONT_EXPORT
VTKM_CONT
......@@ -133,7 +128,7 @@ vtkm::cont::ArrayHandle<vtkm::Range> ArrayRangeCompute(
vtkm::cont::ArrayHandle<vtkm::Float64>,
vtkm::cont::ArrayHandle<vtkm::Float64>,
vtkm::cont::ArrayHandle<vtkm::Float64>>::StorageTag>& input,
vtkm::cont::RuntimeDeviceTracker tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker());
vtkm::cont::RuntimeDeviceTracker tracker = vtkm::cont::GetRuntimeDeviceTracker());
// Implementation of cartesian products
template <typename T, typename ArrayType1, typename ArrayType2, typename ArrayType3>
......@@ -141,7 +136,7 @@ VTKM_CONT inline vtkm::cont::ArrayHandle<vtkm::Range> ArrayRangeCompute(
const vtkm::cont::ArrayHandle<
T,
vtkm::cont::internal::StorageTagCartesianProduct<ArrayType1, ArrayType2, ArrayType3>>& input,
vtkm::cont::RuntimeDeviceTracker tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker())
vtkm::cont::RuntimeDeviceTracker tracker = vtkm::cont::GetRuntimeDeviceTracker())
{
vtkm::cont::ArrayHandle<vtkm::Range> result;
result.Allocate(3);
......
......@@ -55,7 +55,7 @@ struct ArrayRangeComputeFunctor
template <typename T, typename S>
inline vtkm::cont::ArrayHandle<vtkm::Range> ArrayRangeComputeImpl(
const vtkm::cont::ArrayHandle<T, S>& input,
vtkm::cont::RuntimeDeviceTracker& tracker)
vtkm::cont::RuntimeDeviceTracker tracker)
{
using VecTraits = vtkm::VecTraits<T>;
using CT = typename VecTraits::ComponentType;
......@@ -104,16 +104,6 @@ inline vtkm::cont::ArrayHandle<vtkm::Range> ArrayRangeComputeImpl(
} // namespace detail
// VTKM_CONT
// inline vtkm::cont::ArrayHandle<vtkm::Range> ArrayRangeCompute(
// const vtkm::cont::ArrayHandleVirtualCoordinates& input,
// vtkm::cont::RuntimeDeviceTracker tracker)
// {
// auto array =
// static_cast<const vtkm::cont::ArrayHandleVirtual<vtkm::Vec<vtkm::FloatDefault, 3>>&>(input);
// return ArrayRangeCompute(array, tracker);
// }
VTKM_CONT
inline vtkm::cont::ArrayHandle<vtkm::Range> ArrayRangeCompute(
const vtkm::cont::ArrayHandleVirtual<vtkm::Vec<vtkm::FloatDefault, 3>>& input,
......
......@@ -90,7 +90,7 @@ struct VtkmArg : public opt::Arg
return false;
}
auto tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker();
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
bool result = false;
try
{
......@@ -108,13 +108,12 @@ struct VtkmArg : public opt::Arg
std::ostringstream names;
names << "\"Any\" ";
auto tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker();
for (vtkm::Int8 i = 0; i < VTKM_MAX_DEVICE_ADAPTER_ID; ++i)
{
auto id = vtkm::cont::make_DeviceAdapterId(i);
if (VtkmArg::DeviceIsAvailable(id))
{
names << "\"" << tracker.GetDeviceName(id) << "\" ";
names << "\"" << id.GetName() << "\" ";
}
}
return names.str();
......@@ -181,7 +180,7 @@ InitializeResult Initialize(int& argc, char* argv[], InitializeOptions opts)
if (options[DEVICE])
{
auto id = vtkm::cont::make_DeviceAdapterId(options[DEVICE].arg);
auto tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker();
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(id);
config.Device = id;
}
......
......@@ -168,7 +168,7 @@ struct VTKM_NEVER_EXPORT RuntimeDeviceTrackerResetFunctor
vtkm::cont::RuntimeDeviceTracker Tracker;
VTKM_CONT
RuntimeDeviceTrackerResetFunctor(const vtkm::cont::RuntimeDeviceTracker& tracker)
RuntimeDeviceTrackerResetFunctor(const vtkm::cont::RuntimeDeviceTracker tracker)
: Tracker(tracker)
{
}
......@@ -197,7 +197,7 @@ vtkm::cont::RuntimeDeviceTracker RuntimeDeviceTracker::DeepCopy() const
}
VTKM_CONT
void RuntimeDeviceTracker::DeepCopy(const vtkm::cont::RuntimeDeviceTracker& src)
void RuntimeDeviceTracker::DeepCopy(const vtkm::cont::RuntimeDeviceTracker src)
{
std::copy_n(
src.Internals->RuntimeValid, VTKM_MAX_DEVICE_ADAPTER_ID, this->Internals->RuntimeValid);
......@@ -314,7 +314,7 @@ DeviceAdapterId RuntimeDeviceTracker::GetDeviceAdapterId(DeviceAdapterNameType n
}
VTKM_CONT
vtkm::cont::RuntimeDeviceTracker GetGlobalRuntimeDeviceTracker()
vtkm::cont::RuntimeDeviceTracker GetRuntimeDeviceTracker()
{
#if defined(VTKM_CLANG) && (__apple_build_version__ < 8000000)
static std::mutex mtx;
......
......@@ -167,7 +167,7 @@ public:
///
VTKM_CONT_EXPORT
VTKM_CONT
void DeepCopy(const vtkm::cont::RuntimeDeviceTracker& src);
void DeepCopy(const vtkm::cont::RuntimeDeviceTracker src);
/// \brief Disable the given device
///
......@@ -251,29 +251,29 @@ private:
/// Xcode's clang only supports thread_local from version 8
VTKM_CONT_EXPORT
VTKM_CONT
vtkm::cont::RuntimeDeviceTracker GetGlobalRuntimeDeviceTracker();
vtkm::cont::RuntimeDeviceTracker GetRuntimeDeviceTracker();
struct ScopedGlobalRuntimeDeviceTracker
struct ScopedRuntimeDeviceTracker
{
vtkm::cont::RuntimeDeviceTracker SavedTracker;
VTKM_CONT ScopedGlobalRuntimeDeviceTracker()
: SavedTracker(vtkm::cont::GetGlobalRuntimeDeviceTracker().DeepCopy())
VTKM_CONT ScopedRuntimeDeviceTracker()
: SavedTracker(vtkm::cont::GetRuntimeDeviceTracker().DeepCopy())
{
}
VTKM_CONT ScopedGlobalRuntimeDeviceTracker(vtkm::cont::RuntimeDeviceTracker tracker)
: SavedTracker(vtkm::cont::GetGlobalRuntimeDeviceTracker().DeepCopy())
VTKM_CONT ScopedRuntimeDeviceTracker(vtkm::cont::RuntimeDeviceTracker tracker)
: SavedTracker(vtkm::cont::GetRuntimeDeviceTracker().DeepCopy())
{
vtkm::cont::GetGlobalRuntimeDeviceTracker().DeepCopy(tracker);
vtkm::cont::GetRuntimeDeviceTracker().DeepCopy(tracker);
}
VTKM_CONT ~ScopedGlobalRuntimeDeviceTracker()
VTKM_CONT ~ScopedRuntimeDeviceTracker()
{
vtkm::cont::GetGlobalRuntimeDeviceTracker().DeepCopy(this->SavedTracker);
vtkm::cont::GetRuntimeDeviceTracker().DeepCopy(this->SavedTracker);
}
ScopedGlobalRuntimeDeviceTracker(const ScopedGlobalRuntimeDeviceTracker&) = delete;
ScopedRuntimeDeviceTracker(const ScopedRuntimeDeviceTracker&) = delete;
};
}
} // namespace vtkm::cont
......
......@@ -225,7 +225,7 @@ Timer::Timer(vtkm::cont::DeviceAdapterId device)
: Device(device)
, Internal(nullptr)
{
vtkm::cont::RuntimeDeviceTracker tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker();
vtkm::cont::RuntimeDeviceTracker tracker = vtkm::cont::GetRuntimeDeviceTracker();
if (device != DeviceAdapterTagAny() && !tracker.CanRunOn(device))
{
VTKM_LOG_S(vtkm::cont::LogLevel::Error,
......@@ -254,7 +254,7 @@ void Timer::Reset()
void Timer::Reset(vtkm::cont::DeviceAdapterId device)
{
vtkm::cont::RuntimeDeviceTracker tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker();
vtkm::cont::RuntimeDeviceTracker tracker = vtkm::cont::GetRuntimeDeviceTracker();
if (device != DeviceAdapterTagAny() && !tracker.CanRunOn(device))
{
VTKM_LOG_S(vtkm::cont::LogLevel::Error,
......@@ -327,7 +327,7 @@ vtkm::Float64 Timer::GetElapsedTime(vtkm::cont::DeviceAdapterId device) const
}
// If we have specified a specific device, make sure we can run on it.
vtkm::cont::RuntimeDeviceTracker tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker();
vtkm::cont::RuntimeDeviceTracker tracker = vtkm::cont::GetRuntimeDeviceTracker();
if ((deviceToTime != vtkm::cont::DeviceAdapterTagAny()) && !tracker.CanRunOn(deviceToTime))
{
VTKM_LOG_S(vtkm::cont::LogLevel::Error,
......
......@@ -32,7 +32,7 @@ namespace detail
{
void HandleTryExecuteException(vtkm::cont::DeviceAdapterId deviceId,
vtkm::cont::RuntimeDeviceTracker& tracker,
vtkm::cont::RuntimeDeviceTracker tracker,
const std::string& functorName)
{
try
......
......@@ -34,7 +34,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>
......@@ -42,7 +42,7 @@ inline bool TryExecuteIfValid(std::true_type,
DeviceTag tag,
Functor&& f,
vtkm::cont::DeviceAdapterId devId,
vtkm::cont::RuntimeDeviceTracker& tracker,
vtkm::cont::RuntimeDeviceTracker tracker,
Args&&... args)
{
if ((tag == devId || devId == DeviceAdapterTagAny()) && tracker.CanRunOn(tag))
......@@ -66,7 +66,7 @@ inline bool TryExecuteIfValid(std::false_type,
DeviceTag,
Functor&&,
vtkm::cont::DeviceAdapterId,
vtkm::cont::RuntimeDeviceTracker&,
vtkm::cont::RuntimeDeviceTracker,
Args&&...)
{
return false;
......@@ -78,7 +78,7 @@ struct TryExecuteWrapper
inline void operator()(DeviceTag tag,
Functor&& f,
vtkm::cont::DeviceAdapterId devId,
vtkm::cont::RuntimeDeviceTracker& tracker,
vtkm::cont::RuntimeDeviceTracker tracker,
bool& ran,
Args&&... args) const
{
......@@ -99,7 +99,7 @@ inline bool TryExecuteImpl(vtkm::cont::DeviceAdapterId devId,
Functor&& functor,
std::true_type,
std::true_type,
vtkm::cont::RuntimeDeviceTracker& tracker,
vtkm::cont::RuntimeDeviceTracker tracker,
DeviceList list,
Args&&... args)
{
......@@ -123,7 +123,7 @@ inline bool TryExecuteImpl(vtkm::cont::DeviceAdapterId devId,
Args&&... args)
{
bool success = false;
auto tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker();
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
TryExecuteWrapper task;
vtkm::ListForEach(task,
VTKM_DEFAULT_DEVICE_ADAPTER_LIST_TAG(),
......@@ -160,7 +160,7 @@ inline bool TryExecuteImpl(vtkm::cont::DeviceAdapterId devId,
Arg1&& arg1,
Args&&... args)
{
auto tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker();
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
return TryExecuteImpl(devId,
std::forward<Functor>(functor),
t,
......@@ -213,7 +213,7 @@ inline bool TryExecuteImpl(vtkm::cont::DeviceAdapterId devId,
/// vtkm::cont::TryExecuteOnDevice(devId, TryCallExample(), int{42});
///
/// // Executing on a specific deviceID with a runtime tracker
/// auto tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker();
/// auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
/// vtkm::cont::TryExecute(devId, TryCallExample(), tracker, int{42});
///
/// \endcode
......@@ -224,7 +224,7 @@ inline bool TryExecuteImpl(vtkm::cont::DeviceAdapterId devId,
/// If no device list is specified, then \c VTKM_DEFAULT_DEVICE_ADAPTER_LIST_TAG
/// is used.
///
/// If no \c RuntimeDeviceTracker specified, then \c GetGlobalRuntimeDeviceTracker()
/// If no \c RuntimeDeviceTracker specified, then \c GetRuntimeDeviceTracker()
/// is used.
template <typename Functor>
VTKM_CONT bool TryExecuteOnDevice(vtkm::cont::DeviceAdapterId devId, Functor&& functor)
......@@ -320,7 +320,7 @@ VTKM_CONT bool TryExecuteOnDevice(vtkm::cont::DeviceAdapterId devId,
/// vtkm::cont::TryExecute(TryCallExample(), int{42});
///
/// // Executing with a runtime tracker
/// auto tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker();
/// auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
/// vtkm::cont::TryExecute(TryCallExample(), tracker, int{42});
///
/// // Executing with a device list
......@@ -338,7 +338,7 @@ VTKM_CONT bool TryExecuteOnDevice(vtkm::cont::DeviceAdapterId devId,
/// If no device list is specified, then \c VTKM_DEFAULT_DEVICE_ADAPTER_LIST_TAG
/// is used.
///
/// If no \c RuntimeDeviceTracker specified, then \c GetGlobalRuntimeDeviceTracker()
/// If no \c RuntimeDeviceTracker specified, then \c GetRuntimeDeviceTracker()
/// is used.
template <typename Functor, typename... Args>
VTKM_CONT bool TryExecute(Functor&& functor, Args&&... args)
......
......@@ -28,7 +28,7 @@
int UnitTestCudaArrayHandle(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker();
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagCuda{});
return vtkm::cont::testing::TestingArrayHandles<vtkm::cont::DeviceAdapterTagCuda>::Run(argc,
argv);
......
......@@ -30,7 +30,7 @@
int UnitTestCudaArrayHandleFancy(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker();
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagCuda{});
int result = vtkm::cont::testing::TestingFancyArrayHandles<vtkm::cont::DeviceAdapterTagCuda>::Run(
argc, argv);
......
......@@ -28,7 +28,7 @@
int UnitTestCudaArrayHandleVirtualCoordinates(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker();
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagCuda{});
return vtkm::cont::testing::TestingArrayHandleVirtualCoordinates<
vtkm::cont::DeviceAdapterTagCuda>::Run(argc, argv);
......
......@@ -27,7 +27,7 @@
int UnitTestCudaCellLocatorRectilinearGrid(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker();
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagCuda{});
return vtkm::cont::testing::Testing::Run(
TestingCellLocatorRectilinearGrid<vtkm::cont::DeviceAdapterTagCuda>(), argc, argv);
......
......@@ -27,7 +27,7 @@
int UnitTestCudaCellLocatorTwoLevelUniformGrid(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker();
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagCuda{});
return vtkm::cont::testing::Testing::Run(
TestingCellLocatorTwoLevelUniformGrid<vtkm::cont::DeviceAdapterTagCuda>, argc, argv);
......
......@@ -27,7 +27,7 @@
int UnitTestCudaCellLocatorUniformGrid(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker();
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagCuda{});
return vtkm::cont::testing::Testing::Run(
TestingCellLocatorUniformGrid<vtkm::cont::DeviceAdapterTagCuda>(), argc, argv);
......
......@@ -29,7 +29,7 @@
int UnitTestCudaColorTable(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker();
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagCuda{});
return vtkm::cont::testing::TestingColorTable<vtkm::cont::DeviceAdapterTagCuda>::Run(argc, argv);
}
......@@ -30,7 +30,7 @@
int UnitTestCudaComputeRange(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker();
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagCuda{});
int result =
vtkm::cont::testing::TestingComputeRange<vtkm::cont::DeviceAdapterTagCuda>::Run(argc, argv);
......
......@@ -29,7 +29,7 @@
int UnitTestCudaDataSetExplicit(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker();
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagCuda{});
int result =
vtkm::cont::testing::TestingDataSetExplicit<vtkm::cont::DeviceAdapterTagCuda>::Run(argc, argv);
......
......@@ -30,7 +30,7 @@
int UnitTestCudaDataSetSingleType(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker();
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagCuda{});
int result = vtkm::cont::testing::TestingDataSetSingleType<vtkm::cont::DeviceAdapterTagCuda>::Run(
argc, argv);
......
......@@ -30,7 +30,7 @@
int UnitTestCudaDeviceAdapter(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker();
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagCuda{});
int result =
vtkm::cont::testing::TestingDeviceAdapter<vtkm::cont::DeviceAdapterTagCuda>::Run(argc, argv);
......
......@@ -31,7 +31,7 @@
int UnitTestCudaGeometry(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker();
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagCuda{});
return vtkm::cont::testing::Testing::Run(
UnitTestGeometryNamespace::RunGeometryTests<vtkm::cont::DeviceAdapterTagCuda>, argc, argv);
......
......@@ -38,7 +38,7 @@ void TestImplicitFunctions()
int UnitTestCudaImplicitFunction(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker();
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagCuda{});
return vtkm::cont::testing::Testing::Run(TestImplicitFunctions, argc, argv);
}
......@@ -182,7 +182,7 @@ void RunEdgeCases()
int UnitTestCudaMath(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker();
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);
......
......@@ -27,7 +27,7 @@
int UnitTestCudaPointLocatorUniformGrid(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker();
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagCuda{});
return vtkm::cont::testing::Testing::Run(
TestingPointLocatorUniformGrid<vtkm::cont::DeviceAdapterTagCuda>(), argc, argv);
......
......@@ -282,7 +282,7 @@ void Launch()
int UnitTestCudaShareUserProvidedManagedMemory(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker();
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);
......
......@@ -30,7 +30,7 @@ namespace
void TestVirtualObjectHandle()
{
auto tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker();
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagCuda{});
using DeviceAdapterList = vtkm::ListTagBase<vtkm::cont::DeviceAdapterTagCuda>;
......
......@@ -45,7 +45,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))
......@@ -66,7 +66,7 @@ struct ExecuteIfValidDeviceTag
template <typename DeviceList, typename Functor, typename... Args>
VTKM_CONT void ForEachValidDevice(DeviceList devices, Functor&& functor, Args&&... args)
{
auto tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker();
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
vtkm::ListForEach(
ExecuteIfValidDeviceTag{}, devices, functor, tracker, std::forward<Args>(args)...);
}
......
......@@ -29,12 +29,12 @@ namespace cont
DeviceAdapterNameType DeviceAdapterId::GetName() const
{
return vtkm::cont::GetGlobalRuntimeDeviceTracker().GetDeviceName(*this);
return vtkm::cont::GetRuntimeDeviceTracker().GetDeviceName(*this);
}
DeviceAdapterId make_DeviceAdapterId(const DeviceAdapterNameType& name)
{
return vtkm::cont::GetGlobalRuntimeDeviceTracker().GetDeviceAdapterId(name);
return vtkm::cont::GetRuntimeDeviceTracker().GetDeviceAdapterId(name);
}
}
} // end namespace vtkm::cont
......@@ -25,7 +25,7 @@
int UnitTestOpenMPArrayHandle(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker();
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagOpenMP{});
return vtkm::cont::testing::TestingArrayHandles<vtkm::cont::DeviceAdapterTagOpenMP>::Run(argc,
argv);
......
......@@ -25,7 +25,7 @@
int UnitTestOpenMPArrayHandleFancy(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker();
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagOpenMP{});
return vtkm::cont::testing::TestingFancyArrayHandles<vtkm::cont::DeviceAdapterTagOpenMP>::Run(
argc, argv);
......
......@@ -25,7 +25,7 @@
int UnitTestOpenMPArrayHandleVirtualCoordinates(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker();
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagOpenMP{});
return vtkm::cont::testing::TestingArrayHandleVirtualCoordinates<
vtkm::cont::DeviceAdapterTagOpenMP>::Run(argc, argv);
......
......@@ -27,7 +27,7 @@
int UnitTestOpenMPCellLocatorRectilinearGrid(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker();
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagSerial{});
return vtkm::cont::testing::Testing::Run(
TestingCellLocatorRectilinearGrid<vtkm::cont::DeviceAdapterTagSerial>(), argc, argv);
......
......@@ -25,7 +25,7 @@
int UnitTestOpenMPCellLocatorTwoLevelUniformGrid(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker();
auto tracker = vtkm::cont::GetRuntimeDeviceTracker();
tracker.ForceDevice(vtkm::cont::DeviceAdapterTagOpenMP{});
return vtkm::cont::testing::Testing::Run(
TestingCellLocatorTwoLevelUniformGrid<vtkm::cont::DeviceAdapterTagOpenMP>, argc, argv);
......
......@@ -27,7 +27,7 @@
int UnitTestOpenMPCellLocatorUniformGrid(int argc, char* argv[])
{
auto tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker();