-
Notifications
You must be signed in to change notification settings - Fork 57
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
Step 2 - Variable dimensions #598
Conversation
…s`` a ``std::optional<unsigned int>`` so ``VarAccess`` enum is only for API purposesand started inserting default access types at callsites
* Replace queries with VarAccessDim
* VarAccess is now a wrapper class around a std::variant holding NeuronVarAccess, SynapseVarAccess and std::monostate (for the defaults) * Mostly functional aside from custom updates
…Types`` to reflect all it now does
…s`` so correct defaults will be used
* Variables always have ``CustomUpdateVarAccess`` access type * ``getDims`` should be called on variable reference not directly on underlying variable
… rather than on Var
* moved resolution of variable dimensions into adaptor classes * used this in generic initialisation and runner code * tidied up variable size calculation in runner
…mode is set on variables/variable references in model but no variables with matching shape are referenced
* ELEMENT and BATCH dimensions * VarAccess and CustomUpdateVarAccess * Var and CustomUpdateVar
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## transpiler #598 +/- ##
==============================================
- Coverage 85.76% 79.66% -6.11%
==============================================
Files 99 4 -95
Lines 13525 954 -12571
==============================================
- Hits 11600 760 -10840
+ Misses 1925 194 -1731
☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving based on our general discussion of the aims and design decisions.
This is a bit of a boring internal one that was originally going to wider reaching but got de-scoped. Basically the
VarAccessDuplication
enumeration evolved a bit organically with GeNN 4 as I started adding reductions and custom updates and, in its previous form, didn't really make sense for custom update variables as the meaning of the various dimension flags can get ignored depending on what it's attached to.This PR replaces
VarAccessDuplication
with theVarAccessDim
bitfield enumeration specifying what dimensions variables have so e.g. 'normal' neuron or synapse variable now haveVarAccessDim::ELEMENT| VarAccessDim::BATCH
. However, specifying these at this level is really annoying and lots of permutations aren't valid in various locations. This PR redefinesVarAccess
in terms of valid combinations ofVarAccessMode
andVarAccessDim
and addsCustomUpdateVarAccess
which defines dimensions subtractively , starting with ORing together the dimensions of all the variables your custom update is referencing and then determine what shape each variable should be e.g. the standard custom update variable access isCustomUpdateVarAccess::READ_WRITE
which is defined asVarAccessMode::READ_WRITE
meaning it inherits the OR'd together dimensionality. However,CustomUpdateVarAccess::READ_ONLY_SHARED_ELEMENT
is defined asVarAccessMode::READ_ONLY | VarAccessDim::ELEMENT
meaning that it's dimensionality is the result of clearing theELEMENT
bit from the OR'd together dimensionality.