Stand alone CUDA compilation for threshold_watcher in gpu backend (#345)
Refactor the threshold_watcher and stack data structures in the gpu backend so that they are amenable to separable compilation. * Make `gpu::stack<T>` have a host-only interface that wraps a POD type `gpu::stack_base<T>`. * Implement a `push_back(stack_base, value)` method in `backends/gpu/kernels/stack.hpp` that is visible only to device code. * Move `test_thresholds` kernel to a .cu file, replacing template parameters with types provided by `backends/fvm_types.hpp`. * Add a simple C function interface, callable from host side code, defined in `backends/gpu/threshold_common.hpp`. * Simplify the `gpu::impl::padded_size` function (both to read and in terms of efficiency). * Use `typeid` as the default for pretty-printing types in the memory back end. * Update the `test_gpu_stack` unit test to support new gpu stack interface. * Fix bug in the `test_spikes` unit test, which was not running the GPU back end in the cuda unit tests.
Showing
- CMakeLists.txt 2 additions, 2 deletionsCMakeLists.txt
- src/CMakeLists.txt 1 addition, 0 deletionssrc/CMakeLists.txt
- src/backends/gpu/fvm.hpp 1 addition, 2 deletionssrc/backends/gpu/fvm.hpp
- src/backends/gpu/kernels/detail.hpp 2 additions, 2 deletionssrc/backends/gpu/kernels/detail.hpp
- src/backends/gpu/kernels/stack.hpp 31 additions, 0 deletionssrc/backends/gpu/kernels/stack.hpp
- src/backends/gpu/kernels/test_thresholds.cu 79 additions, 0 deletionssrc/backends/gpu/kernels/test_thresholds.cu
- src/backends/gpu/kernels/test_thresholds.hpp 9 additions, 53 deletionssrc/backends/gpu/kernels/test_thresholds.hpp
- src/backends/gpu/stack.hpp 56 additions, 49 deletionssrc/backends/gpu/stack.hpp
- src/backends/gpu/stack_common.hpp 42 additions, 0 deletionssrc/backends/gpu/stack_common.hpp
- src/backends/gpu/threshold_watcher.hpp 23 additions, 22 deletionssrc/backends/gpu/threshold_watcher.hpp
- src/communication/communicator.hpp 5 additions, 4 deletionssrc/communication/communicator.hpp
- src/memory/allocator.hpp 22 additions, 7 deletionssrc/memory/allocator.hpp
- src/memory/definitions.hpp 2 additions, 1 deletionsrc/memory/definitions.hpp
- src/util/compat.hpp 4 additions, 7 deletionssrc/util/compat.hpp
- tests/unit/test_gpu_stack.cu 48 additions, 17 deletionstests/unit/test_gpu_stack.cu
- tests/unit/test_spikes.cpp 5 additions, 6 deletionstests/unit/test_spikes.cpp
Please register or sign in to comment