Skip to content

Significant update to Unit, Synapse variable access

Compare
Choose a tag to compare
@rcoreilly rcoreilly released this 12 Jul 06:17
  • Should not affect user code except a couple of cases in hip projects
  • Much simpler for extending types.
  • UnitVarIdx and SynVarIdx get index for variable
  • UnitVal1D and SynVal1D 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)