Commit b47ed216 authored by Robert Maynard's avatar Robert Maynard Committed by Kitware Robot
Browse files

Merge topic 'runtime_device_tracker_log_each_device_changes'

0ee57537

 VTK-m now logs whenever at runtime a device is enabled/disabled.
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !1501
parents 169f5516 0ee57537
...@@ -182,8 +182,6 @@ InitializeResult Initialize(int& argc, char* argv[], InitializeOptions opts) ...@@ -182,8 +182,6 @@ InitializeResult Initialize(int& argc, char* argv[], InitializeOptions opts)
{ {
auto id = vtkm::cont::make_DeviceAdapterId(options[DEVICE].arg); auto id = vtkm::cont::make_DeviceAdapterId(options[DEVICE].arg);
auto tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker(); auto tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker();
VTKM_LOG_S(vtkm::cont::LogLevel::Info,
"Forcing device '" << tracker.GetDeviceName(id) << "'");
tracker.ForceDevice(id); tracker.ForceDevice(id);
config.Device = id; config.Device = id;
} }
......
...@@ -137,6 +137,9 @@ VTKM_CONT ...@@ -137,6 +137,9 @@ VTKM_CONT
void RuntimeDeviceTracker::SetDeviceState(vtkm::cont::DeviceAdapterId deviceId, bool state) void RuntimeDeviceTracker::SetDeviceState(vtkm::cont::DeviceAdapterId deviceId, bool state)
{ {
this->CheckDevice(deviceId); this->CheckDevice(deviceId);
VTKM_LOG_S(vtkm::cont::LogLevel::Info,
"Setting device '" << deviceId.GetName() << "' to " << state);
this->Internals->RuntimeValid[deviceId.GetValue()] = state; this->Internals->RuntimeValid[deviceId.GetValue()] = state;
} }
...@@ -197,6 +200,9 @@ void RuntimeDeviceTracker::ForceDeviceImpl(vtkm::cont::DeviceAdapterId deviceId, ...@@ -197,6 +200,9 @@ void RuntimeDeviceTracker::ForceDeviceImpl(vtkm::cont::DeviceAdapterId deviceId,
} }
this->CheckDevice(deviceId); this->CheckDevice(deviceId);
VTKM_LOG_S(vtkm::cont::LogLevel::Info,
"Forcing execution to occur on device '" << deviceId.GetName() << "'");
std::fill_n(this->Internals->RuntimeValid, VTKM_MAX_DEVICE_ADAPTER_ID, false); std::fill_n(this->Internals->RuntimeValid, VTKM_MAX_DEVICE_ADAPTER_ID, false);
this->Internals->RuntimeValid[deviceId.GetValue()] = runtimeExists; this->Internals->RuntimeValid[deviceId.GetValue()] = runtimeExists;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment