Closed mstimberg closed 6 years ago
I also sneaked in an additional change to this branch: as @denisalevi predicted in https://github.com/brian-team/brian2genn/issues/64#issuecomment-417723712 , the removal of the lastupdate
variable made certain models in Brian2GeNN not work anymore. The reason is that the previous code initialized GeNN's sparse data structure together with the conversion of the first synaptic variable. This wasn't a problem as long as lastupdate
existed, because it meant that every synapse had at least one synaptic variable. Now, simple models of the Synapses(source, target, '', on_pre='v+=1')
do not have any synaptic variables anymore and therefore the conversion was never called. My commit fixes this by separating the initialization and the synapse conversion.
Sounds very reasonable - thank you.
Thanks for the feedback, I'll merge this right away to avoid the hour-long wait for the tests to run through. There are still other changes in the pipeline...
To be consistent with Brian2's semantics for division etc. (and to not fail the new tests), we have to apply the same changes for
_brian_mod
,_brian_floordiv
and_timestep
.