Skip to content
Snippets Groups Projects
Commit 31364699 authored by Xavier Routh's avatar Xavier Routh
Browse files

remove old files{

parent 0239901b
No related branches found
No related tags found
1 merge request!28Draft: Interpreter, Tests, Debug Info, Misc.
fn myfunc(x: i32) -> i32
y = call(add, x, x)
r = return(start, y)
fn add(x: i32, y: i32) -> i32
w = add(x, y)
r = return(start, w)
\ No newline at end of file
fn matmul<3>(a: array(i32, #0, #1), b: array(i32, #1, #2)) -> array(i32, #0, #2)
c = constant(array(i32, #0, #2), zero)
i_ctrl = fork(start, #0)
i_idx = thread_id(i_ctrl)
j_ctrl = fork(i_ctrl, #2)
j_idx = thread_id(j_ctrl)
k_ctrl = fork(j_ctrl, #1)
k_idx = thread_id(k_ctrl)
k_join_ctrl = join(k_ctrl)
j_join_ctrl = join(k_join_ctrl)
i_join_ctrl = join(j_join_ctrl)
r = return(i_join_ctrl, update_i_c)
zero = constant(i32, 0)
a_val = read(a, position(i_idx, k_idx))
b_val = read(b, position(k_idx, j_idx))
mul = mul(a_val, b_val)
add = add(mul, dot)
dot = reduce(k_join_ctrl, zero, add)
updated_c = write(update_j_c, dot, position(i_idx, j_idx))
update_j_c = reduce(j_join_ctrl, update_i_c, updated_c)
update_i_c = reduce(i_join_ctrl, c, update_j_c)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment