Skip to content

Commit 8844e20

Browse files
committed
last minute clean up
1 parent 194b518 commit 8844e20

File tree

4 files changed

+10
-12
lines changed

4 files changed

+10
-12
lines changed

sycl/source/detail/kernel_bundle_impl.hpp

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -397,15 +397,6 @@ class kernel_bundle_impl {
397397
return SS.str();
398398
}
399399

400-
// TODO: remove duplication in kernel_compiler_sycl.cpp.
401-
std::string userArgsAsString(const std::vector<std::string> &UserArguments) {
402-
return std::accumulate(UserArguments.begin(), UserArguments.end(),
403-
std::string(""),
404-
[](const std::string &A, const std::string &B) {
405-
return A.empty() ? B : A + " " + B;
406-
});
407-
}
408-
409400
bool
410401
extKernelCompilerFetchFromCache(const std::vector<device> Devices,
411402
const std::vector<std::string> &BuildOptions,
@@ -415,7 +406,7 @@ class kernel_bundle_impl {
415406
ContextImplPtr ContextImpl = getSyclObjImpl(MContext);
416407
const PluginPtr &Plugin = ContextImpl->getPlugin();
417408

418-
std::string UserArgs = userArgsAsString(BuildOptions);
409+
std::string UserArgs = syclex::detail::userArgsAsString(BuildOptions);
419410
auto BinProg = PersistentDeviceCodeCache::getCompiledKernelFromDisc(
420411
Devices[0], UserArgs, SourceStr);
421412
if (!BinProg.empty()) {
@@ -509,7 +500,6 @@ class kernel_bundle_impl {
509500
"languages at this time");
510501
}();
511502

512-
// CP ur_program_handle_t UrProgram = nullptr;
513503
Plugin->call<UrApiKind::urProgramCreateWithIL>(
514504
ContextImpl->getHandleRef(), spirv.data(), spirv.size(), nullptr,
515505
&UrProgram);
@@ -559,7 +549,8 @@ class kernel_bundle_impl {
559549
// If caching enabled and kernel not fetched from cache, cache.
560550
if (PersistentDeviceCodeCache::isEnabled() && !FetchedFromCache) {
561551
PersistentDeviceCodeCache::putCompiledKernelToDisc(
562-
Devices[0], userArgsAsString(BuildOptions), SourceStr, UrProgram);
552+
Devices[0], syclex::detail::userArgsAsString(BuildOptions), SourceStr,
553+
UrProgram);
563554
}
564555

565556
return std::make_shared<kernel_bundle_impl>(MContext, MDevices, DevImg,

sycl/source/detail/kernel_compiler/kernel_compiler_sycl.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ SYCL_to_SPIRV(const std::string &Source, include_pairs_t IncludePairs,
3131

3232
bool SYCL_Compilation_Available();
3333

34+
std::string userArgsAsString(const std::vector<std::string> &UserArguments);
35+
3436
} // namespace detail
3537
} // namespace ext::oneapi::experimental
3638

sycl/test-e2e/KernelCompiler/kernel_compiler_opencl.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@
1111

1212
// The leak check env var is set even if it might be ignored by some backends.
1313

14+
// -- Test the kernel_compiler with OpenCL source.
1415
// RUN: %{build} -o %t.out
1516
// RUN: env UR_L0_LEAKS_DEBUG=1 %{run} %t.out
1617

18+
// -- Test again, with caching.
1719
// DEFINE: %{cache_vars} = env UR_L0_LEAKS_DEBUG=1 env SYCL_CACHE_PERSISTENT=1 SYCL_CACHE_TRACE=1 SYCL_CACHE_DIR=%t/cache_dir
1820
// RUN: rm -rf %t/cache_dir
1921
// RUN: %{cache_vars} %t.out 2>&1 | FileCheck %s --check-prefixes=CHECK-WRITTEN-TO-CACHE

sycl/test-e2e/KernelCompiler/kernel_compiler_sycl.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,14 @@
1111

1212
// The leak check env var is set even if it might be ignored by some backends.
1313

14+
// -- Test the kernel_compiler with SYCL source.
1415
// RUN: %{build} -o %t.out
1516
// RUN: env UR_L0_LEAKS_DEBUG=1 %{run} %t.out
1617

18+
// -- Test again, with caching.
1719
// 'reading-from-cache' is just a string we pass to differentiate between the
1820
// two runs.
21+
1922
// DEFINE: %{cache_vars} = env UR_L0_LEAKS_DEBUG=1 env SYCL_CACHE_PERSISTENT=1 SYCL_CACHE_TRACE=1 SYCL_CACHE_DIR=%t/cache_dir
2023
// RUN: rm -rf %t/cache_dir
2124
// RUN: %{cache_vars} %t.out 2>&1 | FileCheck %s --check-prefixes=CHECK-WRITTEN-TO-CACHE

0 commit comments

Comments
 (0)