[clang] [llvm] Reland - [Driver][SYCL] Add initial SYCL offload compilation support … (PR #117268)

Tom Honermann via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 22 09:08:07 PST 2024


================
@@ -6782,16 +6783,21 @@ defm : FlangIgnoredDiagOpt<"frontend-loop-interchange">;
 defm : FlangIgnoredDiagOpt<"target-lifetime">;
 
 // C++ SYCL options
+let Group = sycl_Group in {
 def fsycl : Flag<["-"], "fsycl">,
-  Visibility<[ClangOption, CLOption]>,
-  Group<sycl_Group>, HelpText<"Enables SYCL kernels compilation for device">;
+  HelpText<"Enable SYCL C++ extensions">;
 def fno_sycl : Flag<["-"], "fno-sycl">,
-  Visibility<[ClangOption, CLOption]>,
-  Group<sycl_Group>, HelpText<"Disables SYCL kernels compilation for device">;
+  HelpText<"Disable SYCL C++ extensions">;
+def fsycl_device_only : Flag<["-"], "fsycl-device-only">,
+  Alias<offload_device_only>, HelpText<"Compile SYCL code for device only">;
+def fsycl_host_only : Flag<["-"], "fsycl-host-only">,
+  Alias<offload_host_only>, HelpText<"Compile SYCL code for host only. Has no "
+  "effect on non-SYCL compilations">;
 def sycl_link : Flag<["--"], "sycl-link">, Flags<[HelpHidden]>,
-  Visibility<[ClangOption, CLOption]>,
-  Group<sycl_Group>, HelpText<"Perform link through clang-sycl-linker via the target "
+  HelpText<"Perform link through clang-sycl-linker via the target "
   "offloading toolchain.">;
+} // let Group = sycl_Group
+
----------------
tahonermann wrote:

Is it expected that SYCL compilation will work with the `clang-cl` driver? Or perhaps that is left for future work? Perhaps add the following (Perhaps also for `--sycl-link`; I'm not sure on that one given that the help is currently hidden)?
```
def _SLASH_fsycl : CLFlag<"fsycl">, Alias<fsycl>;
def _SLASH_fno_sycl : CLFlag<"fno-sycl">, Alias<fno_sycl>;
def _SLASH_fsycl_device_only : CLFlag<"fsycl-device-only">,
  Alias<fsycl_device_only>;
def _SLASH_fsycl_host_only : CLFlag<"fsycl-host-only">,
  Alias<fsycl_host_only>;
```

https://github.com/llvm/llvm-project/pull/117268


More information about the llvm-commits mailing list