Skip to content

Commit 5d9e997

Browse files
cperkinsintelKornevNikita
authored andcommitted
[SYCL] fix for cache tests interacting with multi tile devices (#18126)
cache eviction might occur earlier than test expects on multi-tile systems. Solution is to use a context of just one device.
1 parent f17e034 commit 5d9e997

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

sycl/test-e2e/KernelCompiler/sycl_cache.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,12 @@ int test_persistent_cache() {
5151
using source_kb = sycl::kernel_bundle<sycl::bundle_state::ext_oneapi_source>;
5252
using exe_kb = sycl::kernel_bundle<sycl::bundle_state::executable>;
5353

54-
sycl::queue q;
55-
sycl::context ctx = q.get_context();
54+
// This test uses a very small cache eviction threshold,
55+
// so we make a queue with a context of exactly one device
56+
// not "all devices" like the default context might have.
57+
sycl::device d;
58+
sycl::context ctx{d};
59+
sycl::queue q{ctx, d};
5660

5761
bool ok =
5862
q.get_device().ext_oneapi_can_compile(syclex::source_language::sycl);

0 commit comments

Comments
 (0)