Skip to content

Commit

Permalink
add timer package as copy of emergent one, to avoid circular dependen…
Browse files Browse the repository at this point in the history
…cy; update go.mod
  • Loading branch information
rcoreilly committed Apr 15, 2024
1 parent fa5c57c commit 93c70bc
Show file tree
Hide file tree
Showing 18 changed files with 5,371 additions and 18 deletions.
Binary file added examples/axon/axon
Binary file not shown.
14 changes: 4 additions & 10 deletions examples/axon/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import (

"cogentcore.org/core/math32"
"cogentcore.org/core/vgpu"
"github.com/emer/emergent/v2/timer"
"github.com/emer/gosl/v2/sltype"
"github.com/emer/gosl/v2/threading"
"github.com/emer/gosl/v2/timer"
)

// DiffTol is tolerance on testing diff between cpu and gpu values
Expand Down Expand Up @@ -114,7 +114,7 @@ func main() {
// fmt.Printf("%d\ttime.RandCtr: %v\n", cy, time.RandCtr.Uint2())
}

cpuTmr.Stop()
// cpuTmr.Stop()

time.Reset()

Expand Down Expand Up @@ -145,9 +145,6 @@ func main() {
// seti.ConfigValues(1) // one val per var
sy.Config() // configures vars, allocates vals, configs pipelines..

gpuFullTmr := timer.Time{}
gpuFullTmr.Start()

// this copy is pretty fast -- most of time is below
lvl, _ := layv.Values.ValueByIndexTry(0)
lvl.CopyFromBytes(unsafe.Pointer(&lays[0]))
Expand All @@ -158,9 +155,6 @@ func main() {
// ivl, _ := idxv.Values.ValueByIndexTry(0)
// ivl.CopyFromBytes(unsafe.Pointer(&idxs[0]))

// gpuFullTmr := timer.Time{}
// gpuFullTmr.Start()

sy.Mem.SyncToGPU()

vars.BindDynamicValueIndex(0, "Layers", 0)
Expand All @@ -171,8 +165,8 @@ func main() {
cmd := sy.ComputeCmdBuff()
sy.CmdResetBindVars(cmd, 0)

// gpuFullTmr := timer.Time{}
// gpuFullTmr.Start()
gpuFullTmr := timer.Time{}
gpuFullTmr.Start()

gpuTmr := timer.Time{}
gpuTmr.Start()
Expand Down
Loading

0 comments on commit 93c70bc

Please sign in to comment.