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

Sergey Semenov via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 14 06:43:37 PDT 2026


================
@@ -19,22 +19,57 @@
 
 #include <detail/device_binary_structures.hpp>
 
+#include <OffloadAPI.h>
+
+#include <map>
+
 _LIBSYCL_BEGIN_NAMESPACE_SYCL
 namespace detail {
 
-/// A wrapper of __sycl_tgt_device_image structure to help with its fields
-/// parsing, iteration over data and data transformation.
-class DeviceImageWrapper {
+class DeviceImageManager;
+
+/// A wrapper of liboffload program handle to manage its lifetime.
+class ProgramWrapper {
+public:
+  /// Constructs ProgramWrapper by creating liboffload program with the provided
+  /// arguments.
+  ///
+  /// \param Device is a device to use for program creation.
+  /// \param DevImage is a device image (wrapped __sycl_tgt_device_image) to use
+  /// for program creation.
+  /// \throw sycl::exception with sycl::errc::runtime when failed to create
+  /// program.
----------------
sergey-semenov wrote:

```suggestion
  /// Constructs ProgramWrapper by creating a liboffload program with the provided
  /// arguments.
  ///
  /// \param Device is the device to use for program creation.
  /// \param DevImage is the device image (wrapped __sycl_tgt_device_image) to use
  /// for program creation.
  /// \throw sycl::exception with sycl::errc::runtime when failed to create the
  /// program.
```

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


More information about the llvm-commits mailing list