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.
Fixes #629 (closed)