-
- Downloads
Save device choice on spawned control threads
The `RuntimeDeviceTracker` is a thread-local variable that monitors the devices to use separately on each thread. This is an important feature to allow different threads to control different devices. When a tracker is created on a new thread, it was simply reset, which makes sense. However, the reset does not take into account the device selected by `vtkm::cont::Initialize`. This means that if VTK-m was used in a different thread than it was initialized, it would ignore the `--vtkm-device` parameter. To get around this problem, keep track of the `RuntimeDeviceTracker` on the "main" thread. When a `RuntimeDeviceTracker` is created on a new thread, it copies the state from that tracker.
Showing
- vtkm/cont/RuntimeDeviceTracker.cxx 30 additions, 21 deletionsvtkm/cont/RuntimeDeviceTracker.cxx
- vtkm/cont/testing/CMakeLists.txt 1 addition, 0 deletionsvtkm/cont/testing/CMakeLists.txt
- vtkm/cont/testing/UnitTestDeviceSelectOnThreads.cxx 83 additions, 0 deletionsvtkm/cont/testing/UnitTestDeviceSelectOnThreads.cxx
Please register or sign in to comment