DPC++ Runtime
Runtime libraries for oneAPI DPC++
image.hpp
Go to the documentation of this file.
1 //==------------ image.hpp -------------------------------------------------==//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #pragma once
10 
12 #include <sycl/detail/common.hpp>
16 #include <sycl/event.hpp>
18 #include <sycl/sampler.hpp>
19 #include <sycl/stl.hpp>
20 #include <sycl/types.hpp>
21 
22 #include <cstddef>
23 
24 namespace sycl {
26 
27 // forward declarations
28 class handler;
29 
30 template <int D, typename A> class image;
31 
32 // 'friend'
33 template <backend Backend, int D, typename A>
34 std::enable_if_t<Backend == backend::ext_oneapi_level_zero, image<D, A>>
35 make_image(const backend_input_t<Backend, image<D, A>> &BackendObject,
36  const context &TargetContext, event AvailableEvent = {});
37 
38 enum class image_channel_order : unsigned int {
39  a = 0,
40  r = 1,
41  rx = 2,
42  rg = 3,
43  rgx = 4,
44  ra = 5,
45  rgb = 6,
46  rgbx = 7,
47  rgba = 8,
48  argb = 9,
49  bgra = 10,
50  intensity = 11,
51  luminance = 12,
52  abgr = 13,
53  ext_oneapi_srgba = 14 // OpenCL 2.0
54 };
55 
56 enum class image_channel_type : unsigned int {
57  snorm_int8 = 0,
58  snorm_int16 = 1,
59  unorm_int8 = 2,
60  unorm_int16 = 3,
61  unorm_short_565 = 4,
62  unorm_short_555 = 5,
63  unorm_int_101010 = 6,
64  signed_int8 = 7,
65  signed_int16 = 8,
66  signed_int32 = 9,
67  unsigned_int8 = 10,
68  unsigned_int16 = 11,
69  unsigned_int32 = 12,
70  fp16 = 13,
71  fp32 = 14
72 };
73 
74 // SYCL 2020 image_format
75 enum class image_format : unsigned int {
76  r8g8b8a8_unorm = 0,
78  r8g8b8a8_sint = 2,
81  r8g8b8a8_uint = 5,
86  b8g8r8a8_unorm = 10
87 };
88 
89 using byte = unsigned char;
90 
92 
93 namespace detail {
94 
95 class image_impl;
96 
97 // validImageDataT: cl_int4, cl_uint4, cl_float4, cl_half4
98 template <typename T>
100  T, type_list<vec<opencl::cl_int, 4>, vec<opencl::cl_uint, 4>,
102 
103 template <typename DataT>
104 using EnableIfImgAccDataT =
105  typename std::enable_if_t<is_validImageDataT<DataT>::value, DataT>;
106 
108  switch (Format) {
109  case image_format::r8g8b8a8_unorm:
110  case image_format::b8g8r8a8_unorm:
111  return image_channel_type::unorm_int8;
112  case image_format::r16g16b16a16_unorm:
113  return image_channel_type::unorm_int16;
114  case image_format::r8g8b8a8_sint:
115  return image_channel_type::signed_int8;
116  case image_format::r16g16b16a16_sint:
117  return image_channel_type::signed_int16;
118  case image_format::r32b32g32a32_sint:
119  return image_channel_type::signed_int32;
120  case image_format::r8g8b8a8_uint:
121  return image_channel_type::unsigned_int8;
122  case image_format::r16g16b16a16_uint:
123  return image_channel_type::unsigned_int16;
124  case image_format::r32b32g32a32_uint:
125  return image_channel_type::unsigned_int32;
126  case image_format::r16b16g16a16_sfloat:
127  return image_channel_type::fp16;
128  case image_format::r32g32b32a32_sfloat:
129  return image_channel_type::fp32;
130  }
131  throw sycl::exception(sycl::make_error_code(sycl::errc::invalid),
132  "Unrecognized channel type.");
133 }
134 
136  switch (Format) {
137  case image_format::r8g8b8a8_unorm:
138  case image_format::r16g16b16a16_unorm:
139  case image_format::r8g8b8a8_sint:
140  case image_format::r16g16b16a16_sint:
141  case image_format::r32b32g32a32_sint:
142  case image_format::r8g8b8a8_uint:
143  case image_format::r16g16b16a16_uint:
144  case image_format::r32b32g32a32_uint:
145  case image_format::r16b16g16a16_sfloat:
146  case image_format::r32g32b32a32_sfloat:
147  return image_channel_order::rgba;
148  case image_format::b8g8r8a8_unorm:
149  return image_channel_order::bgra;
150  }
151  throw sycl::exception(sycl::make_error_code(sycl::errc::invalid),
152  "Unrecognized channel order.");
153 }
154 
155 // The non-template base for the sycl::image class
156 class __SYCL_EXPORT image_plain {
157 protected:
158  image_plain(const std::shared_ptr<detail::image_impl> &Impl) : impl{Impl} {}
159 
160  image_plain(image_channel_order Order, image_channel_type Type,
161  const range<3> &Range,
162  std::unique_ptr<SYCLMemObjAllocator> Allocator,
163  uint8_t Dimensions, const property_list &PropList);
164 
165  image_plain(image_channel_order Order, image_channel_type Type,
166  const range<3> &Range, const range<2> &Pitch,
167  std::unique_ptr<SYCLMemObjAllocator> Allocator,
168  uint8_t Dimensions, const property_list &PropList);
169 
170  image_plain(void *HostPointer, image_channel_order Order,
171  image_channel_type Type, const range<3> &Range,
172  std::unique_ptr<SYCLMemObjAllocator> Allocator,
173  uint8_t Dimensions, const property_list &PropList);
174 
175  image_plain(const void *HostPointer, image_channel_order Order,
176  image_channel_type Type, const range<3> &Range,
177  std::unique_ptr<SYCLMemObjAllocator> Allocator,
178  uint8_t Dimensions, const property_list &PropList);
179 
180  image_plain(void *HostPointer, image_channel_order Order,
181  image_channel_type Type, const range<3> &Range,
182  const range<2> &Pitch,
183  std::unique_ptr<SYCLMemObjAllocator> Allocator,
184  uint8_t Dimensions, const property_list &PropList);
185 
186  image_plain(const std::shared_ptr<const void> &HostPointer,
188  const range<3> &Range,
189  std::unique_ptr<SYCLMemObjAllocator> Allocator,
190  uint8_t Dimensions, const property_list &PropList,
191  bool IsConstPtr);
192 
193  image_plain(const std::shared_ptr<const void> &HostPointer,
195  const range<3> &Range, const range<2> &Pitch,
196  std::unique_ptr<SYCLMemObjAllocator> Allocator,
197  uint8_t Dimensions, const property_list &PropList,
198  bool IsConstPtr);
199 
200  image_plain(const void *HostPointer, image_channel_order Order,
201  image_channel_type Type, image_sampler Sampler,
202  const range<3> &Range,
203  std::unique_ptr<SYCLMemObjAllocator> Allocator,
204  uint8_t Dimensions, const property_list &PropList);
205 
206  image_plain(const void *HostPointer, image_channel_order Order,
207  image_channel_type Type, image_sampler Sampler,
208  const range<3> &Range, const range<2> &Pitch,
209  std::unique_ptr<SYCLMemObjAllocator> Allocator,
210  uint8_t Dimensions, const property_list &PropList);
211 
212  image_plain(const std::shared_ptr<const void> &HostPointer,
214  image_sampler Sampler, const range<3> &Range,
215  std::unique_ptr<SYCLMemObjAllocator> Allocator,
216  uint8_t Dimensions, const property_list &PropList);
217 
218  image_plain(const std::shared_ptr<const void> &HostPointer,
220  image_sampler Sampler, const range<3> &Range,
221  const range<2> &Pitch,
222  std::unique_ptr<SYCLMemObjAllocator> Allocator,
223  uint8_t Dimensions, const property_list &PropList);
224 
225 #ifdef __SYCL_INTERNAL_API
226  image_plain(cl_mem ClMemObject, const context &SyclContext,
227  event AvailableEvent,
228  std::unique_ptr<SYCLMemObjAllocator> Allocator,
229  uint8_t Dimensions);
230 #endif
231 
232  image_plain(pi_native_handle MemObject, const context &SyclContext,
233  event AvailableEvent,
234  std::unique_ptr<SYCLMemObjAllocator> Allocator,
235  uint8_t Dimensions, image_channel_order Order,
236  image_channel_type Type, bool OwnNativeHandle,
237  range<3> Range3WithOnes);
238 
239  template <typename propertyT> bool has_property() const noexcept;
240 
241  template <typename propertyT> propertyT get_property() const;
242 
243  range<3> get_range() const;
244 
245  range<2> get_pitch() const;
246 
247  size_t get_size() const noexcept;
248 
249  size_t get_count() const noexcept;
250 
251  void set_final_data_internal();
252 
253  void set_final_data_internal(
254  const std::function<void(const std::function<void(void *const Ptr)> &)>
255  &FinalDataFunc);
256 
257  void set_write_back(bool flag);
258 
259  const std::unique_ptr<SYCLMemObjAllocator> &get_allocator_internal() const;
260 
261  size_t getElementSize() const;
262 
263  size_t getRowPitch() const;
264 
265  size_t getSlicePitch() const;
266 
267  image_sampler getSampler() const noexcept;
268 
269  image_channel_order getChannelOrder() const;
270 
271  image_channel_type getChannelType() const;
272 
273  std::shared_ptr<detail::image_impl> impl;
274 };
275 
276 // Common base class for image implementations
277 template <int Dimensions, typename AllocatorT>
278 class image_common : public image_plain {
279 protected:
280  // Use the same ctors as image_plain.
281  using image_plain::image_plain;
282 
283 public:
284  /* -- property interface members -- */
285  template <typename propertyT> bool has_property() const noexcept {
286  return image_plain::template has_property<propertyT>();
287  }
288 
289  template <typename propertyT> propertyT get_property() const {
290  return image_plain::get_property<propertyT>();
291  }
292 
294  return detail::convertToArrayOfN<Dimensions, 0>(image_plain::get_range());
295  }
296 
297  /* Available only when: dimensions >1 */
298  template <bool IsMultiDim = (Dimensions > 1)>
299  typename std::enable_if_t<IsMultiDim, range<Dimensions - 1>>
300  get_pitch() const {
301  return detail::convertToArrayOfN<Dimensions - 1, 0>(
302  image_plain::get_pitch());
303  }
304 
305  size_t size() const noexcept { return image_plain::get_count(); }
306 
307  // Returns the allocator provided to the image
308  AllocatorT get_allocator() const {
309  return image_plain::get_allocator_internal()
310  ->template getAllocator<AllocatorT>();
311  }
312 };
313 
314 // Common base class for unsampled image implementations
315 template <int Dimensions, typename AllocatorT>
316 class unsampled_image_common : public image_common<Dimensions, AllocatorT> {
317 private:
318  using common_base = typename detail::image_common<Dimensions, AllocatorT>;
319 
320 protected:
321  // Use the same ctors as image_plain.
322  using common_base::image_common;
323 
324 public:
325  template <typename Destination = std::nullptr_t>
326  void set_final_data(Destination finalData = nullptr) {
327  this->set_final_data_internal(finalData);
328  }
329 
330  void set_write_back(bool flag = true) { common_base::set_write_back(flag); }
331 
332 private:
333  void set_final_data_internal(std::nullptr_t) {
334  common_base::set_final_data_internal();
335  }
336 
337  template <template <typename WeakT> class WeakPtrT, typename WeakT>
338  std::enable_if_t<
339  std::is_convertible<WeakPtrT<WeakT>, std::weak_ptr<WeakT>>::value>
340  set_final_data_internal(WeakPtrT<WeakT> FinalData) {
341  std::weak_ptr<WeakT> TempFinalData(FinalData);
342  this->set_final_data_internal(TempFinalData);
343  }
344 
345  template <typename WeakT>
346  void set_final_data_internal(std::weak_ptr<WeakT> FinalData) {
347  common_base::set_final_data_internal(
348  [FinalData](const std::function<void(void *const Ptr)> &F) {
349  if (std::shared_ptr<WeakT> LockedFinalData = FinalData.lock())
350  F(LockedFinalData.get());
351  });
352  }
353 
354  template <typename Destination>
355  detail::EnableIfOutputPointerT<Destination>
356  set_final_data_internal(Destination FinalData) {
357  if (!FinalData)
358  common_base::set_final_data_internal();
359  else
360  common_base::set_final_data_internal(
361  [FinalData](const std::function<void(void *const Ptr)> &F) {
362  F(FinalData);
363  });
364  }
365 
366  template <typename Destination>
367  detail::EnableIfOutputIteratorT<Destination>
368  set_final_data_internal(Destination FinalData) {
369  const size_t Size = common_base::size();
370  common_base::set_final_data_internal(
371  [FinalData, Size](const std::function<void(void *const Ptr)> &F) {
372  using DestinationValueT = detail::iterator_value_type_t<Destination>;
373  // TODO if Destination is ContiguousIterator then don't create
374  // ContiguousStorage. updateHostMemory works only with pointer to
375  // continuous data.
376  std::unique_ptr<DestinationValueT[]> ContiguousStorage(
377  new DestinationValueT[Size]);
378  F(ContiguousStorage.get());
379  std::copy(ContiguousStorage.get(), ContiguousStorage.get() + Size,
380  FinalData);
381  });
382  }
383 };
384 
385 template <typename DataT, int Dims, access::mode AccMode,
387 class image_accessor;
388 
389 } // namespace detail
390 
391 template <typename DataT, int Dimensions, access_mode AccessMode,
392  image_target AccessTarget>
393 class unsampled_image_accessor;
394 
395 template <typename DataT, int Dimensions, access_mode AccessMode>
396 class host_unsampled_image_accessor;
397 
398 template <typename DataT, int Dimensions, image_target AccessTarget>
399 class sampled_image_accessor;
400 
401 template <typename DataT, int Dimensions> class host_sampled_image_accessor;
402 
412 template <int Dimensions = 1, typename AllocatorT = sycl::image_allocator>
413 class image : public detail::unsampled_image_common<Dimensions, AllocatorT> {
414 private:
415  using common_base =
416  typename detail::unsampled_image_common<Dimensions, AllocatorT>;
417 
418 public:
420  const range<Dimensions> &Range, const property_list &PropList = {})
421  : common_base(Order, Type, detail::convertToArrayOfN<3, 1>(Range),
424  Dimensions, PropList) {}
425 
427  const range<Dimensions> &Range, AllocatorT Allocator,
428  const property_list &PropList = {})
429  : common_base(
430  Order, Type, detail::convertToArrayOfN<3, 1>(Range),
433  Dimensions, PropList) {}
434 
435  /* Available only when: dimensions >1 */
436  template <bool B = (Dimensions > 1)>
438  const range<Dimensions> &Range,
439  const typename std::enable_if_t<B, range<Dimensions - 1>> &Pitch,
440  const property_list &PropList = {})
441  : common_base(Order, Type, detail::convertToArrayOfN<3, 1>(Range),
442  detail::convertToArrayOfN<2, 0>(Pitch),
445  Dimensions, PropList) {}
446 
447  /* Available only when: dimensions >1 */
448  template <bool B = (Dimensions > 1)>
450  const range<Dimensions> &Range,
451  const typename std::enable_if_t<B, range<Dimensions - 1>> &Pitch,
452  AllocatorT Allocator, const property_list &PropList = {})
453  : common_base(
454  Order, Type, detail::convertToArrayOfN<3, 1>(Range),
455  detail::convertToArrayOfN<2, 0>(Pitch),
458  Dimensions, PropList) {}
459 
460  image(void *HostPointer, image_channel_order Order, image_channel_type Type,
461  const range<Dimensions> &Range, const property_list &PropList = {})
462  : common_base(HostPointer, Order, Type,
463  detail::convertToArrayOfN<3, 1>(Range),
466  Dimensions, PropList) {}
467 
468  image(void *HostPointer, image_channel_order Order, image_channel_type Type,
469  const range<Dimensions> &Range, AllocatorT Allocator,
470  const property_list &PropList = {})
471  : common_base(
472  HostPointer, Order, Type, detail::convertToArrayOfN<3, 1>(Range),
475  Dimensions, PropList) {}
476 
477  image(const void *HostPointer, image_channel_order Order,
478  image_channel_type Type, const range<Dimensions> &Range,
479  const property_list &PropList = {})
480  : common_base(HostPointer, Order, Type,
481  detail::convertToArrayOfN<3, 1>(Range),
484  Dimensions, PropList) {}
485 
486  image(const void *HostPointer, image_channel_order Order,
487  image_channel_type Type, const range<Dimensions> &Range,
488  AllocatorT Allocator, const property_list &PropList = {})
489  : common_base(
490  HostPointer, Order, Type, detail::convertToArrayOfN<3, 1>(Range),
493  Dimensions, PropList) {}
494 
495  /* Available only when: dimensions >1 */
496  template <bool B = (Dimensions > 1)>
497  image(void *HostPointer, image_channel_order Order, image_channel_type Type,
498  const range<Dimensions> &Range,
499  const typename std::enable_if_t<B, range<Dimensions - 1>> &Pitch,
500  const property_list &PropList = {})
501  : common_base(HostPointer, Order, Type,
502  detail::convertToArrayOfN<3, 1>(Range),
503  detail::convertToArrayOfN<2, 0>(Pitch),
506  Dimensions, PropList) {}
507 
508  /* Available only when: dimensions >1 */
509  template <bool B = (Dimensions > 1)>
510  image(void *HostPointer, image_channel_order Order, image_channel_type Type,
511  const range<Dimensions> &Range,
512  const typename std::enable_if_t<B, range<Dimensions - 1>> &Pitch,
513  AllocatorT Allocator, const property_list &PropList = {})
514  : common_base(
515  HostPointer, Order, Type, detail::convertToArrayOfN<3, 1>(Range),
516  detail::convertToArrayOfN<2, 0>(Pitch),
519  Dimensions, PropList) {}
520 
521  image(std::shared_ptr<void> &HostPointer, image_channel_order Order,
522  image_channel_type Type, const range<Dimensions> &Range,
523  const property_list &PropList = {})
524  : common_base(HostPointer, Order, Type,
525  detail::convertToArrayOfN<3, 1>(Range),
528  Dimensions, PropList, /*IsConstPtr*/ false) {}
529 
530  image(std::shared_ptr<void> &HostPointer, image_channel_order Order,
531  image_channel_type Type, const range<Dimensions> &Range,
532  AllocatorT Allocator, const property_list &PropList = {})
533  : common_base(
534  HostPointer, Order, Type, detail::convertToArrayOfN<3, 1>(Range),
537  Dimensions, PropList, /*IsConstPtr*/ false) {}
538 
539  /* Available only when: dimensions >1 */
540  template <bool B = (Dimensions > 1)>
541  image(std::shared_ptr<void> &HostPointer, image_channel_order Order,
542  image_channel_type Type, const range<Dimensions> &Range,
543  const typename std::enable_if_t<B, range<Dimensions - 1>> &Pitch,
544  const property_list &PropList = {})
545  : common_base(HostPointer, Order, Type,
546  detail::convertToArrayOfN<3, 1>(Range),
547  detail::convertToArrayOfN<2, 0>(Pitch),
550  Dimensions, PropList, /*IsConstPtr*/ false) {}
551 
552  /* Available only when: dimensions >1 */
553  template <bool B = (Dimensions > 1)>
554  image(std::shared_ptr<void> &HostPointer, image_channel_order Order,
555  image_channel_type Type, const range<Dimensions> &Range,
556  const typename std::enable_if_t<B, range<Dimensions - 1>> &Pitch,
557  AllocatorT Allocator, const property_list &PropList = {})
558  : common_base(
559  HostPointer, Order, Type, detail::convertToArrayOfN<3, 1>(Range),
560  detail::convertToArrayOfN<2, 0>(Pitch),
563  Dimensions, PropList, /*IsConstPtr*/ false) {}
564 
565 #ifdef __SYCL_INTERNAL_API
566  image(cl_mem ClMemObject, const context &SyclContext,
567  event AvailableEvent = {})
568  : common_base(ClMemObject, SyclContext, AvailableEvent,
570  detail::SYCLMemObjAllocatorHolder<AllocatorT, byte>>(),
571  Dimensions) {}
572 #endif
573 
574  /* -- common interface members -- */
575 
576  image(const image &rhs) = default;
577 
578  image(image &&rhs) = default;
579 
580  image &operator=(const image &rhs) = default;
581 
582  image &operator=(image &&rhs) = default;
583 
584  ~image() = default;
585 
586  bool operator==(const image &rhs) const { return this->impl == rhs.impl; }
587 
588  bool operator!=(const image &rhs) const { return !(*this == rhs); }
589 
590  /* -- property interface members -- */
591  template <typename propertyT> bool has_property() const noexcept {
592  return common_base::template has_property<propertyT>();
593  }
594 
595  template <typename propertyT> propertyT get_property() const {
596  return common_base::template get_property<propertyT>();
597  }
598 
600  return detail::convertToArrayOfN<Dimensions, 0>(common_base::get_range());
601  }
602 
603  /* Available only when: dimensions >1 */
604  template <bool B = (Dimensions > 1)>
605  typename std::enable_if_t<B, range<Dimensions - 1>> get_pitch() const {
606  return detail::convertToArrayOfN<Dimensions - 1, 0>(
607  common_base::get_pitch());
608  }
609 
610  // Returns the size of the image storage in bytes
611  size_t get_size() const { return common_base::get_size(); }
612 
613  // Returns the total number of elements in the image
614  __SYCL2020_DEPRECATED("get_count() is deprecated, please use size() instead")
615  size_t get_count() const { return common_base::size(); }
616 
617  template <typename DataT, access::mode AccessMode>
619  access::target::image, access::placeholder::false_t,
621  get_access(handler &commandGroupHandler) {
622  return accessor<DataT, Dimensions, AccessMode, access::target::image,
623  access::placeholder::false_t,
625  commandGroupHandler);
626  }
627 
628  template <typename DataT, access::mode AccessMode>
630  access::target::host_image, access::placeholder::false_t,
633  return accessor<DataT, Dimensions, AccessMode, access::target::host_image,
634  access::placeholder::false_t,
636  }
637 
638 private:
639  image(pi_native_handle MemObject, const context &SyclContext,
640  event AvailableEvent, image_channel_order Order,
641  image_channel_type Type, bool OwnNativeHandle, range<Dimensions> Range)
642  : common_base(MemObject, SyclContext, AvailableEvent,
644  detail::SYCLMemObjAllocatorHolder<AllocatorT, byte>>(),
645  Dimensions, Order, Type, OwnNativeHandle,
646  detail::convertToArrayOfN<3, 1>(Range)) {}
647 
648  // This utility api is currently used by accessor to get the element size of
649  // the image. Element size is dependent on num of channels and channel type.
650  // This information is not accessible from the image using any public API.
651  size_t getElementSize() const { return common_base::getElementSize(); }
652 
653  size_t getRowPitch() const { return common_base::getRowPitch(); }
654 
655  size_t getSlicePitch() const { return common_base::getSlicePitch(); }
656 
657  image_channel_order getChannelOrder() const {
658  return common_base::getChannelOrder();
659  }
660 
661  image_channel_type getChannelType() const {
662  return common_base::getChannelType();
663  }
664 
665  // Declare make_image as a friend function
666  template <backend Backend, int D, typename A>
667  friend std::enable_if_t<
668  detail::InteropFeatureSupportMap<Backend>::MakeImage == true &&
669  Backend != backend::ext_oneapi_level_zero,
670  image<D, A>>
671  make_image(
672  const typename backend_traits<Backend>::template input_type<image<D, A>>
673  &BackendObject,
674  const context &TargetContext, event AvailableEvent);
675 
676  template <backend Backend, int D, typename A>
677  friend std::enable_if_t<Backend == backend::ext_oneapi_level_zero,
678  image<D, A>>
679  make_image(const backend_input_t<Backend, image<D, A>> &BackendObject,
680  const context &TargetContext, event AvailableEvent);
681 
682  template <class Obj>
683  friend decltype(Obj::impl) detail::getSyclObjImpl(const Obj &SyclObject);
684 
685  template <typename DataT, int Dims, access::mode AccMode,
687  typename PropertyListT>
688  friend class accessor;
689 
690  template <typename DataT, int Dims, access::mode AccMode,
693 };
694 
695 template <int Dimensions = 1, typename AllocatorT = sycl::image_allocator>
697  : public detail::unsampled_image_common<Dimensions, AllocatorT>,
698  public detail::OwnerLessBase<unsampled_image<Dimensions, AllocatorT>> {
699 private:
700  using common_base =
702 
703  unsampled_image(const std::shared_ptr<detail::image_impl> &Impl)
704  : common_base{Impl} {}
705 
706 public:
708  const property_list &PropList = {})
709  : common_base(detail::FormatChannelOrder(Format),
711  detail::convertToArrayOfN<3, 1>(Range),
714  Dimensions, PropList) {}
715 
717  AllocatorT Allocator, const property_list &PropList = {})
718  : common_base(
721  detail::convertToArrayOfN<3, 1>(Range),
724  Dimensions, PropList) {}
725 
726  template <bool IsMultiDim = (Dimensions > 1),
727  typename = std::enable_if_t<IsMultiDim>>
729  const range<Dimensions - 1> &Pitch,
730  const property_list &PropList = {})
731  : common_base(detail::FormatChannelOrder(Format),
733  detail::convertToArrayOfN<3, 1>(Range),
734  detail::convertToArrayOfN<2, 0>(Pitch),
737  Dimensions, PropList) {}
738 
739  template <bool IsMultiDim = (Dimensions > 1),
740  typename = std::enable_if_t<IsMultiDim>>
742  const range<Dimensions - 1> &Pitch, AllocatorT Allocator,
743  const property_list &PropList = {})
744  : common_base(
747  detail::convertToArrayOfN<3, 1>(Range),
748  detail::convertToArrayOfN<2, 0>(Pitch),
751  Dimensions, PropList) {}
752 
753  unsampled_image(void *HostPointer, image_format Format,
754  const range<Dimensions> &Range,
755  const property_list &PropList = {})
756  : common_base(HostPointer, detail::FormatChannelOrder(Format),
758  detail::convertToArrayOfN<3, 1>(Range),
761  Dimensions, PropList) {}
762 
763  unsampled_image(void *HostPointer, image_format Format,
764  const range<Dimensions> &Range, AllocatorT Allocator,
765  const property_list &PropList = {})
766  : common_base(
767  HostPointer, detail::FormatChannelOrder(Format),
769  detail::convertToArrayOfN<3, 1>(Range),
772  Dimensions, PropList) {}
773 
774  template <bool IsMultiDim = (Dimensions > 1),
775  typename = std::enable_if_t<IsMultiDim>>
776  unsampled_image(void *HostPointer, image_format Format,
777  const range<Dimensions> &Range,
778  const range<Dimensions - 1> &Pitch,
779  const property_list &PropList = {})
780  : common_base(HostPointer, detail::FormatChannelOrder(Format),
782  detail::convertToArrayOfN<3, 1>(Range),
783  detail::convertToArrayOfN<2, 0>(Pitch),
786  Dimensions, PropList) {}
787 
788  template <bool IsMultiDim = (Dimensions > 1),
789  typename = std::enable_if_t<IsMultiDim>>
790  unsampled_image(void *HostPointer, image_format Format,
791  const range<Dimensions> &Range,
792  const range<Dimensions - 1> &Pitch, AllocatorT Allocator,
793  const property_list &PropList = {})
794  : common_base(
795  HostPointer, detail::FormatChannelOrder(Format),
797  detail::convertToArrayOfN<3, 1>(Range),
798  detail::convertToArrayOfN<2, 0>(Pitch),
801  Dimensions, PropList) {}
802 
803  unsampled_image(std::shared_ptr<void> &HostPointer, image_format Format,
804  const range<Dimensions> &Range,
805  const property_list &PropList = {})
806  : common_base(HostPointer, detail::FormatChannelOrder(Format),
808  detail::convertToArrayOfN<3, 1>(Range),
811  Dimensions, PropList, /*IsConstPtr*/ false) {}
812 
813  unsampled_image(std::shared_ptr<void> &HostPointer, image_format Format,
814  const range<Dimensions> &Range, AllocatorT Allocator,
815  const property_list &PropList = {})
816  : common_base(
817  HostPointer, detail::FormatChannelOrder(Format),
819  detail::convertToArrayOfN<3, 1>(Range),
822  Dimensions, PropList, /*IsConstPtr*/ false) {}
823 
824  template <bool IsMultiDim = (Dimensions > 1),
825  typename = std::enable_if_t<IsMultiDim>>
826  unsampled_image(std::shared_ptr<void> &HostPointer, image_format Format,
827  const range<Dimensions> &Range,
828  const range<Dimensions - 1> &Pitch,
829  const property_list &PropList = {})
830  : common_base(HostPointer, detail::FormatChannelOrder(Format),
832  detail::convertToArrayOfN<3, 1>(Range),
833  detail::convertToArrayOfN<2, 0>(Pitch),
836  Dimensions, PropList, /*IsConstPtr*/ false) {}
837 
838  template <bool IsMultiDim = (Dimensions > 1),
839  typename = std::enable_if_t<IsMultiDim>>
840  unsampled_image(std::shared_ptr<void> &HostPointer, image_format Format,
841  const range<Dimensions> &Range,
842  const range<Dimensions - 1> &Pitch, AllocatorT Allocator,
843  const property_list &PropList = {})
844  : common_base(
845  HostPointer, detail::FormatChannelOrder(Format),
847  detail::convertToArrayOfN<3, 1>(Range),
848  detail::convertToArrayOfN<2, 0>(Pitch),
851  Dimensions, PropList, /*IsConstPtr*/ false) {}
852 
853  /* -- common interface members -- */
854 
855  unsampled_image(const unsampled_image &rhs) = default;
856 
857  unsampled_image(unsampled_image &&rhs) = default;
858 
859  unsampled_image &operator=(const unsampled_image &rhs) = default;
860 
861  unsampled_image &operator=(unsampled_image &&rhs) = default;
862 
863  ~unsampled_image() = default;
864 
865  bool operator==(const unsampled_image &rhs) const {
866  return this->impl == rhs.impl;
867  }
868 
869  bool operator!=(const unsampled_image &rhs) const { return !(*this == rhs); }
870 
871  size_t byte_size() const noexcept { return common_base::get_size(); }
872 
873  using common_base::size;
874 
875  template <typename DataT,
876  access_mode AccessMode = (std::is_const_v<DataT>
877  ? access_mode::read
879  image_target AccessTarget = image_target::device>
881  get_access(handler &CommandGroupHandlerRef,
882  const property_list &PropList = {}) {
883  return {*this, CommandGroupHandlerRef, PropList};
884  }
885 
886  template <typename DataT,
887  access_mode AccessMode = (std::is_const_v<DataT>
888  ? access_mode::read
890  host_unsampled_image_accessor<DataT, Dimensions, AccessMode>
891  get_host_access(const property_list &PropList = {}) {
892  return {*this, PropList};
893  }
894 
895 private:
896  template <class Obj>
897  friend decltype(Obj::impl) detail::getSyclObjImpl(const Obj &SyclObject);
898 
899  template <class T>
900  friend T detail::createSyclObjFromImpl(decltype(T::impl) ImplObj);
901 
902  template <typename DataT, int Dims, access_mode AccessMode>
904 
905  template <typename DataT, int Dims, access_mode AccessMode,
906  image_target AccessTarget>
908 };
909 
910 template <int Dimensions = 1, typename AllocatorT = sycl::image_allocator>
912  : public detail::image_common<Dimensions, AllocatorT>,
913  public detail::OwnerLessBase<sampled_image<Dimensions, AllocatorT>> {
914 private:
915  using common_base = typename detail::image_common<Dimensions, AllocatorT>;
916 
917  sampled_image(const std::shared_ptr<detail::image_impl> &Impl)
918  : common_base{Impl} {}
919 
920 public:
921  sampled_image(const void *HostPointer, image_format Format,
922  image_sampler Sampler, const range<Dimensions> &Range,
923  const property_list &PropList = {})
924  : common_base(HostPointer, detail::FormatChannelOrder(Format),
925  detail::FormatChannelType(Format), Sampler,
926  detail::convertToArrayOfN<3, 1>(Range),
929  Dimensions, PropList) {}
930 
931  template <bool IsMultiDim = (Dimensions > 1),
932  typename = std::enable_if_t<IsMultiDim>>
933  sampled_image(const void *HostPointer, image_format Format,
934  image_sampler Sampler, const range<Dimensions> &Range,
935  const range<Dimensions - 1> &Pitch,
936  const property_list &PropList = {})
937  : common_base(HostPointer, detail::FormatChannelOrder(Format),
938  detail::FormatChannelType(Format), Sampler,
939  detail::convertToArrayOfN<3, 1>(Range),
940  detail::convertToArrayOfN<2, 0>(Pitch),
943  Dimensions, PropList) {}
944 
945  sampled_image(std::shared_ptr<const void> &HostPointer, image_format Format,
946  image_sampler Sampler, const range<Dimensions> &Range,
947  const property_list &PropList = {})
948  : common_base(HostPointer, detail::FormatChannelOrder(Format),
949  detail::FormatChannelType(Format), Sampler,
950  detail::convertToArrayOfN<3, 1>(Range),
953  Dimensions, PropList) {}
954 
955  template <bool IsMultiDim = (Dimensions > 1),
956  typename = std::enable_if_t<IsMultiDim>>
957  sampled_image(std::shared_ptr<const void> &HostPointer, image_format Format,
958  image_sampler Sampler, const range<Dimensions> &Range,
959  const range<Dimensions - 1> &Pitch,
960  const property_list &PropList = {})
961  : common_base(HostPointer, detail::FormatChannelOrder(Format),
962  detail::FormatChannelType(Format), Sampler,
963  detail::convertToArrayOfN<3, 1>(Range),
964  detail::convertToArrayOfN<2, 0>(Pitch),
967  Dimensions, PropList) {}
968 
969  /* -- common interface members -- */
970 
971  sampled_image(const sampled_image &rhs) = default;
972 
973  sampled_image(sampled_image &&rhs) = default;
974 
975  sampled_image &operator=(const sampled_image &rhs) = default;
976 
977  sampled_image &operator=(sampled_image &&rhs) = default;
978 
979  ~sampled_image() = default;
980 
981  bool operator==(const sampled_image &rhs) const {
982  return this->impl == rhs.impl;
983  }
984 
985  bool operator!=(const sampled_image &rhs) const { return !(*this == rhs); }
986 
987  size_t byte_size() const noexcept { return common_base::get_size(); }
988 
989  template <typename DataT, image_target AccessTarget = image_target::device>
991  get_access(handler &CommandGroupHandlerRef,
992  const property_list &PropList = {}) {
993  return {*this, CommandGroupHandlerRef, PropList};
994  }
995 
996  template <typename DataT>
997  host_sampled_image_accessor<DataT, Dimensions>
998  get_host_access(const property_list &PropList = {}) {
999  return {*this, PropList};
1000  }
1001 
1002 private:
1003  template <class Obj>
1004  friend decltype(Obj::impl) detail::getSyclObjImpl(const Obj &SyclObject);
1005 
1006  template <class T>
1007  friend T detail::createSyclObjFromImpl(decltype(T::impl) ImplObj);
1008 
1009  template <typename DataT, int Dims> friend class host_sampled_image_accessor;
1010 
1011  template <typename DataT, int Dims, image_target AccessTarget>
1013 };
1014 
1015 } // __SYCL_INLINE_VER_NAMESPACE(_V1)
1016 } // namespace sycl
1017 
1018 namespace std {
1019 template <int Dimensions, typename AllocatorT>
1020 struct hash<sycl::image<Dimensions, AllocatorT>> {
1021  size_t operator()(const sycl::image<Dimensions, AllocatorT> &I) const {
1022  return hash<std::shared_ptr<sycl::detail::image_impl>>()(
1024  }
1025 };
1026 
1027 template <int Dimensions, typename AllocatorT>
1028 struct hash<sycl::unsampled_image<Dimensions, AllocatorT>> {
1029  size_t
1030  operator()(const sycl::unsampled_image<Dimensions, AllocatorT> &I) const {
1031  return hash<std::shared_ptr<sycl::detail::image_impl>>()(
1033  }
1034 };
1035 
1036 template <int Dimensions, typename AllocatorT>
1037 struct hash<sycl::sampled_image<Dimensions, AllocatorT>> {
1038  size_t
1039  operator()(const sycl::sampled_image<Dimensions, AllocatorT> &I) const {
1040  return hash<std::shared_ptr<sycl::detail::image_impl>>()(
1042  }
1043 };
1044 } // namespace std
sycl::_V1::IsPlaceholder
class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(local_accessor) local_accessor class __SYCL_EBO __SYCL_SPECIAL_CLASS IsPlaceholder
Definition: accessor.hpp:3060
sycl::_V1::image_channel_order::rgb
@ rgb
sycl::_V1::property_list
Objects of the property_list class are containers for the SYCL properties.
Definition: property_list.hpp:24
sycl::_V1::unsampled_image::operator==
bool operator==(const unsampled_image &rhs) const
Definition: image.hpp:865
sycl::_V1::detail::image_accessor
Definition: accessor.hpp:701
sycl::_V1::image_channel_order::bgra
@ bgra
sycl::_V1::image_format::r16g16b16a16_uint
@ r16g16b16a16_uint
sycl::_V1::image_format::r16b16g16a16_sfloat
@ r16b16g16a16_sfloat
sycl::_V1::image
Defines a shared image data.
Definition: image.hpp:30
sycl::_V1::unsampled_image::operator!=
bool operator!=(const unsampled_image &rhs) const
Definition: image.hpp:869
sycl::_V1::access::mode
mode
Definition: access.hpp:30
sycl::_V1::image_format::b8g8r8a8_unorm
@ b8g8r8a8_unorm
sycl::_V1::unsampled_image::get_host_access
host_unsampled_image_accessor< DataT, Dimensions, AccessMode > get_host_access(const property_list &PropList={})
Definition: image.hpp:891
sycl::_V1::image_sampler
Definition: sampler.hpp:129
T
sycl::_V1::detail::image_common::get_allocator
AllocatorT get_allocator() const
Definition: image.hpp:308
sycl::_V1::image_format::r16g16b16a16_unorm
@ r16g16b16a16_unorm
sycl::_V1::image_channel_type::unorm_int8
@ unorm_int8
sycl::_V1::make_error_code
std::error_code make_error_code(sycl::errc E) noexcept
Constructs an error code using e and sycl_category()
Definition: exception.cpp:94
sycl::_V1::detail::unsampled_image_common
Definition: image.hpp:316
sycl::_V1::image::image
image(std::shared_ptr< void > &HostPointer, image_channel_order Order, image_channel_type Type, const range< Dimensions > &Range, const typename std::enable_if_t< B, range< Dimensions - 1 >> &Pitch, const property_list &PropList={})
Definition: image.hpp:541
stl.hpp
__SYCL_INLINE_VER_NAMESPACE
#define __SYCL_INLINE_VER_NAMESPACE(X)
Definition: defines_elementary.hpp:11
sycl::_V1::image::image
image(std::shared_ptr< void > &HostPointer, image_channel_order Order, image_channel_type Type, const range< Dimensions > &Range, const typename std::enable_if_t< B, range< Dimensions - 1 >> &Pitch, AllocatorT Allocator, const property_list &PropList={})
Definition: image.hpp:554
types.hpp
sycl::_V1::detail::image_common::get_range
range< Dimensions > get_range() const
Definition: image.hpp:293
sycl::_V1::image_format::r32b32g32a32_sint
@ r32b32g32a32_sint
accessor_property_list.hpp
sycl::_V1::image::get_range
range< Dimensions > get_range() const
Definition: image.hpp:599
sycl::_V1::image_channel_order::ext_oneapi_srgba
@ ext_oneapi_srgba
sycl::_V1::image_channel_order::rgx
@ rgx
sycl::_V1::sampled_image::sampled_image
sampled_image(std::shared_ptr< const void > &HostPointer, image_format Format, image_sampler Sampler, const range< Dimensions > &Range, const property_list &PropList={})
Definition: image.hpp:945
sycl::_V1::image_channel_type::signed_int8
@ signed_int8
event.hpp
sycl::_V1::image_channel_type::unsigned_int8
@ unsigned_int8
sycl::_V1::image::get_size
size_t get_size() const
Definition: image.hpp:611
sycl::_V1::byte
unsigned char byte
Definition: image.hpp:89
sycl::_V1::Dimensions
class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(local_accessor) local_accessor class __SYCL_EBO __SYCL_SPECIAL_CLASS Dimensions
Definition: accessor.hpp:3059
sycl
---— Error handling, matching OpenCL plugin semantics.
Definition: access.hpp:14
sycl::_V1::image_channel_order::ra
@ ra
sycl::_V1::event
An event object can be used to synchronize memory transfers, enqueues of kernels and signaling barrie...
Definition: event.hpp:40
sycl::_V1::image_channel_order::rg
@ rg
sycl::_V1::image::image
image(image_channel_order Order, image_channel_type Type, const range< Dimensions > &Range, AllocatorT Allocator, const property_list &PropList={})
Definition: image.hpp:426
sycl::_V1::image::image
image(std::shared_ptr< void > &HostPointer, image_channel_order Order, image_channel_type Type, const range< Dimensions > &Range, const property_list &PropList={})
Definition: image.hpp:521
sycl::_V1::image_channel_type::unsigned_int32
@ unsigned_int32
owner_less_base.hpp
sycl::_V1::unsampled_image::unsampled_image
unsampled_image(std::shared_ptr< void > &HostPointer, image_format Format, const range< Dimensions > &Range, const range< Dimensions - 1 > &Pitch, const property_list &PropList={})
Definition: image.hpp:826
sycl::_V1::unsampled_image::unsampled_image
unsampled_image(void *HostPointer, image_format Format, const range< Dimensions > &Range, const property_list &PropList={})
Definition: image.hpp:753
sycl::_V1::image::get_access
accessor< detail::EnableIfImgAccDataT< DataT >, Dimensions, AccessMode, access::target::image, access::placeholder::false_t, ext::oneapi::accessor_property_list<> > get_access(handler &commandGroupHandler)
Definition: image.hpp:621
sycl::_V1::image_channel_type::snorm_int8
@ snorm_int8
sycl::_V1::image_channel_type::snorm_int16
@ snorm_int16
sycl::_V1::sampled_image::sampled_image
sampled_image(std::shared_ptr< const void > &HostPointer, image_format Format, image_sampler Sampler, const range< Dimensions > &Range, const range< Dimensions - 1 > &Pitch, const property_list &PropList={})
Definition: image.hpp:957
sycl::_V1::image::__SYCL2020_DEPRECATED
__SYCL2020_DEPRECATED("get_count() is deprecated, please use size() instead") size_t get_count() const
Definition: image.hpp:614
sycl::_V1::backend_input_t
typename backend_traits< Backend >::template input_type< SyclType > backend_input_t
Definition: backend.hpp:72
sycl::_V1::range< 3 >
sycl::_V1::detail::aligned_allocator
Definition: aligned_allocator.hpp:23
std::hash< sycl::image< Dimensions, AllocatorT > >::operator()
size_t operator()(const sycl::image< Dimensions, AllocatorT > &I) const
Definition: image.hpp:1021
sycl::_V1::unsampled_image::unsampled_image
unsampled_image(std::shared_ptr< void > &HostPointer, image_format Format, const range< Dimensions > &Range, const range< Dimensions - 1 > &Pitch, AllocatorT Allocator, const property_list &PropList={})
Definition: image.hpp:840
sycl::_V1::access::placeholder
placeholder
Definition: access.hpp:45
sycl::_V1::host_sampled_image_accessor
Definition: accessor.hpp:3825
sycl::_V1::sampled_image::byte_size
size_t byte_size() const noexcept
Definition: image.hpp:987
sycl::_V1::ext::oneapi::experimental::has_property
static constexpr bool has_property()
Definition: annotated_arg.hpp:162
sycl::_V1::image::get_pitch
std::enable_if_t< B, range< Dimensions - 1 > > get_pitch() const
Definition: image.hpp:605
sycl::_V1::image_format::r8g8b8a8_unorm
@ r8g8b8a8_unorm
sycl::_V1::detail::unsampled_image_common::set_write_back
void set_write_back(bool flag=true)
Definition: image.hpp:330
sycl::_V1::sampled_image::sampled_image
sampled_image(const void *HostPointer, image_format Format, image_sampler Sampler, const range< Dimensions > &Range, const property_list &PropList={})
Definition: image.hpp:921
sycl::_V1::sampled_image::get_host_access
host_sampled_image_accessor< DataT, Dimensions > get_host_access(const property_list &PropList={})
Definition: image.hpp:998
sycl::_V1::image_format::r8g8b8a8_sint
@ r8g8b8a8_sint
sycl::_V1::detail::image_impl
Definition: image_impl.hpp:62
sycl::_V1::image_channel_order::intensity
@ intensity
sycl::_V1::image::has_property
bool has_property() const noexcept
Definition: image.hpp:591
generic_type_traits.hpp
sycl::_V1::ext::oneapi::experimental::operator=
annotated_arg & operator=(annotated_arg &)=default
sycl::_V1::detail::image_common::size
size_t size() const noexcept
Definition: image.hpp:305
sycl::_V1::make_image
std::enable_if_t< Backend==backend::ext_oneapi_level_zero, image< D, A > > make_image(const backend_input_t< Backend, image< D, A >> &BackendObject, const context &TargetContext, event AvailableEvent={})
sycl::_V1::unsampled_image::byte_size
size_t byte_size() const noexcept
Definition: image.hpp:871
sycl::_V1::detail::image_common
Definition: image.hpp:278
sycl::_V1::access::target::image
@ image
sycl::_V1::image_channel_type::unorm_short_555
@ unorm_short_555
sycl::_V1::unsampled_image::unsampled_image
unsampled_image(image_format Format, const range< Dimensions > &Range, const property_list &PropList={})
Definition: image.hpp:707
sycl::_V1::image::operator!=
bool operator!=(const image &rhs) const
Definition: image.hpp:588
sycl::_V1::detail::OwnerLessBase
Definition: owner_less_base.hpp:21
sycl::_V1::image::get_property
propertyT get_property() const
Definition: image.hpp:595
sycl::_V1::sampled_image::operator!=
bool operator!=(const sampled_image &rhs) const
Definition: image.hpp:985
sycl::_V1::unsampled_image::unsampled_image
unsampled_image(image_format Format, const range< Dimensions > &Range, AllocatorT Allocator, const property_list &PropList={})
Definition: image.hpp:716
sycl::_V1::handler
Command group handler class.
Definition: handler.hpp:325
sycl::_V1::unsampled_image::unsampled_image
unsampled_image(std::shared_ptr< void > &HostPointer, image_format Format, const range< Dimensions > &Range, const property_list &PropList={})
Definition: image.hpp:803
sycl::_V1::image::image
image(std::shared_ptr< void > &HostPointer, image_channel_order Order, image_channel_type Type, const range< Dimensions > &Range, AllocatorT Allocator, const property_list &PropList={})
Definition: image.hpp:530
sycl::_V1::image_channel_order::rx
@ rx
sycl::_V1::image::image
image(void *HostPointer, image_channel_order Order, image_channel_type Type, const range< Dimensions > &Range, const typename std::enable_if_t< B, range< Dimensions - 1 >> &Pitch, const property_list &PropList={})
Definition: image.hpp:497
sycl::_V1::access_mode
access::mode access_mode
Definition: access.hpp:63
common.hpp
sycl::_V1::sampled_image::sampled_image
sampled_image(const void *HostPointer, image_format Format, image_sampler Sampler, const range< Dimensions > &Range, const range< Dimensions - 1 > &Pitch, const property_list &PropList={})
Definition: image.hpp:933
sycl::_V1::image_channel_type::unorm_int_101010
@ unorm_int_101010
sycl::_V1::image_channel_order
image_channel_order
Definition: image.hpp:38
sycl::_V1::image_format::r32g32b32a32_sfloat
@ r32g32b32a32_sfloat
sycl::_V1::detail::createSyclObjFromImpl
T createSyclObjFromImpl(decltype(T::impl) ImplObj)
Definition: common.hpp:320
sycl::_V1::ext::oneapi::accessor_property_list
Definition: property_list.hpp:18
sycl::_V1::image_channel_type::signed_int16
@ signed_int16
sycl::_V1::access::target
target
Definition: access.hpp:18
sycl::_V1::image_channel_type::unsigned_int16
@ unsigned_int16
sycl::_V1::read_write
constexpr mode_tag_t< access_mode::read_write > read_write
Definition: access.hpp:76
sycl::_V1::detail::is_validImageDataT
typename detail::is_contained< T, type_list< vec< opencl::cl_int, 4 >, vec< opencl::cl_uint, 4 >, vec< opencl::cl_float, 4 >, vec< opencl::cl_half, 4 > >>::type is_validImageDataT
Definition: image.hpp:101
sycl::_V1::detail::FormatChannelOrder
image_channel_order FormatChannelOrder(image_format Format)
Definition: image.hpp:135
sycl::_V1::unsampled_image::unsampled_image
unsampled_image(void *HostPointer, image_format Format, const range< Dimensions > &Range, const range< Dimensions - 1 > &Pitch, const property_list &PropList={})
Definition: image.hpp:776
sycl::_V1::unsampled_image::unsampled_image
unsampled_image(void *HostPointer, image_format Format, const range< Dimensions > &Range, const range< Dimensions - 1 > &Pitch, AllocatorT Allocator, const property_list &PropList={})
Definition: image.hpp:790
sycl::_V1::detail::convertToArrayOfN
static T< NewDim > convertToArrayOfN(T< OldDim > OldObj)
Definition: common.hpp:461
sycl::_V1::unsampled_image_accessor
Definition: accessor.hpp:3499
sycl::_V1::ext::oneapi::experimental::get_property
static constexpr auto get_property()
Definition: annotated_arg.hpp:166
pi_native_handle
uintptr_t pi_native_handle
Definition: pi.h:146
aligned_allocator.hpp
sycl::_V1::image::image
image(image_channel_order Order, image_channel_type Type, const range< Dimensions > &Range, const property_list &PropList={})
Definition: image.hpp:419
sycl::_V1::unsampled_image::unsampled_image
unsampled_image(image_format Format, const range< Dimensions > &Range, const range< Dimensions - 1 > &Pitch, AllocatorT Allocator, const property_list &PropList={})
Definition: image.hpp:741
sycl::_V1::image::image
image(image_channel_order Order, image_channel_type Type, const range< Dimensions > &Range, const typename std::enable_if_t< B, range< Dimensions - 1 >> &Pitch, const property_list &PropList={})
Definition: image.hpp:437
sycl::_V1::image_channel_order::rgbx
@ rgbx
sycl::_V1::unsampled_image::unsampled_image
unsampled_image(void *HostPointer, image_format Format, const range< Dimensions > &Range, AllocatorT Allocator, const property_list &PropList={})
Definition: image.hpp:763
sycl::_V1::accessor
Definition: accessor.hpp:225
sycl::_V1::image_channel_order::rgba
@ rgba
std::hash< sycl::unsampled_image< Dimensions, AllocatorT > >::operator()
size_t operator()(const sycl::unsampled_image< Dimensions, AllocatorT > &I) const
Definition: image.hpp:1030
sycl::_V1::make_unique_ptr
std::unique_ptr< T > make_unique_ptr(ArgsT &&...Args)
Definition: stl.hpp:52
sycl::_V1::sampled_image::get_access
sampled_image_accessor< DataT, Dimensions, AccessTarget > get_access(handler &CommandGroupHandlerRef, const property_list &PropList={})
Definition: image.hpp:991
sycl::_V1::image_format::r32b32g32a32_uint
@ r32b32g32a32_uint
sycl::_V1::image::image
image(void *HostPointer, image_channel_order Order, image_channel_type Type, const range< Dimensions > &Range, AllocatorT Allocator, const property_list &PropList={})
Definition: image.hpp:468
sycl::_V1::detail::SYCLMemObjAllocatorHolder
Definition: sycl_mem_obj_allocator.hpp:37
sycl::_V1::image_format::r8g8b8a8_uint
@ r8g8b8a8_uint
sycl::_V1::detail::image_common::get_pitch
std::enable_if_t< IsMultiDim, range< Dimensions - 1 > > get_pitch() const
Definition: image.hpp:300
sycl::_V1::vec
Provides a cross-patform vector class template that works efficiently on SYCL devices as well as in h...
Definition: aliases.hpp:20
sycl::_V1::image_channel_type::unorm_short_565
@ unorm_short_565
sycl::_V1::detail::image_common::get_property
propertyT get_property() const
Definition: image.hpp:289
std::hash< sycl::sampled_image< Dimensions, AllocatorT > >::operator()
size_t operator()(const sycl::sampled_image< Dimensions, AllocatorT > &I) const
Definition: image.hpp:1039
sycl::_V1::image::operator==
bool operator==(const image &rhs) const
Definition: image.hpp:586
sycl::_V1::detail::FormatChannelType
image_channel_type FormatChannelType(image_format Format)
Definition: image.hpp:107
std
Definition: accessor.hpp:3914
sycl::_V1::image::get_access
accessor< detail::EnableIfImgAccDataT< DataT >, Dimensions, AccessMode, access::target::host_image, access::placeholder::false_t, ext::oneapi::accessor_property_list<> > get_access()
Definition: image.hpp:632
sycl_mem_obj_allocator.hpp
sycl::_V1::detail::is_contained
Definition: type_list.hpp:55
sycl::_V1::image::image
image(const void *HostPointer, image_channel_order Order, image_channel_type Type, const range< Dimensions > &Range, AllocatorT Allocator, const property_list &PropList={})
Definition: image.hpp:486
sycl::_V1::image_channel_order::argb
@ argb
sampler.hpp
sycl::_V1::image_channel_order::r
@ r
sycl::_V1::unsampled_image::unsampled_image
unsampled_image(std::shared_ptr< void > &HostPointer, image_format Format, const range< Dimensions > &Range, AllocatorT Allocator, const property_list &PropList={})
Definition: image.hpp:813
sycl::_V1::detail::image_plain
Definition: image.hpp:156
sycl::_V1::image_format
image_format
Definition: image.hpp:75
sycl::_V1::unsampled_image::unsampled_image
unsampled_image(image_format Format, const range< Dimensions > &Range, const range< Dimensions - 1 > &Pitch, const property_list &PropList={})
Definition: image.hpp:728
sycl::_V1::image::image
image(void *HostPointer, image_channel_order Order, image_channel_type Type, const range< Dimensions > &Range, const typename std::enable_if_t< B, range< Dimensions - 1 >> &Pitch, AllocatorT Allocator, const property_list &PropList={})
Definition: image.hpp:510
sycl::_V1::detail::image_plain::impl
std::shared_ptr< detail::image_impl > impl
Definition: image.hpp:273
sycl::_V1::image_format::r16g16b16a16_sint
@ r16g16b16a16_sint
sycl::_V1::image::image
image(image_channel_order Order, image_channel_type Type, const range< Dimensions > &Range, const typename std::enable_if_t< B, range< Dimensions - 1 >> &Pitch, AllocatorT Allocator, const property_list &PropList={})
Definition: image.hpp:449
sycl::_V1::image_channel_type::signed_int32
@ signed_int32
sycl::_V1::detail::image_common::has_property
bool has_property() const noexcept
Definition: image.hpp:285
sycl::_V1::image_channel_type
image_channel_type
Definition: image.hpp:56
sycl::_V1::image_channel_order::abgr
@ abgr
sycl::_V1::image_channel_order::luminance
@ luminance
sycl::_V1::unsampled_image::host_unsampled_image_accessor
friend class host_unsampled_image_accessor
Definition: image.hpp:903
sycl::_V1::sampled_image_accessor
Definition: accessor.hpp:3736
sycl::_V1::detail::EnableIfImgAccDataT
typename std::enable_if_t< is_validImageDataT< DataT >::value, DataT > EnableIfImgAccDataT
Definition: image.hpp:105
sycl::_V1::AccessMode
class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(local_accessor) local_accessor class __SYCL_EBO __SYCL_SPECIAL_CLASS AccessMode
Definition: accessor.hpp:3059
sycl::_V1::detail::unsampled_image_common::set_final_data
void set_final_data(Destination finalData=nullptr)
Definition: image.hpp:326
sycl::_V1::image::image
image(const void *HostPointer, image_channel_order Order, image_channel_type Type, const range< Dimensions > &Range, const property_list &PropList={})
Definition: image.hpp:477
sycl::_V1::image_channel_type::unorm_int16
@ unorm_int16
sycl::_V1::image::image
image(void *HostPointer, image_channel_order Order, image_channel_type Type, const range< Dimensions > &Range, const property_list &PropList={})
Definition: image.hpp:460
sycl::_V1::sampled_image
Definition: image.hpp:911
sycl::_V1::sampled_image::operator==
bool operator==(const sampled_image &rhs) const
Definition: image.hpp:981
sycl::_V1::image_target
image_target
Definition: access.hpp:65
sycl::_V1::unsampled_image
Definition: image.hpp:696
sycl::_V1::detail::getSyclObjImpl
decltype(Obj::impl) getSyclObjImpl(const Obj &SyclObject)
Definition: common.hpp:302
sycl::_V1::context
The context class represents a SYCL context on which kernel functions may be executed.
Definition: context.hpp:41
sycl::_V1::unsampled_image::get_access
unsampled_image_accessor< DataT, Dimensions, AccessMode, AccessTarget > get_access(handler &CommandGroupHandlerRef, const property_list &PropList={})
Definition: image.hpp:881