Significant update to Unit, Synapse variable access
- Should not affect user code except a couple of cases in hip projects
- Much simpler for extending types.
UnitVarIdx
andSynVarIdx
get index for variableUnitVal1D
andSynVal1D
is fast index access used by all routines -- these are only ones that need to be updated in subtypes.
Here's what the new code looks like in MemStats for examples/hip/hip.go
, line 706
:
actMi, _ := ecout.UnitVarIdx("ActM")
targi, _ := ecout.UnitVarIdx("Targ")
actQ1i, _ := ecout.UnitVarIdx("ActQ1")
for ni := 0; ni < nn; ni++ {
actm := ecout.UnitVal1D(actMi, ni)
trg := ecout.UnitVal1D(targi, ni) // full pattern target
inact := ecin.UnitVal1D(actQ1i, ni)