@@ -376,7 +376,6 @@ static void setupTool(ClangTool &Tool, const std::string &DPCPPRoot,
376
376
static void setGPUTarget (BinaryFormat Format,
377
377
SmallVector<std::string> &CommandLine) {
378
378
auto [CPU, _] = Translator::getTargetCPUAndFeatureAttrs (nullptr , " " , Format);
379
- CommandLine.push_back (" -fsycl" );
380
379
if (Format == BinaryFormat::PTX) {
381
380
CommandLine.push_back (" -fsycl-targets=nvptx64-nvidia-cuda" );
382
381
CommandLine.push_back (" -Xsycl-target-backend" );
@@ -603,9 +602,9 @@ Error jit_compiler::linkDeviceLibraries(llvm::Module &Module,
603
602
return createStringError (" Could not determine list of device libraries: %s" ,
604
603
BuildLog.c_str ());
605
604
}
606
- const bool IsGPUTarget =
605
+ const bool IsCudaHIP =
607
606
Format == BinaryFormat::PTX || Format == BinaryFormat::AMDGCN;
608
- if (IsGPUTarget ) {
607
+ if (IsCudaHIP ) {
609
608
// Based on the OS and the format decide on the version of libspirv.
610
609
// NOTE: this will be problematic if cross-compiling between OSes.
611
610
std::string Libclc{" clc/" };
@@ -638,7 +637,7 @@ Error jit_compiler::linkDeviceLibraries(llvm::Module &Module,
638
637
}
639
638
640
639
// For GPU targets we need to link against vendor provided libdevice.
641
- if (IsGPUTarget ) {
640
+ if (IsCudaHIP ) {
642
641
Triple T{Module.getTargetTriple ()};
643
642
Driver D{(Twine (DPCPPRoot) + " /bin/clang++" ).str (), T.getTriple (), Diags};
644
643
auto [CPU, _] =
@@ -680,10 +679,9 @@ Error jit_compiler::linkDeviceLibraries(llvm::Module &Module,
680
679
}
681
680
#endif
682
681
for (auto &LibDeviceFile : LibDeviceFiles) {
683
- auto Res = LinkInLib (LibDeviceFile);
684
682
// llvm::Error converts to false on success.
685
- if (Res ) {
686
- return Res ;
683
+ if (auto Error = LinkInLib (LibDeviceFile) ) {
684
+ return Error ;
687
685
}
688
686
}
689
687
}
0 commit comments