Skip to content
Snippets Groups Projects
Commit 6efa7b7a authored by Aaron Councilman's avatar Aaron Councilman
Browse files

Move Juno examples into juno_samples

parent 20cfd0b7
No related branches found
No related tags found
1 merge request!53Move Juno examples into juno_samples
fn matmul<n : usize, m : usize, l : usize>(a : f32[n, m], b : f32[m, l]) -> f32[n, l] {
let res : f32[n, l];
@outer for i = 0 to n {
@middle for j = 0 to l {
@inner for k = 0 to m {
res[i, j] += a[i, k] * b[k, j];
}
}
}
@exit return res;
}
fn simple3<n : usize>(a : i32[n], b : i32[n]) -> i32 {
let res : i32 = 0;
@loop
for i = 0 to n {
res += a[i] * b[i];
}
@exit
return res;
}
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
function matmul {
partition { @outer, @middle, @inner } on gpu
partition @exit on cpu
parallelize @outer
vectorize @inner
}
function simple3 {
partition @loop on cpu
partition @exit on cpu
vectorize @loop
}
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