Fix thread-GPU affinity bug. (#656)
Ensure that all threads use the same GPU, which wasn't the case before. * add `gpu_context::set_gpu()` method that will set all subsequent GPU calls from the calling thread run on the GPU of `gpu_context`. * `fvm_lowered_cell_impl` now calls the `set_gpu` method on construction and `advance`. * Also changed GPU memory allocation errors in `arb::memory` to throw `arb_exception` instead of calling `std::terminate` on error. Now errors due to poor GPU configuration can be caught by the calling application, and unit tests fail gracefully and allow other tests to run. Fixes #655
Showing
- arbor/fvm_lowered_cell_impl.hpp 12 additions, 0 deletionsarbor/fvm_lowered_cell_impl.hpp
- arbor/gpu_context.cpp 23 additions, 6 deletionsarbor/gpu_context.cpp
- arbor/gpu_context.hpp 3 additions, 0 deletionsarbor/gpu_context.hpp
- arbor/memory/cuda_wrappers.cpp 11 additions, 15 deletionsarbor/memory/cuda_wrappers.cpp
Please register or sign in to comment