Skip to content

Conversation

jinge90
Copy link
Contributor

@jinge90 jinge90 commented Oct 11, 2025

--[no-]offloadlib option is used by rocm and cuda toolchain to enable/disable device libraries in linking phase for device code. It makes sense to re-use this option in sycl for similar purpose and since clang driver support sycl in CL compatibility mode as well, we also need to enable this option in CL compatibility mode.

@llvmbot llvmbot added the clang Clang issues not falling into any other category label Oct 11, 2025
@jinge90 jinge90 requested a review from bader October 11, 2025 06:54
@llvmbot
Copy link
Member

llvmbot commented Oct 11, 2025

@llvm/pr-subscribers-clang-driver

@llvm/pr-subscribers-clang

Author: None (jinge90)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/162980.diff

1 Files Affected:

  • (modified) clang/include/clang/Driver/Options.td (+3-3)
diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td
index ec38231f906eb..4479aadf6949b 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -5970,10 +5970,10 @@ def : Flag<["-"], "nocudainc">, Alias<no_offload_inc>;
 def no_offloadlib
     : Flag<["--"], "no-offloadlib">,
       MarshallingInfoFlag<LangOpts<"NoGPULib">>,
-      Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>,
-      HelpText<"Do not link device library for CUDA/HIP device compilation">;
+      Visibility<[ClangOption, CC1Option, CLOption, FlangOption, FC1Option]>,
+      HelpText<"Do not link device library for CUDA/HIP/SYCL device compilation">;
 def offloadlib : Flag<["--"], "offloadlib">,
-                 Visibility<[ClangOption, CC1Option, FlangOption, FC1Option]>,
+                 Visibility<[ClangOption, CC1Option, CLOption, FlangOption, FC1Option]>,
                  HelpText<"Link device libraries for GPU device compilation">;
 def : Flag<["-"], "nogpulib">,
       Alias<no_offloadlib>,

Copy link
Contributor

@bader bader left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jinge90, I don't think the title accurately describes what the patch does.

I see that you enabled --[no-]offloadlib flags for MSVC compatible driver. The only SYCL related change is the help message. Did you intend to put more changes in this PR?

Please, add a test for using --[no-]offloadlib in CL compatibility mode.

@srividya-sundaram
Copy link

Please update the PR description to provide essential context and details about the changes proposed in this PR. Thanks!

@llvmbot llvmbot added the clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' label Oct 15, 2025
@jinge90 jinge90 changed the title Enable offloadlib option in compilation for SYCL Enable offloadlib option in SYCL and CL mode Oct 15, 2025
@jinge90
Copy link
Contributor Author

jinge90 commented Oct 15, 2025

@jinge90, I don't think the title accurately describes what the patch does.

I see that you enabled --[no-]offloadlib flags for MSVC compatible driver. The only SYCL related change is the help message. Did you intend to put more changes in this PR?

Please, add a test for using --[no-]offloadlib in CL compatibility mode.

Hi, @bader
I don't have more changes in this PR. The sycl toolchain can be invoked via CL compatibility mode in driver, so I enable this option in CL compatibility mode.

Thanks very much.

@jinge90
Copy link
Contributor Author

jinge90 commented Oct 15, 2025

Please update the PR description to provide essential context and details about the changes proposed in this PR. Thanks!

Hi, @srividya-sundaram
Description is added.
Thanks very much.

@bader
Copy link
Contributor

bader commented Oct 15, 2025

I don't have more changes in this PR. The sycl toolchain can be invoked via CL compatibility mode in driver, so I enable this option in CL compatibility mode.

If I get it right, --[no-]offloadlib option can be used in SYCL even w/o this patch, so the title is misleading. The change has no functional changes for SYCL. Please, remove SYCL and add tags to the PR title. E.g. [Clang][Driver] Enable offloadlib option for clang-cl.

--[no-]offloadlib option is used by rocm and cuda toolchain to enable/disable device libraries in linking phase for device code. It makes sense to re-use this option in sycl for similar purpose and since clang driver support sycl in CL compatibility mode as well, we also need to enable this option in CL compatibility mode.

Please, capitalize SYCL in the description: sycl -> SYCL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' clang Clang issues not falling into any other category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants