Skip to content

Commit d87ae44

Browse files
committed
Address review comments
1 parent 34dd515 commit d87ae44

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

sycl/test/Unit/lit.cfg.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,7 @@ def find_shlibpath_var():
7373
lit_config.warning("unable to inject shared library path on '{}'"
7474
.format(platform.system()))
7575

76+
config.environment['SYCL_CACHE_DIR'] = config.llvm_obj_root + "/sycl_cache"
7677
config.environment['SYCL_DEVICE_FILTER'] = lit_config.params.get('SYCL_PLUGIN', "opencl") + ",host"
7778
lit_config.note("Backend: {}".format(config.environment['SYCL_DEVICE_FILTER']))
79+
lit_config.note("SYCL cache directory: {}".format(config.environment['SYCL_CACHE_DIR']))

sycl/unittests/kernel-and-program/PersistentDeviceCodeCache.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ class PersistenDeviceCodeCache : public ::testing::Test {
8181
return _putenv_s(name, value);
8282
}
8383
#endif
84+
virtual void SetUp() {
85+
assert(getenv("SYCL_CACHE_DIR") && "Please set SYCL_CACHE_DIR environment "
86+
"variable pointing to cache location.");
87+
}
8488

8589
PersistenDeviceCodeCache() : Plt{default_selector()} {
8690

@@ -91,8 +95,6 @@ class PersistenDeviceCodeCache : public ::testing::Test {
9195
return;
9296
}
9397

94-
set_env("SYCL_CACHE_DIR", ".");
95-
9698
Mock = std::make_unique<unittest::PiMock>(Plt);
9799
Dev = Plt.get_devices()[0];
98100
Mock->redefine<detail::PiApiKind::piProgramGetInfo>(

0 commit comments

Comments
 (0)