File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
clang/lib/Driver/ToolChains Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -10947,6 +10947,21 @@ static void getNonTripleBasedSYCLPostLinkOpts(const ToolChain &TC,
1094710947
1094810948 if (allowDeviceImageDependencies (TCArgs))
1094910949 addArgs (PostLinkArgs, TCArgs, {" -allow-device-image-dependencies" });
10950+
10951+ SYCLInstallationDetector SYCLInstall (TC.getDriver ());
10952+ SmallVector<SmallString<128 >, 4 > SpvLocCandidates;
10953+ SmallString<128 > FallbackAssertName (" libsycl-fallback-cassert.spv" );
10954+ SYCLInstall.getSYCLDeviceLibPath (SpvLocCandidates, true );
10955+ for (const auto &SpvLoc : SpvLocCandidates) {
10956+ SmallString<128 > FullLibName (SpvLoc);
10957+ llvm::sys::path::append (FullLibName, FallbackAssertName);
10958+ if (llvm::sys::fs::exists (FullLibName)) {
10959+ SmallString<128 > SYCLDeviceLibDir (" --device-lib-dir=" );
10960+ SYCLDeviceLibDir += SpvLoc.str ();
10961+ addArgs (PostLinkArgs, TCArgs, {SYCLDeviceLibDir.str ()});
10962+ break ;
10963+ }
10964+ }
1095010965}
1095110966
1095210967// On Intel targets we don't need non-kernel functions as entry points,
You can’t perform that action at this time.
0 commit comments