@@ -5104,8 +5104,10 @@ class OffloadingActionBuilder final {
5104
5104
5105
5105
if (A->getOption ().matches (options::OPT_fsycl_targets_EQ)) {
5106
5106
// spir64 target is actually JIT compilation, so we defer selection of
5107
- // bfloat16 libraries to runtime. For AOT we need libraries.
5108
- needLibs = TC->getTriple ().getSubArch () != llvm::Triple::NoSubArch;
5107
+ // bfloat16 libraries to runtime. For AOT we need libraries, but skip
5108
+ // for Nvidia.
5109
+ needLibs = TC->getTriple ().getSubArch () != llvm::Triple::NoSubArch &&
5110
+ !TC->getTriple ().isNVPTX ();
5109
5111
TargetBE = GetTripleIt (A->getValue (0 ));
5110
5112
if (TargetBE)
5111
5113
TargetOpt = A->getValue (0 );
@@ -5167,9 +5169,9 @@ class OffloadingActionBuilder final {
5167
5169
// Currently, all SYCL device libraries will be linked by default. Linkage
5168
5170
// of "internal" libraries cannot be affected via -fno-sycl-device-lib.
5169
5171
llvm::StringMap<bool > devicelib_link_info = {
5170
- {" libc" , true }, {" libm-fp32" , true }, {" libm-fp64" , true },
5171
- {" libimf-fp32" , true }, {" libimf-fp64" , true }, {" libimf-bf16" , true },
5172
- {" internal" , true }};
5172
+ {" libc" , true }, {" libm-fp32" , true }, {" libm-fp64" , true },
5173
+ {" libimf-fp32" , true }, {" libimf-fp64" , true }, {" libimf-bf16" , true },
5174
+ {" libm-bfloat16 " , true }, { " internal" , true }};
5173
5175
if (Arg *A = Args.getLastArg (options::OPT_fsycl_device_lib_EQ,
5174
5176
options::OPT_fno_sycl_device_lib_EQ)) {
5175
5177
if (A->getValues ().size () == 0 )
0 commit comments