Skip to content
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

Goal: Go augmented language #1229

Closed
wants to merge 402 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
402 commits
Select commit Hold shift + click to select a range
86dbc6e
more runtime safety in range statement, re vars as idents
rcoreilly Sep 28, 2024
c5a5c0f
table
rcoreilly Sep 28, 2024
7feda22
table
rcoreilly Sep 28, 2024
36fd707
start on math datafs interface -- special limited command set for mat…
rcoreilly Sep 28, 2024
e273917
datafs integration with goal first pass working, planets example runs…
rcoreilly Sep 28, 2024
09c64b0
properly parses newaxis and ellipsis in reslice syntax
rcoreilly Sep 28, 2024
5f6c7f1
fix tensor tests with new output and renames
rcoreilly Sep 28, 2024
04084f4
fix extra goal/math_test
rcoreilly Sep 28, 2024
71e2445
add get and set aliases for datafs Get and Set, and add datafs docs t…
rcoreilly Sep 28, 2024
04a7224
add test for # # wrapping -- works. all good for now!
rcoreilly Sep 28, 2024
132514f
fix FloatFromValues -> Float64FromValues
rcoreilly Sep 30, 2024
786fde1
properly promote float types in binary expressions -- if either side …
rcoreilly Sep 30, 2024
5d61953
scalar values don't print shape.
rcoreilly Sep 30, 2024
5afcaf6
change default tensor format to %g, %s
rcoreilly Sep 30, 2024
a42f5c0
tmath.Div division operator always produces floating point, per python
rcoreilly Sep 30, 2024
07689b9
tensor print fix
rcoreilly Sep 30, 2024
d60a50d
add pi constant
rcoreilly Sep 30, 2024
c393a8e
start on vector package with basic vector functions: Inner, Sum, Dot,…
rcoreilly Sep 30, 2024
1b21ad1
vector: improved docs and tests
rcoreilly Sep 30, 2024
8a20759
remove debug print in sprintf and change params order with format fir…
rcoreilly Sep 30, 2024
b79ca78
fix += etc
rcoreilly Sep 30, 2024
d498db9
define always does a type conversion to tensor.Tensor so all variable…
rcoreilly Sep 30, 2024
263b262
rename vector.Inner -> vector.Mul
rcoreilly Sep 30, 2024
0c8d146
use consistent NormL1 and NormL2 throughout the stats, metric, vector…
rcoreilly Sep 30, 2024
45e35a2
Actually L1Norm and L2Norm are clearer -- use those throughout.
rcoreilly Sep 30, 2024
6d4d98c
Merge branch 'main' into goal
rcoreilly Sep 30, 2024
186fc34
matrix multiplication fully working -- need @ wrapper
rcoreilly Oct 1, 2024
ead8293
@ operator for matrix multiplication
rcoreilly Oct 1, 2024
9c7ab28
determinant functions
rcoreilly Oct 1, 2024
e3242bf
multidimensional array literals processed correctly
rcoreilly Oct 1, 2024
aac3037
readme update
rcoreilly Oct 1, 2024
bb9ec09
collapse extra dimension for vector @ matrix
rcoreilly Oct 1, 2024
b7427a3
matrix: annoying Tri indexing functions all working -- hard to get th…
rcoreilly Oct 1, 2024
1862a6c
all the triangle, diagonal, trace functions in matrix
rcoreilly Oct 2, 2024
fea4f00
move gosl into goal, and initial plans for GPU mode -- seems pretty good
rcoreilly Oct 2, 2024
2ea1375
reorganize gosl code with everything in parse, using cli config, leav…
rcoreilly Oct 3, 2024
d801343
gosl major reorganization for package based processing
rcoreilly Oct 3, 2024
3726761
rename parse -> gotosl
rcoreilly Oct 3, 2024
d8a6f55
document process, cleanup names -- basic translation phase good; now …
rcoreilly Oct 3, 2024
e9b5c4e
extracting args and kernels
rcoreilly Oct 3, 2024
2a36add
generating kernel code
rcoreilly Oct 3, 2024
7603f84
kernel gen working
rcoreilly Oct 4, 2024
92fb26d
add genkernel file!
rcoreilly Oct 4, 2024
3e33b22
gpu code generation mostly working; read sync not working due to miss…
rcoreilly Oct 4, 2024
fdb620f
gpu: major update to arrayn variable creation: actual array size is d…
rcoreilly Oct 4, 2024
62c272f
fix incorrect imports. type prefixing and add & to recv arg for metho…
rcoreilly Oct 4, 2024
1f916d5
break up Run and Done commands to allow sequencing.
rcoreilly Oct 4, 2024
a7b0e5a
actually parse read-only flag and use in generated code
rcoreilly Oct 4, 2024
cbd7d4d
start on auto-processing of global var exprs with tmp vars. one very …
rcoreilly Oct 5, 2024
0b3deae
calling functions with global vars now automatically creates tmp vars…
rcoreilly Oct 5, 2024
157954b
complete working mockup of how to do tensors in gosl. added Header of…
rcoreilly Oct 5, 2024
18a80d2
generating correct gosl.go code and parsing various tensor properties.
rcoreilly Oct 6, 2024
a28cb78
gosl tensor translation full working
rcoreilly Oct 6, 2024
e7f0783
rand updated to new gosl code
rcoreilly Oct 6, 2024
9109105
add wgsl
rcoreilly Oct 6, 2024
03ca327
move gosl back up to main gosl dir -- don't need other things in gosl…
rcoreilly Oct 6, 2024
f8e6083
matrix.Inverse function, and return errors instead of panic in matrix…
rcoreilly Oct 6, 2024
6891c5e
gotosl test now working with new paradigm
rcoreilly Oct 6, 2024
90c1ff5
updated docs for gosl and GPU
rcoreilly Oct 6, 2024
b1eb7d2
tensor n-dim indexing in goal mode; translates to Value, Set* functions
rcoreilly Oct 7, 2024
e176319
split out yaegicore into nogui and gui components, goal only includes…
rcoreilly Oct 7, 2024
d520baa
goal build runs gosl and go build
rcoreilly Oct 7, 2024
293bb2c
verbose fixes etc
rcoreilly Oct 7, 2024
087225c
goal: fix parsing of Go assignment expressions, including now getting…
rcoreilly Oct 7, 2024
562463c
core.Filename is alias for fs.Filename
rcoreilly Oct 7, 2024
fb30eee
fix goal build final code composition -- generate code first then wra…
rcoreilly Oct 7, 2024
636a2d6
get the scripts functionality and helper functions from numbers/datab…
rcoreilly Oct 7, 2024
6e81601
fileinfo detects generated files using standard Go regex, and filetre…
rcoreilly Oct 7, 2024
73e8663
use go format.Source on generated full goal build files (but not impo…
rcoreilly Oct 8, 2024
35825cc
textedtitor readonly uses SurfaceContainer (not Low) background for r…
rcoreilly Oct 8, 2024
a7ed4e8
exclude generated files from search results in filetree
rcoreilly Oct 8, 2024
a978019
moved PCA (EigSym) over to matrix, along with SVD, where they belong..
rcoreilly Oct 8, 2024
972bb9f
use parallel threading for N>2 dim matrix ops which are very expensiv…
rcoreilly Oct 8, 2024
2dd807b
wrap ndim index exprs in int() so they always work
rcoreilly Oct 8, 2024
83fbb1b
gosl: remove int() wrapper for tensor indexing calls
rcoreilly Oct 8, 2024
732b831
use %.10g for default tensor sprintf format -- removes tiny residual …
rcoreilly Oct 8, 2024
980319f
add bool Value, Set functions
rcoreilly Oct 8, 2024
052427e
goal: key fix to decl parsing -- only if brack and paren depth 0
rcoreilly Oct 8, 2024
48b5e43
N-dimensional indexing uses recursive go parsing.
rcoreilly Oct 9, 2024
49a9941
fix comment handling
rcoreilly Oct 9, 2024
e223197
fix comment handling for real, good tests
rcoreilly Oct 9, 2024
9d3db3e
gosl: support tensor pointers for global vars
rcoreilly Oct 9, 2024
2cdc6b8
base/generate and enumgen were filtering out generated files, which e…
rcoreilly Oct 9, 2024
35497ec
goal: dec is same as inc
rcoreilly Oct 9, 2024
9a7d941
gosl & goal have better error reporting and gosl inserts //line comme…
rcoreilly Oct 10, 2024
684904f
gosl: auto Get* functions for global vars, that GPU re-interprets, to…
rcoreilly Oct 11, 2024
69f246b
use gosl imports -- works great!
rcoreilly Oct 11, 2024
3fa7bc0
key bugfix: was not removing imported package prefixes
rcoreilly Oct 11, 2024
5f84974
must do vars file first to get vars; still not quite working for pl.I…
rcoreilly Oct 11, 2024
f7e1ea1
gosl tensor handles SetAdd etc properly.
rcoreilly Oct 12, 2024
2e82b9f
get type of Get* temp vars, looking up in type package scope.
rcoreilly Oct 12, 2024
9b2bbb5
start on atomic -- needs atomic type -- will require some infra for t…
rcoreilly Oct 12, 2024
2ebb515
major reorganization to generate only those functions that are used i…
rcoreilly Oct 13, 2024
b96d530
fix tmpvar name for Get -> Set
rcoreilly Oct 13, 2024
6a9a4d6
add package.function calls for callgraph -- fixes FastExp
rcoreilly Oct 14, 2024
00be93f
get path type for Get temp vars
rcoreilly Oct 14, 2024
c9c5807
set global var from temp _before_ final return statement
rcoreilly Oct 14, 2024
95082fd
prevent redundant include, fix tests and exampels.
rcoreilly Oct 14, 2024
9711018
important fix for enumgen, typegen: exclude enumgen.go, typegen.go fi…
rcoreilly Oct 17, 2024
ecf906c
in process logic for commands / builtins to be able to do pipe output…
rcoreilly Oct 25, 2024
215e3df
pipe working for builtin but not commands -- args fixed -- unclear wh…
rcoreilly Oct 25, 2024
7ceb537
Set builtin automatically does home path expansion and dedupe, as doe…
rcoreilly Oct 25, 2024
433561d
goal: a bit more robustness for crashing but still not dealing with s…
rcoreilly Oct 25, 2024
d10c186
goal: & of tensor -> ValuePtr -- needed for atomic exprs
rcoreilly Oct 31, 2024
e02a82b
full atomic support in place
rcoreilly Oct 31, 2024
2b46ead
goal: add atomic test case and const slice test case, and rename atom…
rcoreilly Nov 1, 2024
cd0f474
add Editable to texteditor context menu when in read only mode
rcoreilly Nov 1, 2024
1fbfb70
gosl properly handles global array vars as consts.
rcoreilly Nov 1, 2024
afc747f
gosl: enumgen exports the N const with //gosl:start, end wrapper -- n…
rcoreilly Nov 1, 2024
8a57518
gosl: for range expr translation
rcoreilly Nov 2, 2024
ded4517
GPUInit is safe to multiple calls; README docs updates
rcoreilly Nov 4, 2024
1de1aee
Merge branch 'main' into goal
rcoreilly Nov 4, 2024
ab2169d
Merge branch 'main' into goal
rcoreilly Nov 5, 2024
febe06c
plot styler implementation -- seems reasonable
rcoreilly Nov 6, 2024
fd42b32
plots: new functions don't return err so direct Add works
rcoreilly Nov 6, 2024
844be5a
plots: gearing up to test goal api for plotting using planets data
rcoreilly Nov 6, 2024
a2f6978
ploteditor styling functions
rcoreilly Nov 6, 2024
5167ef5
updated datafs-sim example with stat funcs that do everything in one …
rcoreilly Nov 6, 2024
462bfdf
first pass on new unified style, only for plots for now; got rid of s…
rcoreilly Nov 7, 2024
9974fe1
XY is the common Plotter type for Line and Scatter, just sets Line vs…
rcoreilly Nov 7, 2024
1ecc504
plot styles mostly in place and working -- need styler logic etc.
rcoreilly Nov 7, 2024
967e939
new styling plan in place for how to combine plot and element level s…
rcoreilly Nov 7, 2024
75e27b8
plot: all styling in place, elements updated, plots replicating. next…
rcoreilly Nov 8, 2024
003f149
plot styling fully working including range; imagex/testing now saves …
rcoreilly Nov 8, 2024
b95d503
new plot data framework all in place and building, but tests are failing
rcoreilly Nov 9, 2024
c00873f
use Data type for map, much simpler call signature
rcoreilly Nov 9, 2024
8c171b0
plot.Data is the map, Valuer is the value interface -- use plot.Data{…
rcoreilly Nov 9, 2024
1bdcd3d
fix Xaxis style scaling
rcoreilly Nov 9, 2024
d028ce7
checklengths
rcoreilly Nov 9, 2024
71150b9
rest of register functions
rcoreilly Nov 9, 2024
90536d6
fix xerr
rcoreilly Nov 9, 2024
43c3157
update README
rcoreilly Nov 11, 2024
780dd78
styler metadata; metadata has Metadataer interface for grabing from a…
rcoreilly Nov 11, 2024
58000e0
tensor-attached plot stylers example, tests etc.
rcoreilly Nov 11, 2024
3c88bf9
plot: start on table based plotting -- not working
rcoreilly Nov 11, 2024
c293888
table plot working for each plot type; fix label plotting; fix minmax…
rcoreilly Nov 12, 2024
f75d485
error bars use Y range properly, and range more generally; Low is opt…
rcoreilly Nov 12, 2024
a725107
fix inverted scale -> needs underlying scale
rcoreilly Nov 12, 2024
45890e0
ploteditor taking shape -- just need a reflectx copy named fields fun…
rcoreilly Nov 12, 2024
22c985b
ploteditor: CopyFields is working to set changed values, but color co…
rcoreilly Nov 12, 2024
ee023f4
reflectx image pointer copying now working properly -- CopyFields nee…
rcoreilly Nov 13, 2024
915f134
ploteditor default styling reasonable
rcoreilly Nov 13, 2024
b4b8278
overall plot styling working
rcoreilly Nov 13, 2024
f3bd93c
set columns buttons working; style switches with line color
rcoreilly Nov 13, 2024
05fc348
global x axis and auto legend
rcoreilly Nov 13, 2024
bc7464d
plot table: tricky logic for automatic X axis label working
rcoreilly Nov 13, 2024
a2d67fd
readme
rcoreilly Nov 13, 2024
4bded0c
bar plot striding logic; increase default nticks; cleanup old code
rcoreilly Nov 13, 2024
4531b30
panzoom post-processing -- better than before. also has shift = x, al…
rcoreilly Nov 13, 2024
de3e5e1
plot highlighting for kai
rcoreilly Nov 13, 2024
3e62411
tensor: only support one set of Row access methods, always taking cel…
rcoreilly Nov 14, 2024
d25dbd2
sim stats working much better: need loop phase input
rcoreilly Nov 14, 2024
90d672f
add AppendRowFloat, Int, String -- much cleaner for those cases
rcoreilly Nov 14, 2024
79dc4c5
better names and cleanup of datafs-sim
rcoreilly Nov 14, 2024
9c32594
add readme
rcoreilly Nov 14, 2024
fa11baa
core.tree and filetree: major update: Root is exported and is type Tr…
rcoreilly Nov 14, 2024
702d792
rest of fix for #1232 -- call update on tree when first ext is added.
rcoreilly Nov 14, 2024
fc1706a
yaegicore update and further browser plans
rcoreilly Nov 14, 2024
c18519b
databrowser separated, Basic pulled out
rcoreilly Nov 15, 2024
06d5c43
fix goal parsing of static initializer Field: expressions. databrowse…
rcoreilly Nov 15, 2024
5f34201
goal: some crash protections
rcoreilly Nov 15, 2024
28961a6
goal: plotting is robust to nil and plot update function in databrows…
rcoreilly Nov 16, 2024
7487521
key fix to databrowser tabs logic: target item is last widget in tab …
rcoreilly Nov 16, 2024
a82e893
gosl runs CPU functions using threaded calls
rcoreilly Nov 16, 2024
8d540d5
plot: fix hover to actually report data instead of pixels!
rcoreilly Nov 16, 2024
4a7f491
core.Tabs also needs a Tabber interface to get parent Tabs when it co…
rcoreilly Nov 16, 2024
648ad6f
goal: select tab by name in db Tabber
rcoreilly Nov 16, 2024
5456f8b
goal: negative indexing in basic 1D tensor case -- todo: need to add …
rcoreilly Nov 16, 2024
8c113ab
more tab api
rcoreilly Nov 17, 2024
ad313ea
only support global metadata.Name / SetName interface
rcoreilly Nov 17, 2024
538b1d7
merge with main
rcoreilly Nov 17, 2024
ab7b603
goal: fix tests, add File and Filename to metadata
rcoreilly Nov 18, 2024
03addeb
goal: key fixes to tensor.Rows Set*1D methods: return after indexes =…
rcoreilly Nov 18, 2024
6a5bd8a
goal: exec/TestStdIO out is pipe is true
rcoreilly Nov 18, 2024
859ab42
remove core prefix from Tabber
rcoreilly Nov 18, 2024
c2fe534
fix precision to use new metadata funcs
rcoreilly Nov 18, 2024
9750b0f
rename datafs -> tensorfs
rcoreilly Nov 19, 2024
f3bf82a
enumgen has -gosl option for generating gosl comments
rcoreilly Nov 19, 2024
c182389
more datafs renames in databrowser
rcoreilly Nov 19, 2024
2faafaa
major cleanup of tensorfs: rename Data -> Node, reduce API, add READM…
rcoreilly Nov 19, 2024
2163667
fix randx dists_test
rcoreilly Nov 19, 2024
1c21d3f
gpu Release encoders before Finish -- needed for newer wgpu; ToGPU is…
rcoreilly Nov 21, 2024
fca60e4
gosl: use consistent order of generated kernels, systems
rcoreilly Nov 21, 2024
7c7e55c
gosl: GPURelease is robust to no gpu, multiple calls.
rcoreilly Nov 22, 2024
691afa8
goal: tensor printing format and projection2d logic vastly improved -…
rcoreilly Nov 23, 2024
d081797
goal: test updates to new print format
rcoreilly Nov 23, 2024
7cb6c3d
goal: yaegicore update
rcoreilly Nov 23, 2024
6b98fa3
goal: tensorfs DirFromTable sets dir tensors from a table
rcoreilly Nov 23, 2024
34e47b2
cli: if only one command is passed to cli.Run, it is set as root
rcoreilly Nov 23, 2024
b598836
Merge commit 'a31766c9f42558d7cc1df19022a7be53861dfc0a' into goal
rcoreilly Nov 25, 2024
35cd77e
merge with main
rcoreilly Nov 25, 2024
29e40fa
update to reflectx.AnyIsNil -> IsNil
rcoreilly Nov 25, 2024
fa7d3b1
Merge commit 'dd5006304' into goal
rcoreilly Nov 26, 2024
fdb597e
Merge branch 'screens' into goal
rcoreilly Nov 26, 2024
2054450
Merge branch 'screens' into goal
rcoreilly Nov 26, 2024
63789c6
Merge branch 'menufocus' into goal
rcoreilly Nov 26, 2024
98ca16f
Merge branch 'screens' into goal
rcoreilly Nov 27, 2024
d1dc169
goal: add type-specific shortcuts to tensorfs
rcoreilly Nov 28, 2024
ce7b842
Merge branch 'screens' into goal
rcoreilly Nov 28, 2024
cbf6dff
update fullscreen flag in UpdateFullscreen
rcoreilly Nov 28, 2024
1a4013c
initial fullscreen sets size properly in scene etc
rcoreilly Nov 28, 2024
edb1359
tensorfs.CurRoot and databrowser.CurTabber for ad-hoc data plotting etc.
rcoreilly Dec 1, 2024
066d53d
reflectx SetFieldsFromMap and FieldAtPath -- from emer.params -- usef…
rcoreilly Dec 1, 2024
247cc8b
move SetFields to structs -- just one func.
rcoreilly Dec 1, 2024
9a7dbbe
tensor: major improvement in stats, metric speed -- 5x to 7x -- inter…
rcoreilly Dec 2, 2024
804fab4
don't do Scene shortcut updating in offscreen platform
rcoreilly Dec 2, 2024
73abe3c
goal: changes to enable core run web to build and run (also need patc…
rcoreilly Dec 3, 2024
b462156
goal: tensorfs handles multi-dir paths in RecycleDir
rcoreilly Dec 3, 2024
d603d83
gosl: major update to use separate TensorStrides variable that is aut…
rcoreilly Dec 3, 2024
7876e13
gosl: finished major update to use separate TensorStrides variable.
rcoreilly Dec 3, 2024
748b871
return GPUDevice in TheApp -- might need for compute to get GUI GPU.
rcoreilly Dec 4, 2024
a91b998
gosl: many fixes: docs include size, slrand and type include only if …
rcoreilly Dec 4, 2024
6a67f7e
gosl: couldn't get rand import conditionality to work in axon.
rcoreilly Dec 4, 2024
75608cf
gosl: fixed rand import on demand
rcoreilly Dec 4, 2024
2c84228
gosl: readme fixes
rcoreilly Dec 4, 2024
6ae279f
gpu/compute example updated with gui and timing cases for diagnosing …
rcoreilly Dec 5, 2024
ca1deae
gosl: add notes about installing naga and tint for gosl.
rcoreilly Dec 5, 2024
31b4441
gpu adapter name fixes
rcoreilly Dec 5, 2024
6d0170d
merge screens into goal
rcoreilly Dec 5, 2024
69b6a19
AppearanceSettings Screens is now read-only and improved comment docs…
rcoreilly Dec 5, 2024
0a49e9e
Merge commit 'd0111a0c522027cbcac4e54b527f857b288db251' into goal
rcoreilly Dec 6, 2024
0de2ad5
Merge branch 'screens' into goal
rcoreilly Dec 7, 2024
2b8fa3e
Merge branch 'screens' into goal
rcoreilly Dec 7, 2024
ba6c108
reminder about issue 1362 in device code
rcoreilly Dec 7, 2024
224cb66
critical fix for gpu compute device Max limits -- must be properly me…
rcoreilly Dec 7, 2024
3bbd50b
compute workgroup indexing logic in place, all good
rcoreilly Dec 8, 2024
bde99e3
gosl: update gosl to use new indexing logic
rcoreilly Dec 8, 2024
fd57490
merge main (screens) into goal
rcoreilly Dec 9, 2024
de6b16e
add table.Table Init() method for fields.
rcoreilly Dec 9, 2024
36e2633
fix for #1365 in goal branch -- added test, confirmed working
rcoreilly Dec 9, 2024
a38e70a
fix pointer-to-pointer logic to pass test
rcoreilly Dec 9, 2024
85b39f0
modernize tensor grid style with stylers and meta data etc, just like…
rcoreilly Dec 10, 2024
7d08e35
generate
rcoreilly Dec 10, 2024
5df1032
minmax.clipvalue -> clampvalue
rcoreilly Dec 10, 2024
c1d2fa3
goal: various plot / table / tensor api updates
rcoreilly Dec 11, 2024
e79b5d6
fixed major issues with plot stylers -- was accumulating more and mor…
rcoreilly Dec 11, 2024
5748481
plot: actually saving the mods and style with metadata is exactly the…
rcoreilly Dec 11, 2024
c9a1396
key fix for ploteditor: have to put the closure inside AddAt -- thoug…
rcoreilly Dec 12, 2024
ae821fb
partial fix for form layout
rcoreilly Dec 15, 2024
a07f8ef
merge main into goal
rcoreilly Dec 15, 2024
08bdda7
events does a focusClear just before sending Click event if current f…
rcoreilly Dec 15, 2024
9c835ab
Merge branch 'main' into goal
rcoreilly Dec 16, 2024
80c6bef
key fix to tensorfs for RecycleDir with paths
rcoreilly Dec 16, 2024
b09ad07
core tool buildDesktop detects presence of a cmd directory and builds…
rcoreilly Dec 18, 2024
c0c3867
glm: indexes may be nil.
rcoreilly Dec 19, 2024
9fd59c9
tensorfs: RecycleDir -> Dir -- simplify to one api call and make it s…
rcoreilly Dec 19, 2024
740dc0f
ploteditor shows tooltip including docs from tensor, and tensorfs Dir…
rcoreilly Dec 19, 2024
3665412
stats: add First / Final stats
rcoreilly Dec 21, 2024
4641252
partial fix for crashing on shouldDisplay, and test case showing sizi…
rcoreilly Dec 21, 2024
e92ae92
fix for #1387: bounding boxes must be based on alloc, not actual, for…
rcoreilly Dec 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
gosl: remove int() wrapper for tensor indexing calls
  • Loading branch information
rcoreilly committed Oct 8, 2024
commit 83fbb1bbed2bb48d44450c571b34989cd5817d06
10 changes: 6 additions & 4 deletions goal/gosl/examples/basic/compute.go

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

7 changes: 7 additions & 0 deletions goal/gosl/gotosl/nodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -1680,6 +1680,13 @@ func (p *printer) tensorMethod(x *ast.CallExpr, vr *Var, methName string) {
for i := stArg; i < n; i++ {
ag := args[i]
p.print("u32", token.LPAREN)
if ce, ok := ag.(*ast.CallExpr); ok { // get rid of int() wrapper from goal n-dim index
if fn, ok := ce.Fun.(*ast.Ident); ok {
if fn.Name == "int" {
ag = ce.Args[0]
}
}
}
p.expr(ag)
p.print(token.RPAREN)
if i < n-1 {
Expand Down
Loading