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/omega-mv/blob/main/train/openaccel-lab/workloads/gemm_bias_relu/omega.om # omega-mv Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance. Brought by drakestapleton Sign in to star 1 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `omega-mv / train / openaccel-lab / workloads / gemm_bias_relu / omega.om` 45 lines ยท 812 bytes Raw Blame History 1 note gemm_bias_relu: fo[i*N + j] = max(sum_p fa[i*K + p] * fb[p*N + j] + fc[j], 0), f32 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 gbr_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 s = add s get fc j 15 ret fmax s 0.0f32 16 end 17 fn kern to void 18 n = get dm 1 19 for i ulong get dm 0 20 for j ulong n 21 put fo add mul i n j gbr_el i j 22 end 23 end 24 end 25 fn main to int 26 oal_begin 27 put dm 0 ulong oal_p 0 28 put dm 1 ulong oal_p 1 29 put dm 2 ulong oal_p 2 30 a = oal_fa 0 31 b = oal_fb 1 32 c = oal_fc 2 33 w = oal_warm 34 for i ulong add w oal_reps 35 t0 = monons 36 kern 37 t1 = monons 38 if ge i w 39 oal_tick sub t1 t0 40 end 41 end 42 oal_so 0 mul get dm 0 get dm 1 43 oal_end 44 ret 0 45 end