@@ -376,7 +376,6 @@ static void setupTool(ClangTool &Tool, const std::string &DPCPPRoot,
376376static 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 }
0 commit comments