Commit 0ee57537 authored by Robert Maynard's avatar Robert Maynard

VTK-m now logs whenever at runtime a device is enabled/disabled.

Previously we only logged when a user requested a device on the
command line, but that doesn't capture when code forces a device
parent 169f5516
......@@ -182,8 +182,6 @@ InitializeResult Initialize(int& argc, char* argv[], InitializeOptions opts)
{
auto id = vtkm::cont::make_DeviceAdapterId(options[DEVICE].arg);
auto tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker();
VTKM_LOG_S(vtkm::cont::LogLevel::Info,
"Forcing device '" << tracker.GetDeviceName(id) << "'");
tracker.ForceDevice(id);
config.Device = id;
}
......
......@@ -137,6 +137,9 @@ VTKM_CONT
void RuntimeDeviceTracker::SetDeviceState(vtkm::cont::DeviceAdapterId deviceId, bool state)
{
this->CheckDevice(deviceId);
VTKM_LOG_S(vtkm::cont::LogLevel::Info,
"Setting device '" << deviceId.GetName() << "' to " << state);
this->Internals->RuntimeValid[deviceId.GetValue()] = state;
}
......@@ -197,6 +200,9 @@ void RuntimeDeviceTracker::ForceDeviceImpl(vtkm::cont::DeviceAdapterId 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);
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