compile changes if stream changes (#1644)

This commit is contained in:
Awni Hannun
2024-12-03 14:37:44 -08:00
committed by GitHub
parent 9d40e521d7
commit e047fd977d
4 changed files with 24 additions and 14 deletions

View File

@@ -719,3 +719,14 @@ TEST_CASE("test compile strides") {
CHECK_EQ(out.strides().size(), 3);
}
}
TEST_CASE("test compile change streams") {
auto cfun = compile(simple_fun);
auto out = cfun({array(1.0f), array(2.0f)})[0];
CHECK_EQ(out.primitive().stream(), default_stream(default_device()));
auto s = new_stream(default_device());
StreamContext sctx(s);
out = cfun({array(1.0f), array(2.0f)})[0];
CHECK_EQ(out.primitive().stream(), s);
}