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

New product test that fails

parent 70027610
No related branches found
No related tags found
1 merge request!168Reuse product
Pipeline #201589 failed
This commit is part of merge request !168. Comments created here will be created in the context of that merge request.
...@@ -1210,7 +1210,7 @@ dependencies = [ ...@@ -1210,7 +1210,7 @@ dependencies = [
] ]
[[package]] [[package]]
name = "juno_product_read" name = "juno_products"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"async-std", "async-std",
......
...@@ -33,5 +33,5 @@ members = [ ...@@ -33,5 +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", "juno_samples/products",
] ]
[package] [package]
name = "juno_product_read" name = "juno_products"
version = "0.1.0" version = "0.1.0"
authors = ["Aaron Councilman <aaronjc4@illinois.edu>"] authors = ["Aaron Councilman <aaronjc4@illinois.edu>"]
edition = "2021" edition = "2021"
[[bin]] [[bin]]
name = "juno_product_read" name = "juno_products"
path = "src/main.rs" path = "src/main.rs"
[features] [features]
......
...@@ -4,7 +4,7 @@ fn main() { ...@@ -4,7 +4,7 @@ fn main() {
#[cfg(not(feature = "cuda"))] #[cfg(not(feature = "cuda"))]
{ {
JunoCompiler::new() JunoCompiler::new()
.file_in_src("product_read.jn") .file_in_src("products.jn")
.unwrap() .unwrap()
.build() .build()
.unwrap(); .unwrap();
...@@ -12,7 +12,7 @@ fn main() { ...@@ -12,7 +12,7 @@ fn main() {
#[cfg(feature = "cuda")] #[cfg(feature = "cuda")]
{ {
JunoCompiler::new() JunoCompiler::new()
.file_in_src("product_read.jn") .file_in_src("products.jn")
.unwrap() .unwrap()
.schedule_in_src("gpu.sch") .schedule_in_src("gpu.sch")
.unwrap() .unwrap()
......
File moved
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
use hercules_rt::{runner, HerculesImmBox, HerculesImmBoxTo, HerculesMutBox}; use hercules_rt::{runner, HerculesImmBox, HerculesImmBoxTo, HerculesMutBox};
juno_build::juno!("product_read"); juno_build::juno!("products");
fn main() { fn main() {
async_std::task::block_on(async { async_std::task::block_on(async {
...@@ -11,6 +11,11 @@ fn main() { ...@@ -11,6 +11,11 @@ fn main() {
let mut r = runner!(product_read); let mut r = runner!(product_read);
let res : Vec<i32> = HerculesMutBox::from(r.run(input.to()).await).as_slice().to_vec(); let res : Vec<i32> = HerculesMutBox::from(r.run(input.to()).await).as_slice().to_vec();
assert_eq!(res, vec![0, 1, 2, 3]); assert_eq!(res, vec![0, 1, 2, 3]);
// Technically this returns a product of two i32s, but we can interpret that as an array
let mut r = runner!(product_return);
let res : Vec<i32> = HerculesMutBox::from(r.run(42, 17).await).as_slice().to_vec();
assert_eq!(res, vec![42, 17]);
}); });
} }
......
...@@ -7,3 +7,8 @@ fn product_read(input: (i32, i32)[2]) -> i32[4] { ...@@ -7,3 +7,8 @@ fn product_read(input: (i32, i32)[2]) -> i32[4] {
result[3] = input[1].1; result[3] = input[1].1;
return result; return result;
} }
#[entry]
fn product_return(x: i32, y: i32) -> (i32, i32) {
return (x, y);
}
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