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

Bug in GPU addressing for arrays of products

parent f9302091
No related branches found
No related tags found
2 merge requests!186Rodinia,!160Fix GPU addressing bug
Pipeline #201546 failed
...@@ -1209,6 +1209,16 @@ dependencies = [ ...@@ -1209,6 +1209,16 @@ dependencies = [
"with_builtin_macros", "with_builtin_macros",
] ]
[[package]]
name = "juno_product_read"
version = "0.1.0"
dependencies = [
"async-std",
"hercules_rt",
"juno_build",
"with_builtin_macros",
]
[[package]] [[package]]
name = "juno_schedule_test" name = "juno_schedule_test"
version = "0.1.0" version = "0.1.0"
......
...@@ -33,4 +33,5 @@ members = [ ...@@ -33,4 +33,5 @@ members = [
"juno_samples/edge_detection", "juno_samples/edge_detection",
"juno_samples/fork_join_tests", "juno_samples/fork_join_tests",
"juno_samples/multi_device", "juno_samples/multi_device",
"juno_samples/product_read",
] ]
[package]
name = "juno_product_read"
version = "0.1.0"
authors = ["Aaron Councilman <aaronjc4@illinois.edu>"]
edition = "2021"
[[bin]]
name = "juno_product_read"
path = "src/main.rs"
[features]
cuda = ["juno_build/cuda", "hercules_rt/cuda"]
[build-dependencies]
juno_build = { path = "../../juno_build" }
[dependencies]
juno_build = { path = "../../juno_build" }
hercules_rt = { path = "../../hercules_rt" }
with_builtin_macros = "0.1.0"
async-std = "*"
use juno_build::JunoCompiler;
fn main() {
#[cfg(not(feature = "cuda"))]
{
JunoCompiler::new()
.file_in_src("product_read.jn")
.unwrap()
.build()
.unwrap();
}
#[cfg(feature = "cuda")]
{
JunoCompiler::new()
.file_in_src("product_read.jn")
.unwrap()
.schedule_in_src("gpu.sch")
.unwrap()
.build()
.unwrap();
}
}
gvn(*);
phi-elim(*);
dce(*);
let out = auto-outline(*);
gpu(out.product_read);
ip-sroa(*);
sroa(*);
crc(*);
dce(*);
gvn(*);
phi-elim(*);
dce(*);
infer-schedules(*);
float-collections(*);
gcm(*);
#![feature(concat_idents)]
use hercules_rt::{runner, HerculesImmBox, HerculesImmBoxTo, HerculesMutBox};
juno_build::juno!("product_read");
fn main() {
async_std::task::block_on(async {
let input = vec![(0, 1), (2, 3)];
let input : HerculesImmBox<(i32, i32)> = HerculesImmBox::from(input.as_slice());
let mut r = runner!(product_read);
let res : Vec<i32> = HerculesMutBox::from(r.run(input.to()).await).as_slice().to_vec();
assert_eq!(res, vec![0, 1, 2, 3]);
});
}
#[test]
fn products_test() {
main();
}
#[entry]
fn product_read(input: (i32, i32)[2]) -> i32[4] {
let result : i32[4];
result[0] = input[0].0;
result[1] = input[0].1;
result[2] = input[1].0;
result[3] = input[1].1;
return result;
}
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