Skip to content

Commit 1627f30

Browse files
authored
[SYCL][RTC] Make JIT-based pipeline the default for SYCL language (#17383)
Remove the invoke-based implementation and the temporary `source_language::sycl_jit` - the in-memory pipeline now handles `source_language::sycl`. --------- Signed-off-by: Julian Oppermann <[email protected]>
1 parent 61cb6d7 commit 1627f30

26 files changed

+119
-694
lines changed

sycl/include/sycl/kernel_bundle_enums.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ enum class source_language : int {
2525
spirv = 1,
2626
sycl = 2,
2727
/* cuda */
28-
sycl_jit = 99 /* temporary, alternative implementation for SYCL */
2928
};
3029

3130
// opencl versions

sycl/source/detail/kernel_bundle_impl.hpp

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ class kernel_bundle_impl {
377377
}
378378

379379
// oneapi_ext_kernel_compiler
380-
// program manager integration, only for sycl_jit language
380+
// program manager integration, only for sycl language
381381
kernel_bundle_impl(
382382
context Ctx, std::vector<device> Devs,
383383
const std::vector<kernel_id> &KernelIDs,
@@ -387,7 +387,7 @@ class kernel_bundle_impl {
387387
syclex::source_language Lang)
388388
: kernel_bundle_impl(std::move(Ctx), std::move(Devs), KernelIDs,
389389
bundle_state::executable) {
390-
assert(Lang == syclex::source_language::sycl_jit);
390+
assert(Lang == syclex::source_language::sycl);
391391
// Mark this bundle explicitly as "interop" to ensure that its kernels are
392392
// enqueued with the info from the kernel object passed by the application,
393393
// cf. `enqueueImpKernel` in `commands.cpp`. While runtime-compiled kernels
@@ -513,7 +513,7 @@ class kernel_bundle_impl {
513513
DeviceVec.push_back(Dev);
514514
}
515515

516-
if (MLanguage == syclex::source_language::sycl_jit) {
516+
if (MLanguage == syclex::source_language::sycl) {
517517
// Build device images via the program manager.
518518
const std::string &SourceStr = std::get<std::string>(MSource);
519519
std::ostringstream SourceExt;
@@ -536,7 +536,7 @@ class kernel_bundle_impl {
536536
SourceExt << ")]];\n";
537537
}
538538

539-
auto [Binaries, Prefix] = syclex::detail::SYCL_JIT_to_SPIRV(
539+
auto [Binaries, Prefix] = syclex::detail::SYCL_JIT_Compile(
540540
RegisteredKernelNames.empty() ? SourceStr : SourceExt.str(),
541541
MIncludePairs, BuildOptions, LogPtr);
542542

@@ -616,11 +616,6 @@ class kernel_bundle_impl {
616616
[](std::byte B) { return static_cast<uint8_t>(B); });
617617
return Result;
618618
}
619-
if (MLanguage == syclex::source_language::sycl) {
620-
return syclex::detail::SYCL_to_SPIRV(*SourceStrPtr, MIncludePairs,
621-
BuildOptions, LogPtr,
622-
RegisteredKernelNames);
623-
}
624619
throw sycl::exception(
625620
make_error_code(errc::invalid),
626621
"SYCL C++, OpenCL C and SPIR-V are the only supported "
@@ -686,16 +681,11 @@ class kernel_bundle_impl {
686681
}
687682

688683
std::string adjust_kernel_name(const std::string &Name) {
689-
if (MLanguage == syclex::source_language::sycl_jit) {
684+
if (MLanguage == syclex::source_language::sycl) {
690685
auto It = MMangledKernelNames.find(Name);
691686
return It == MMangledKernelNames.end() ? Name : It->second;
692687
}
693688

694-
if (MLanguage == syclex::source_language::sycl) {
695-
bool isMangled = Name.find("__sycl_kernel_") != std::string::npos;
696-
return isMangled ? Name : "__sycl_kernel_" + Name;
697-
}
698-
699689
return Name;
700690
}
701691

@@ -722,7 +712,7 @@ class kernel_bundle_impl {
722712
throw sycl::exception(make_error_code(errc::invalid),
723713
"kernel '" + Name + "' not found in kernel_bundle");
724714

725-
if (MLanguage == syclex::source_language::sycl_jit) {
715+
if (MLanguage == syclex::source_language::sycl) {
726716
auto &PM = ProgramManager::getInstance();
727717
auto KID = PM.getSYCLKernelID(MPrefix + AdjustedName);
728718

@@ -1010,7 +1000,7 @@ class kernel_bundle_impl {
10101000
try {
10111001
if (MDeviceBinaries) {
10121002
ProgramManager::getInstance().removeImages(MDeviceBinaries);
1013-
syclex::detail::SYCL_JIT_destroy(MDeviceBinaries);
1003+
syclex::detail::SYCL_JIT_Destroy(MDeviceBinaries);
10141004
}
10151005
} catch (std::exception &e) {
10161006
__SYCL_REPORT_EXCEPTION_TO_STREAM("exception in ~kernel_bundle_impl", e);

0 commit comments

Comments
 (0)