|
37 | 37 | #include <utility> // for move |
38 | 38 | #include <variant> // for hash |
39 | 39 | #include <vector> // for vector |
| 40 | +#include <span> // for span |
40 | 41 |
|
41 | 42 | namespace sycl { |
42 | 43 | inline namespace _V1 { |
@@ -117,6 +118,12 @@ class __SYCL_EXPORT device_image_plain { |
117 | 118 | protected: |
118 | 119 | detail::DeviceImageImplPtr impl; |
119 | 120 |
|
| 121 | + backend get_backend() const; |
| 122 | + |
| 123 | + const std::byte *get_BinaryStart() const; |
| 124 | + |
| 125 | + const std::byte *get_BinaryEnd() const; |
| 126 | + |
120 | 127 | template <class Obj> |
121 | 128 | friend const decltype(Obj::impl) & |
122 | 129 | detail::getSyclObjImpl(const Obj &SyclObject); |
@@ -145,6 +152,26 @@ class device_image : public detail::device_image_plain, |
145 | 152 | return device_image_plain::has_kernel(KernelID, Dev); |
146 | 153 | } |
147 | 154 |
|
| 155 | + backend ext_oneapi_get_backend() const noexcept { |
| 156 | + return device_image_plain::get_backend(); |
| 157 | + } |
| 158 | + |
| 159 | + template <sycl::bundle_state T = State, |
| 160 | + typename = std::enable_if_t<T == bundle_state::executable>> |
| 161 | + std::vector<std::byte> ext_oneapi_get_backend_content() const { |
| 162 | + return std::vector(device_image_plain::get_BinaryStart(), |
| 163 | + device_image_plain::get_BinaryEnd()); |
| 164 | + } |
| 165 | + |
| 166 | +#ifdef __cpp_lib_span |
| 167 | + template <sycl::bundle_state T = State, |
| 168 | + typename = std::enable_if_t<T == bundle_state::executable>> |
| 169 | + std::span<std::byte> ext_oneapi_get_content_backend_view() const { |
| 170 | + return std::span(device_image_plain::get_BinaryStart(), |
| 171 | + device_image_plain::get_BinaryEnd()); |
| 172 | + } |
| 173 | +#endif |
| 174 | + |
148 | 175 | private: |
149 | 176 | device_image(detail::DeviceImageImplPtr Impl) |
150 | 177 | : device_image_plain(std::move(Impl)) {} |
|
0 commit comments