Skip to content

Commit

Permalink
most shaders now compiling, need to update PathGBuf indexing
Browse files Browse the repository at this point in the history
  • Loading branch information
rcoreilly committed Nov 2, 2024
1 parent e2a614f commit 19685db
Show file tree
Hide file tree
Showing 19 changed files with 215 additions and 197 deletions.
2 changes: 1 addition & 1 deletion axon/act-path.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion axon/act-path.goal
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func (sc *SynComParams) ReadIndex(rnIndex, di uint32, cycTot int32, nRecvNeurs,
// For encoding, bake this into scale factor in SendSpike, and
// cast the result to int32.
func (sc *SynComParams) FloatToIntFactor() float32 {
return float32(1 << 24) // leaves 7 bits = 128 to cover any extreme cases
return float32(uint32(1) << 24) // leaves 7 bits = 128 to cover any extreme cases
// this is sufficient to pass existing tests at std tolerances.
}

Expand Down
6 changes: 2 additions & 4 deletions axon/act.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions axon/act.goal
Original file line number Diff line number Diff line change
Expand Up @@ -945,7 +945,6 @@ func (ac *ActParams) DecayState(ctx *Context, ni, di uint32, decay, glong, ahp f
Neurons[GModRaw, ni, di] = 0
Neurons[GModSyn, ni, di] = 0
Neurons[GMaintRaw, ni, di] = 0
Neurons[SSGi, ni, di] = 0
Neurons[SSGiDend, ni, di] = 0
Neurons[GeExt, ni, di] = 0

Expand Down Expand Up @@ -1025,7 +1024,6 @@ func (ac *ActParams) InitActs(ctx *Context, ni, di uint32) {
Neurons[GMaintRaw, ni, di] = 0
Neurons[GMaintSyn, ni, di] = 0

Neurons[SSGi, ni, di] = 0
Neurons[SSGiDend, ni, di] = 0

Neurons[Burst, ni, di] = 0
Expand Down Expand Up @@ -1169,7 +1167,7 @@ func (ac *ActParams) GSkCaFromCa(ctx *Context, ni, di uint32) {
// GeFromSyn integrates Ge excitatory conductance from GeSyn.
// geExt is extra conductance to add to the final Ge value
func (ac *ActParams) GeFromSyn(ctx *Context, ni, di uint32, geSyn, geExt float32) {
Neurons[GeExt, ni, di] = 0
Neurons[GeExt, ni, di] = 0.0
geS := geSyn
geE := geExt
if ac.Clamp.Add.IsTrue() && NrnHasFlag(ni, di, NeuronHasExt) {
Expand All @@ -1185,7 +1183,7 @@ func (ac *ActParams) GeFromSyn(ctx *Context, ni, di uint32, geSyn, geExt float32

Neurons[Ge, ni, di] = geS + geE
if Neurons[Ge, ni, di] < 0.0 {
Neurons[Ge, ni, di] = 0
Neurons[Ge, ni, di] = 0.0
}
ac.AddGeNoise(ctx, ni, di)
}
Expand Down
94 changes: 89 additions & 5 deletions axon/enumgen.go

Large diffs are not rendered by default.

42 changes: 21 additions & 21 deletions axon/inhib.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 21 additions & 21 deletions axon/inhib.goal
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ func PoolInhib(fb *fsfffb.GiParams, pi, di uint32, gimult float32) {
Pools[fsfffb.SSf, pi, di] = ssf
Pools[fsfffb.SSi, pi, di] = ssi

Pools[fsfffb.Gi, pi, di] = PoolInhibGiFromFSSS(pi, di) + fb.FFPrv*Pools[fsfffb.FFAvgPrv, pi, di]
Pools[fsfffb.TotalGi, pi, di] = PoolInhibGiFromFSSS(pi, di) + fb.FFPrv*Pools[fsfffb.FFAvgPrv, pi, di]
PoolInhibSaveOrig(pi, di)
}

Expand All @@ -153,9 +153,9 @@ func PoolInhibInit(pi, di uint32) {

// PoolInhibInitRaw clears raw spike counters -- done every cycle prior to accumulating
func PoolInhibInitRaw(pi, di uint32) {
Pools[fsfffb.FFsRaw, pi, di] = 0
Pools[fsfffb.FBsRaw, pi, di] = 0
Pools[fsfffb.GeExtRaw, pi, di] = 0
Pools[fsfffb.FFsRaw, pi, di] = 0.0
Pools[fsfffb.FBsRaw, pi, di] = 0.0
Pools[fsfffb.GeExtRaw, pi, di] = 0.0

PoolsInt[FFsRawInt, pi, di] = 0
PoolsInt[FBsRawInt, pi, di] = 0
Expand All @@ -164,19 +164,19 @@ func PoolInhibInitRaw(pi, di uint32) {

// PoolInhibZero resets all accumulating inhibition factors to 0
func PoolInhibZero(pi, di uint32) {
Pools[fsfffb.FFs, pi, di] = 0
Pools[fsfffb.FBs, pi, di] = 0
Pools[fsfffb.GeExts, pi, di] = 0
Pools[fsfffb.FSi, pi, di] = 0
Pools[fsfffb.SSi, pi, di] = 0
Pools[fsfffb.SSf, pi, di] = 0
Pools[fsfffb.FSGi, pi, di] = 0
Pools[fsfffb.SSGi, pi, di] = 0
Pools[fsfffb.Gi, pi, di] = 0
Pools[fsfffb.FFAvg, pi, di] = 0
Pools[fsfffb.FFAvgPrv, pi, di] = 0
Pools[fsfffb.GiOrig, pi, di] = 0
Pools[fsfffb.LayGi, pi, di] = 0
Pools[fsfffb.FFs, pi, di] = 0.0
Pools[fsfffb.FBs, pi, di] = 0.0
Pools[fsfffb.GeExts, pi, di] = 0.0
Pools[fsfffb.FSi, pi, di] = 0.0
Pools[fsfffb.SSi, pi, di] = 0.0
Pools[fsfffb.SSf, pi, di] = 0.0
Pools[fsfffb.FSGi, pi, di] = 0.0
Pools[fsfffb.SSGi, pi, di] = 0.0
Pools[fsfffb.TotalGi, pi, di] = 0.0
Pools[fsfffb.FFAvg, pi, di] = 0.0
Pools[fsfffb.FFAvgPrv, pi, di] = 0.0
Pools[fsfffb.GiOrig, pi, di] = 0.0
Pools[fsfffb.LayGi, pi, di] = 0.0
PoolsInt[Clamped, pi, di] = 0
}

Expand All @@ -192,7 +192,7 @@ func PoolInhibDecay(pi, di uint32, decay float32) {
Pools[fsfffb.SSf, pi, di] -= decay * Pools[fsfffb.SSf, pi, di]
Pools[fsfffb.FSGi, pi, di] -= decay * Pools[fsfffb.FSGi, pi, di]
Pools[fsfffb.SSGi, pi, di] -= decay * Pools[fsfffb.SSGi, pi, di]
Pools[fsfffb.Gi, pi, di] -= decay * Pools[fsfffb.Gi, pi, di]
Pools[fsfffb.TotalGi, pi, di] -= decay * Pools[fsfffb.TotalGi, pi, di]
Pools[fsfffb.FFAvg, pi, di] -= decay * Pools[fsfffb.FFAvg, pi, di]
}

Expand All @@ -207,7 +207,7 @@ func PoolInhibSpikesFromRaw(pi, di uint32) {

// SaveOrig saves the current Gi values as original values
func PoolInhibSaveOrig(pi, di uint32) {
Pools[fsfffb.GiOrig, pi, di] = Pools[fsfffb.Gi, pi, di]
Pools[fsfffb.GiOrig, pi, di] = Pools[fsfffb.TotalGi, pi, di]
}

// GiFromFSSS returns the sum of FSGi and SSGi as overall inhibition
Expand All @@ -219,13 +219,13 @@ func PoolInhibGiFromFSSS(pi, di uint32) float32 {
// with resulting value being the Max of either
func PoolInhibLayerMax(pi, di uint32, liGi float32) {
Pools[fsfffb.LayGi, pi, di] = liGi
Pools[fsfffb.Gi, pi, di] = math32.Max(Pools[fsfffb.Gi, pi, di], liGi)
Pools[fsfffb.TotalGi, pi, di] = math32.Max(Pools[fsfffb.TotalGi, pi, di], liGi)
}

// PoolMax updates given layer-level inhib values from given pool-level
// with resulting value being the Max of either
func PoolInhibPoolMax(pi, di uint32, piGi float32) {
Pools[fsfffb.Gi, pi, di] = math32.Max(Pools[fsfffb.Gi, pi, di], piGi)
Pools[fsfffb.TotalGi, pi, di] = math32.Max(Pools[fsfffb.TotalGi, pi, di], piGi)
}

//////// atomic int safe accumulation
Expand Down
Loading

0 comments on commit 19685db

Please sign in to comment.