[clang] [llvm] [Driver][SYCL] Add initial SYCL offload compilation support (PR #107493)

Tom Honermann via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 18 08:44:05 PST 2024


================
@@ -6774,16 +6775,20 @@ 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<"Enables SYCL kernels compilation for device">;
 def fno_sycl : Flag<["-"], "fno-sycl">,
-  Visibility<[ClangOption, CLOption]>,
-  Group<sycl_Group>, HelpText<"Disables SYCL kernels compilation for device">;
+  HelpText<"Disables SYCL kernels compilation for device">;
+def fsycl_device_only : Flag<["-"], "fsycl-device-only">,
+  Alias<offload_device_only>, HelpText<"Compile SYCL kernels for device only">;
+def fsycl_host_only : Flag<["-"], "fsycl-host-only">,
+  Alias<offload_host_only>, HelpText<"Compile SYCL kernels for host only">;
----------------
tahonermann wrote:

Similar to the above comment; "kernels" seems out of place here. There is also an interesting deviation from the equivalent option for CUDA:
```
def cuda_host_only : Flag<["--"], "cuda-host-only">, Alias<offload_host_only>,
  HelpText<"Compile CUDA code for host only. Has no effect on non-CUDA compilations.">;
```
SYCL should presumably follow suit here and add the "Has no effect on non-SYCL compilations." qualification (and the behavior of the option should presumably match).

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


More information about the cfe-commits mailing list