Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/openaccel-lab/blob/main/workloads/gemm_nn/omega.om # openaccel-lab aien-dev/openaccel-lab Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `openaccel-lab / workloads / gemm_nn / omega.om` 43 lines ยท 758 bytes Raw Blame History 1 note gemm_nn: fo[i*N + j] = sum_p fa[i*K + p] * fb[p*N + j], f32 accumulation in p order 2 note one function per output element keeps each function within omc's 16 registers (error 12) 3 global dm ulong 3 4 fn gnn_el i ulong j ulong to f32 5 n = get dm 1 6 k = get dm 2 7 ar = mul i k 8 s = 0.0f32 9 for p ulong k 10 x = get fa add ar p 11 y = get fb add mul p n j 12 s = add s mul x y 13 end 14 ret s 15 end 16 fn kern to void 17 n = get dm 1 18 for i ulong get dm 0 19 for j ulong n 20 put fo add mul i n j gnn_el i j 21 end 22 end 23 end 24 fn main to int 25 oal_begin 26 put dm 0 ulong oal_p 0 27 put dm 1 ulong oal_p 1 28 put dm 2 ulong oal_p 2 29 a = oal_fa 0 30 b = oal_fb 1 31 w = oal_warm 32 for i ulong add w oal_reps 33 t0 = monons 34 kern 35 t1 = monons 36 if ge i w 37 oal_tick sub t1 t0 38 end 39 end 40 oal_so 0 mul get dm 0 get dm 1 41 oal_end 42 ret 0 43 end