Skip to content
Snippets Groups Projects
Commit 86384267 authored by Ben Cumming's avatar Ben Cumming Committed by Sam Yates
Browse files

move spiked detection to back end (#167)

Moves spike detection to the back end, which is required to have fast spike detection on the gpu.

Fixes #106.

Backend:
* Move spike detection into the backend.
* Add a `threshold_watcher` type to each backend that is initialized with a reference to the field that it is to watch, along with indexes and thresholds for each variable in the field that is being watched. This class presents a simple host-side interface:
   * `test(t)` tests for crossings at time `t`.
   *  `crossings()` returns all threshold crossings.
   * `clear_crossings()` resets (clears) the collected crossing events.
* Implement the multicore back end detector directly from the original code.
* Implement a `gpu_stack` for use with the gpu back end, that lets threads in a kernel conditionally push back into a flat array.

Miniapp:
* Run a single-step dummy run of model before starting the profiler, when profiling is enabled.
* Initialize the spike output callback functions _after_ the dummy run so that spikes from the dummy step are not output.

`cell_group`:
* Pass responsibility for spike detection to the lowered cells (`fvm_multicell`) and associated back ends.

`memory`:
* Add a new allocator for CUDA managed memory.
* Implement `managed_ptr` and `make_managed_ptr`, which are managed memory equivalents of `std::unique_ptr` and `std::make_unique_ptr`.

Tests:
* Improve host-side spike detection unit tests.
* Add device-side spike detection unit tests.
* Add unit tests for `gpu_stack`.

Building:
* Surpress CMP0023 CMake warning.
parent 216ae6ed
No related branches found
No related tags found
No related merge requests found
Showing
with 1032 additions and 270 deletions
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