Skip to content

Commit 83bd015

Browse files
committed
Fix test failure
1 parent 56c2466 commit 83bd015

File tree

1 file changed

+14
-21
lines changed

1 file changed

+14
-21
lines changed

sycl/test-e2e/KernelCompiler/kernel_compiler_cache_eviction.cpp

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
// RUN: %{build} -o %t.out
1818

1919
// -- Test again, with caching.
20-
// DEFINE: %{cache_vars} = env SYCL_CACHE_PERSISTENT=1 SYCL_CACHE_TRACE=7 SYCL_CACHE_DIR=%t/cache_dir SYCL_CACHE_MAX_SIZE=23000
20+
// DEFINE: %{cache_vars} = env SYCL_CACHE_PERSISTENT=1 SYCL_CACHE_TRACE=7 SYCL_CACHE_DIR=%t/cache_dir SYCL_CACHE_MAX_SIZE=27000
2121
// RUN: %if run-mode %{rm -rf %t/cache_dir%}
22-
// RUN: %{cache_vars} %{run} %t.out 2>&1 | FileCheck %s --check-prefix=CHECK
22+
// RUN: %{cache_vars} %{run-unfiltered-devices} %t.out 2>&1 | FileCheck %s --check-prefix=CHECK
2323

2424
// CHECK: [Persistent Cache]: enabled
2525

@@ -84,7 +84,8 @@ void test_build_and_run() {
8484

8585
// compilation with props and devices
8686
std::vector<std::string> flags{"-cl-fast-relaxed-math",
87-
"-cl-finite-math-only"};
87+
"-cl-finite-math-only", "-cl-no-signed-zeros",
88+
"-cl-unsafe-math-optimizations"};
8889

8990
// Device image #1
9091
// CHECK: [Persistent Cache]: Cache size file not present. Creating one.
@@ -96,29 +97,21 @@ void test_build_and_run() {
9697
// Device image #2
9798
// CHECK-NEXT: [kernel_compiler Persistent Cache]: binary has been cached: [[DEVIMG2:.*]]
9899
// CHECK-NEXT: [Persistent Cache]: Updating the cache size file.
99-
CreateAndVerifyKB(kbSrc, {flags[0]});
100-
101-
// Device image #3
102-
// CHECK: [kernel_compiler Persistent Cache]: binary has been cached: [[DEVIMG3:.*]]
103-
// CHECK: [Persistent Cache]: Updating the cache size file.
104-
CreateAndVerifyKB(kbSrc, {flags[1]});
100+
CreateAndVerifyKB(kbSrc, {flags[0], flags[1], flags[2], flags[3]});
105101

106102
// Re-insert device image #1
107-
// CHECK: [kernel_compiler Persistent Cache]: using cached binary: [[DEVIMG1]]
103+
// CHECK-NEXT: [kernel_compiler Persistent Cache]: using cached binary: [[DEVIMG1]]
108104
CreateAndVerifyKB(kbSrc, {});
109105

110-
// Device image #4
111-
// CHECK: [kernel_compiler Persistent Cache]: binary has been cached: [[DEVIMG4:.*]]
112-
// CHECK: [Persistent Cache]: Updating the cache size file.
106+
// Insert more unique device images to trigger cache eviction.
107+
// Make sure Device image #2 is evicted before device image #1 as
108+
// eviction is LRU-based.
113109
// CHECK: [Persistent Cache]: Cache eviction triggered.
114-
// CHECK: [Persistent Cache]: File removed: [[DEVIMG2]]
115-
// CHECK: [Persistent Cache]: File removed: [[DEVIMG3]]
116-
// CHECK: [Persistent Cache]: File removed: [[DEVIMG1]]
117-
CreateAndVerifyKB(kbSrc, {flags[0], flags[1]});
118-
119-
// Re-insert device image #4
120-
// CHECK: [kernel_compiler Persistent Cache]: using cached binary: [[DEVIMG4]]
121-
CreateAndVerifyKB(kbSrc, {flags[0], flags[1]});
110+
// CHECK-NEXT: [Persistent Cache]: File removed: [[DEVIMG2]]
111+
// CHECK-NEXT: [Persistent Cache]: File removed: [[DEVIMG1]]
112+
for (int i = 0; i < flags.size(); i++) {
113+
CreateAndVerifyKB(kbSrc, {flags[i]});
114+
}
122115
}
123116

124117
int main() {

0 commit comments

Comments
 (0)