Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix spikemonitor for subgroups #292

Merged
merged 6 commits into from
Jun 2, 2022
Merged

Conversation

denisalevi
Copy link
Member

@denisalevi denisalevi commented Jun 2, 2022

Fixes #286

This implementation is a quick solution that does the following when recording with SpikeMonitor from a Subgroup.

  • In Brian2CUDA, each NeuronGroup has its own spikespace, which is filled with the neuron IDs of spiking neurons. In cpp_standalone, this spiekspace is sorted by neuron IDs. In Brian2CUDA, it is not, which is why we can't just read a consecutive subsection of the spikespace, where all neuron IDs belong to one Subgroup.
  • Instead, this implementation calls thruds::count_if to get the number of spiking neurons in the Subgroup and then calls thrust::copy_if to copy those IDs into another array (spikespace for subgroup).
  • This means we can use the same spikemonitor kernel for NeuronGroup and Subgroup recordings, but passing a different spikepace pointer.

This implementation is surely not the most performant, but was instead easy to implement. I added #293 with suggestions for a better implementation.

@denisalevi denisalevi merged commit 9fc9049 into master Jun 2, 2022
@denisalevi denisalevi deleted the fix-spikemonitor-for-subgroups branch June 2, 2022 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix SpikeMonitor for Subgroups
1 participant