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

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 24 19:26:41 PST 2024


================
@@ -780,6 +781,41 @@ Driver::OpenMPRuntimeKind Driver::getOpenMPRuntime(const ArgList &Args) const {
   return RT;
 }
 
+static const char *getDefaultSYCLArch(Compilation &C) {
+  // If -fsycl is supplied we will assume SPIR-V
+  if (C.getDefaultToolChain().getTriple().isArch32Bit())
+    return "spirv32";
+  return "spirv64";
+}
+
+static llvm::Triple getSYCLDeviceTriple(StringRef TargetArch) {
+  SmallVector<StringRef, 5> SYCLAlias = {"spir", "spir64", "spirv", "spirv32",
+                                         "spirv64"};
+  if (std::find(SYCLAlias.begin(), SYCLAlias.end(), TargetArch) !=
----------------
MaskRay wrote:

`llvm::is_contained({..., ...}, TargetArch)`

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


More information about the llvm-commits mailing list