Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When calculating the hashes used to merge groups together for initialization, usually all that we care about is the names and types of the state variables and how they are initialised but with SIMT backends where additional data structures are required for synapse dynamics/postsynaptic updates this is not enough. This fix simply includes whether weight update models include synapse dynamics and postsynaptic update code in the hash used to determine mergeability - this ignores the backend specific-details so will sometimes split initialization unnecessarily on CPU but fixes this (nasty) issue.
Furthermore, while trying to write a unit test to test this, I found a subtler issue that could also potentially cause issues. Essentially hashing an empty container (
std::vector
,std::string
etc) had no effect on the hash so the following code:generates the same hash as:
I've fixed this by hashing the size of the container before hashing the contents (which, one way or another, involves looping through the bytes of the contents). This PR fixes both issues.