You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Our current implementation is explained in PR #292
This implementation uses thrust::count_if and then thrust::copy_if to create a spikespace for a subgroup. This is likely not very performant because we have to call two kernel. A custom implementation could do both at the same time in one kernel (the copy_if kernel has to know the count anyways I believe). So there are two optimization options here:
Write a custom kernel that basically does a copy_if and stores the number of spiking neurons in the subgroup. This would then still need a copy of that number to host.
Better option: For each subgroup with a SpikeMonitor, let the thresholder of the full NeuronGroup also generate a spikespace for the subgroup. This can happen in the same kernel and would avoid one kernel call. Should also be rather easy to implement. The spikemonitor template would then just have to copy over the number of spiking neurons in the subgroup, which should eventually be done once per timestep for all spikespaces (Copy all eventspace counters to host efficiently at each time step #282 ).
EDIT: Another optimization can be done for EventMonitors which don't record variables. Currently, we do all the thrust functions and call our kernel just to count the number of events (see commits in PR #294 ). We could instead get rid of count_if, copy_if and our kernel and instead call some thrust function that just counts the occurrence of each ID in the eventspace.
The text was updated successfully, but these errors were encountered:
Our current implementation is explained in PR #292
This implementation uses
thrust::count_if
and thenthrust::copy_if
to create a spikespace for a subgroup. This is likely not very performant because we have to call two kernel. A custom implementation could do both at the same time in one kernel (thecopy_if
kernel has to know the count anyways I believe). So there are two optimization options here:copy_if
and stores the number of spiking neurons in the subgroup. This would then still need a copy of that number to host.SpikeMonitor
, let thethresholder
of the fullNeuronGroup
also generate a spikespace for the subgroup. This can happen in the same kernel and would avoid one kernel call. Should also be rather easy to implement. The spikemonitor template would then just have to copy over the number of spiking neurons in the subgroup, which should eventually be done once per timestep for all spikespaces (Copy all eventspace counters to host efficiently at each time step #282 ).EDIT: Another optimization can be done for
EventMonitors
which don't record variables. Currently, we do all the thrust functions and call our kernel just to count the number of events (see commits in PR #294 ). We could instead get rid ofcount_if
,copy_if
and our kernel and instead call some thrust function that just counts the occurrence of each ID in the eventspace.The text was updated successfully, but these errors were encountered: