[clang] [llvm] [SYCL] Add offload wrapping for SYCL kind. (PR #147508)

Maksim Sabianin via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 26 10:03:07 PDT 2025


================
@@ -660,3 +1079,22 @@ Error offloading::wrapHIPBinary(Module &M, ArrayRef<char> Image,
                                EmitSurfacesAndTextures);
   return Error::success();
 }
+
+Error llvm::offloading::wrapSYCLBinaries(llvm::Module &M, ArrayRef<char> Buffer,
+                                         SYCLJITOptions Options) {
+  SYCLWrapper W(M, Options);
+  MemoryBufferRef MBR(StringRef(Buffer.begin(), Buffer.size()),
+                      /*Identifier*/ "");
+  SmallVector<OffloadFile> OffloadFiles;
+  if (Error E = extractOffloadBinaries(MBR, OffloadFiles))
+    return E;
+
+  GlobalVariable *Desc = W.createFatbinDesc(OffloadFiles);
+  if (!Desc)
+    return createStringError(inconvertibleErrorCode(),
+                             "No binary descriptors created.");
----------------
maksimsab wrote:

In fact, both options don't follow LLVM's guideline because we don't add any useful piece of information.

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


More information about the llvm-commits mailing list