[llvm-branch-commits] [llvm] [libsycl] Add liboffload kernel creation (PR #188794)

Kseniya Tikhomirova via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Mar 30 08:12:44 PDT 2026


================
@@ -18,6 +18,20 @@
 _LIBSYCL_BEGIN_NAMESPACE_SYCL
 namespace detail {
 
+ProgramWrapper::ProgramWrapper(ol_device_handle_t Device,
+                               DeviceImageWrapper &DevImage) {
+  assert(Device);
+
+  callAndThrow(olCreateProgram, Device, DevImage.getRawData().ImageStart,
+               DevImage.getSize(), &MProgram);
+}
+
+ProgramWrapper::~ProgramWrapper() {
+  assert(MProgram);
+  std::ignore = olDestroyProgram(MProgram);
----------------
KseniyaTikhomirova wrote:

why? ctor has callAndThrow, ProgramWrapper instance can't exist without MProgram.

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


More information about the llvm-branch-commits mailing list