================
@@ -1510,6 +1512,20 @@ static void InitializePredefinedMacros(const TargetInfo 
&TI,
   // SYCL device compiler which doesn't produce host binary.
   if (LangOpts.SYCLIsDevice) {
     Builder.defineMacro("__SYCL_DEVICE_ONLY__", "1");
+    if (OffloadArch Arch = TI.getOffloadArch(); Arch.isIntelIGCA()) {
+      llvm::IntelGPU::IGCATarget IGCA = Arch.igcaTarget();
+
+      Builder.defineMacro("__OFFLOAD_ARCH_IGCA__", Twine(IGCA.getTarget()));
+      if (IGCA.isAnyCompute())
+        Builder.defineMacro("__OFFLOAD_ARCH_IGCA_COMPUTE__");
+      else if (IGCA.isAnyRender())
+        Builder.defineMacro("__OFFLOAD_ARCH_IGCA_RENDER__");
+
+      if (IGCA.isComputeExact())
+        Builder.defineMacro("__OFFLOAD_ARCH_IGCA_COMPUTE_EXACT__");
+      else if (IGCA.isRenderExact())
+        Builder.defineMacro("__OFFLOAD_ARCH_IGCA_RENDER_EXACT__");
----------------
tahonermann wrote:

Remove both cases of `else`. Though there are no current processors that 
provide both compute and render capabilities, future processors might.

https://github.com/llvm/llvm-project/pull/227877
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to