Skip to content

Commit fb321eb

Browse files
committed
PR feedback
1 parent 904cb13 commit fb321eb

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

sycl-jit/jit-compiler/lib/rtc/DeviceCompilation.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,6 @@ static void setupTool(ClangTool &Tool, const std::string &DPCPPRoot,
376376
static void setGPUTarget(BinaryFormat Format,
377377
SmallVector<std::string> &CommandLine) {
378378
auto [CPU, _] = Translator::getTargetCPUAndFeatureAttrs(nullptr, "", Format);
379-
CommandLine.push_back("-fsycl");
380379
if (Format == BinaryFormat::PTX) {
381380
CommandLine.push_back("-fsycl-targets=nvptx64-nvidia-cuda");
382381
CommandLine.push_back("-Xsycl-target-backend");
@@ -603,9 +602,9 @@ Error jit_compiler::linkDeviceLibraries(llvm::Module &Module,
603602
return createStringError("Could not determine list of device libraries: %s",
604603
BuildLog.c_str());
605604
}
606-
const bool IsGPUTarget =
605+
const bool IsCudaHIP =
607606
Format == BinaryFormat::PTX || Format == BinaryFormat::AMDGCN;
608-
if (IsGPUTarget) {
607+
if (IsCudaHIP) {
609608
// Based on the OS and the format decide on the version of libspirv.
610609
// NOTE: this will be problematic if cross-compiling between OSes.
611610
std::string Libclc{"clc/"};
@@ -638,7 +637,7 @@ Error jit_compiler::linkDeviceLibraries(llvm::Module &Module,
638637
}
639638

640639
// For GPU targets we need to link against vendor provided libdevice.
641-
if (IsGPUTarget) {
640+
if (IsCudaHIP) {
642641
Triple T{Module.getTargetTriple()};
643642
Driver D{(Twine(DPCPPRoot) + "/bin/clang++").str(), T.getTriple(), Diags};
644643
auto [CPU, _] =
@@ -680,10 +679,9 @@ Error jit_compiler::linkDeviceLibraries(llvm::Module &Module,
680679
}
681680
#endif
682681
for (auto &LibDeviceFile : LibDeviceFiles) {
683-
auto Res = LinkInLib(LibDeviceFile);
684682
// llvm::Error converts to false on success.
685-
if (Res) {
686-
return Res;
683+
if (auto Error = LinkInLib(LibDeviceFile)) {
684+
return Error;
687685
}
688686
}
689687
}

sycl/source/detail/device_image_impl.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -705,8 +705,8 @@ class device_image_impl {
705705
return ::jit_compiler::BinaryFormat::AMDGCN;
706706
default:
707707
throw sycl::exception(
708-
sycl::make_error_code(sycl::errc::feature_not_supported),
709-
"Backend unsupported by kernel fusion");
708+
sycl::make_error_code(sycl::errc::invalid),
709+
"Backend does not support kernel_compiler extension");
710710
}
711711
}
712712

sycl/test-e2e/KernelCompiler/sycl_imf.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//==--- sycl.cpp --- kernel_compiler extension imf tests -------------------==//
1+
//==--- sycl_imf.cpp --- kernel_compiler extension imf tests ---------------==//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
@@ -37,6 +37,7 @@ void imf_kernel(float *ptr) {
3737

3838
int main() {
3939
#ifdef SYCL_EXT_ONEAPI_KERNEL_COMPILER
40+
sycl::queue q;
4041
namespace syclex = sycl::ext::oneapi::experimental;
4142
using source_kb = sycl::kernel_bundle<sycl::bundle_state::ext_oneapi_source>;
4243
using exe_kb = sycl::kernel_bundle<sycl::bundle_state::executable>;

0 commit comments

Comments
 (0)