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

remove small cudaMemcpys (#175)

This patch removes the many small `cudaMemcpy` calls for single values, except for those from calling `net_receive` in event delivery.

The small copies during initialization were from when the upper diagonal and time invariant component of the diagonal were computed on the host. There were many small reads/writes to device memory accessing the `p` and `u` vectors.

* Remove many small device copies in matrix setup by copying required data to host, computing, and then copying back in one copy.
* Add `constexpr` test `is_debug_mode()` for having been compiled in debug mode (tests `NDEBUG`).
* Only perform `is_physical_solution` test if `is_debug_mode()` is true. (The `is_physical_solution` test triggers a single copy from device to host on each time step to test whether the voltage has exceeded some "reasonable" physical bounds.)
parent 0e0bcd8f
No related branches found
No related tags found
No related merge requests found
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