DPC++ Runtime
Runtime libraries for oneAPI DPC++
image_impl.cpp
Go to the documentation of this file.
1 //==------------ image_impl.cpp --------------------------------------------==//
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 
11 #include <CL/sycl/image.hpp>
12 #include <detail/context_impl.hpp>
13 
14 #include <algorithm>
15 #include <vector>
16 
18 namespace sycl {
19 namespace detail {
20 
21 template <info::device Param>
22 static bool checkImageValueRange(const std::vector<device> &Devices,
23  const size_t Value) {
24  return Value >= 1 && std::all_of(Devices.cbegin(), Devices.cend(),
25  [Value](const device &Dev) {
26  return Value <= Dev.get_info<Param>();
27  });
28 }
29 
30 template <typename T, typename... Args> static bool checkAnyImpl(T) {
31  return false;
32 }
33 
34 template <typename ValT, typename VarT, typename... Args>
35 static bool checkAnyImpl(ValT Value, VarT Variant, Args... Arguments) {
36  return (Value == Variant) ? true : checkAnyImpl(Value, Arguments...);
37 }
38 
39 template <typename T, typename... Args>
40 static bool checkAny(const T Value, Args... Arguments) {
41  return checkAnyImpl(Value, Arguments...);
42 }
43 
45  switch (Order) {
46  case image_channel_order::a:
47  case image_channel_order::r:
48  case image_channel_order::rx:
49  case image_channel_order::intensity:
50  case image_channel_order::luminance:
51  return 1;
52  case image_channel_order::rg:
53  case image_channel_order::rgx:
54  case image_channel_order::ra:
55  return 2;
56  case image_channel_order::rgb:
57  return 3;
58  case image_channel_order::rgbx:
59  case image_channel_order::rgba:
60  case image_channel_order::argb:
61  case image_channel_order::bgra:
62  case image_channel_order::abgr:
63  case image_channel_order::ext_oneapi_srgba:
64  return 4;
65  }
66  assert(false && "Unhandled image channel order");
67  return 0;
68 }
69 
70 // Returns the number of bytes per image element
71 uint8_t getImageElementSize(uint8_t NumChannels, image_channel_type Type) {
72  size_t Retval = 0;
73  switch (Type) {
74  case image_channel_type::snorm_int8:
75  case image_channel_type::unorm_int8:
76  case image_channel_type::signed_int8:
77  case image_channel_type::unsigned_int8:
78  Retval = NumChannels;
79  break;
80  case image_channel_type::snorm_int16:
81  case image_channel_type::unorm_int16:
82  case image_channel_type::signed_int16:
83  case image_channel_type::unsigned_int16:
84  case image_channel_type::fp16:
85  Retval = 2 * NumChannels;
86  break;
87  case image_channel_type::signed_int32:
88  case image_channel_type::unsigned_int32:
89  case image_channel_type::fp32:
90  Retval = 4 * NumChannels;
91  break;
92  case image_channel_type::unorm_short_565:
93  case image_channel_type::unorm_short_555:
94  Retval = 2;
95  break;
96  case image_channel_type::unorm_int_101010:
97  Retval = 4;
98  break;
99  }
100  // OpenCL states that "The number of bits per element determined by the
101  // image_channel_type and image_channel_order must be a power of two"
102  // Retval is in bytes. The formula remains the same for bytes or bits.
103  assert(((Retval - 1) & Retval) == 0);
104  return Retval;
105 }
106 
108  switch (Order) {
109  case image_channel_order::a:
111  case image_channel_order::r:
113  case image_channel_order::rx:
115  case image_channel_order::rg:
117  case image_channel_order::rgx:
119  case image_channel_order::ra:
121  case image_channel_order::rgb:
123  case image_channel_order::rgbx:
125  case image_channel_order::rgba:
127  case image_channel_order::argb:
129  case image_channel_order::bgra:
131  case image_channel_order::intensity:
133  case image_channel_order::luminance:
135  case image_channel_order::abgr:
137  case image_channel_order::ext_oneapi_srgba:
139  }
140  assert(false && "Unhandled image_channel_order");
141  return static_cast<RT::PiMemImageChannelOrder>(0);
142 }
143 
145  switch (Order) {
147  return image_channel_order::a;
149  return image_channel_order::r;
151  return image_channel_order::rx;
153  return image_channel_order::rg;
155  return image_channel_order::rgx;
157  return image_channel_order::ra;
159  return image_channel_order::rgb;
161  return image_channel_order::rgbx;
163  return image_channel_order::rgba;
165  return image_channel_order::argb;
167  return image_channel_order::bgra;
169  return image_channel_order::intensity;
171  return image_channel_order::luminance;
173  return image_channel_order::abgr;
175  return image_channel_order::ext_oneapi_srgba;
176  }
177  assert(false && "Unhandled image_channel_order");
178  return static_cast<image_channel_order>(0);
179 }
180 
182  switch (Type) {
183  case image_channel_type::snorm_int8:
185  case image_channel_type::snorm_int16:
187  case image_channel_type::unorm_int8:
189  case image_channel_type::unorm_int16:
191  case image_channel_type::unorm_short_565:
193  case image_channel_type::unorm_short_555:
195  case image_channel_type::unorm_int_101010:
197  case image_channel_type::signed_int8:
199  case image_channel_type::signed_int16:
201  case image_channel_type::signed_int32:
203  case image_channel_type::unsigned_int8:
205  case image_channel_type::unsigned_int16:
207  case image_channel_type::unsigned_int32:
209  case image_channel_type::fp16:
211  case image_channel_type::fp32:
213  }
214  assert(false && "Unhandled image_channel_order");
215  return static_cast<RT::PiMemImageChannelType>(0);
216 }
217 
219  switch (Type) {
221  return image_channel_type::snorm_int8;
223  return image_channel_type::snorm_int16;
225  return image_channel_type::unorm_int8;
227  return image_channel_type::unorm_int16;
229  return image_channel_type::unorm_short_565;
231  return image_channel_type::unorm_short_555;
233  return image_channel_type::unorm_int_101010;
235  return image_channel_type::signed_int8;
237  return image_channel_type::signed_int16;
239  return image_channel_type::signed_int32;
241  return image_channel_type::unsigned_int8;
243  return image_channel_type::unsigned_int16;
245  return image_channel_type::unsigned_int32;
247  return image_channel_type::fp16;
249  return image_channel_type::fp32;
250  }
251  assert(false && "Unhandled image_channel_order");
252  return static_cast<image_channel_type>(0);
253 }
254 
255 template <typename T>
256 static void getImageInfo(const ContextImplPtr Context, RT::PiMemImageInfo Info,
257  T &Dest, RT::PiMem InteropMemObject) {
258  const detail::plugin &Plugin = Context->getPlugin();
259  RT::PiMem Mem = pi::cast<RT::PiMem>(InteropMemObject);
260  Plugin.call<PiApiKind::piMemImageGetInfo>(Mem, Info, sizeof(T), &Dest,
261  nullptr);
262 }
263 
264 template <int Dimensions>
266  cl_mem MemObject, const context &SyclContext, event AvailableEvent,
267  std::unique_ptr<SYCLMemObjAllocator> Allocator)
268  : BaseT(MemObject, SyclContext, std::move(AvailableEvent),
269  std::move(Allocator)),
270  MRange(InitializedVal<Dimensions, range>::template get<0>()) {
271  RT::PiMem Mem = pi::cast<RT::PiMem>(BaseT::MInteropMemObject);
272  const ContextImplPtr Context = getSyclObjImpl(SyclContext);
273  const detail::plugin &Plugin = Context->getPlugin();
274  Plugin.call<PiApiKind::piMemGetInfo>(Mem, PI_MEM_SIZE, sizeof(size_t),
275  &(BaseT::MSizeInBytes), nullptr);
276 
277  RT::PiMemImageFormat Format;
278  getImageInfo(Context, PI_IMAGE_INFO_FORMAT, Format, Mem);
279  MOrder = detail::convertChannelOrder(Format.image_channel_order);
280  MType = detail::convertChannelType(Format.image_channel_data_type);
281  MNumChannels = getImageNumberChannels(MOrder);
282 
283  getImageInfo(Context, PI_IMAGE_INFO_ELEMENT_SIZE, MElementSize, Mem);
284  assert(getImageElementSize(MNumChannels, MType) == MElementSize);
285 
286  getImageInfo(Context, PI_IMAGE_INFO_ROW_PITCH, MRowPitch, Mem);
287  getImageInfo(Context, PI_IMAGE_INFO_SLICE_PITCH, MSlicePitch, Mem);
288 
289  switch (Dimensions) {
290  case 3:
291  getImageInfo(Context, PI_IMAGE_INFO_DEPTH, MRange[2], Mem);
293  case 2:
294  getImageInfo(Context, PI_IMAGE_INFO_HEIGHT, MRange[1], Mem);
296  case 1:
297  getImageInfo(Context, PI_IMAGE_INFO_WIDTH, MRange[0], Mem);
298  }
299 }
300 
301 template <int Dimensions>
303  bool InitFromUserData, void *HostPtr,
304  RT::PiEvent &OutEventToWait) {
305  bool HostPtrReadOnly = false;
306  BaseT::determineHostPtr(Context, InitFromUserData, HostPtr, HostPtrReadOnly);
307 
308  RT::PiMemImageDesc Desc = getImageDesc(HostPtr != nullptr);
309  assert(checkImageDesc(Desc, Context, HostPtr) &&
310  "The check an image desc failed.");
311 
312  RT::PiMemImageFormat Format = getImageFormat();
313  assert(checkImageFormat(Format, Context) &&
314  "The check an image format failed.");
315 
317  std::move(Context), this, HostPtr, HostPtrReadOnly, BaseT::getSize(),
318  Desc, Format, BaseT::MInteropEvent, BaseT::MInteropContext, MProps,
319  OutEventToWait);
320 }
321 
322 template <int Dimensions>
324  ContextImplPtr Context,
325  void *UserPtr) {
328  !checkImageValueRange<info::device::image2d_max_width>(
329  getDevices(Context), Desc.image_width))
330  throw invalid_parameter_error(
331  "For a 1D/2D image/image array, the width must be a Value >= 1 and "
332  "<= info::device::image2d_max_width",
333  PI_ERROR_INVALID_VALUE);
334 
336  !checkImageValueRange<info::device::image3d_max_width>(
337  getDevices(Context), Desc.image_width))
338  throw invalid_parameter_error(
339  "For a 3D image, the width must be a Value >= 1 and <= "
340  "info::device::image3d_max_width",
341  PI_ERROR_INVALID_VALUE);
342 
345  !checkImageValueRange<info::device::image2d_max_height>(
346  getDevices(Context), Desc.image_height))
347  throw invalid_parameter_error("For a 2D image or image array, the height "
348  "must be a Value >= 1 and <= "
349  "info::device::image2d_max_height",
350  PI_ERROR_INVALID_VALUE);
351 
353  !checkImageValueRange<info::device::image3d_max_height>(
354  getDevices(Context), Desc.image_height))
355  throw invalid_parameter_error(
356  "For a 3D image, the heightmust be a Value >= 1 and <= "
357  "info::device::image3d_max_height",
358  PI_ERROR_INVALID_VALUE);
359 
361  !checkImageValueRange<info::device::image3d_max_depth>(
362  getDevices(Context), Desc.image_depth))
363  throw invalid_parameter_error(
364  "For a 3D image, the depth must be a Value >= 1 and <= "
365  "info::device::image2d_max_depth",
366  PI_ERROR_INVALID_VALUE);
367 
370  !checkImageValueRange<info::device::image_max_array_size>(
371  getDevices(Context), Desc.image_array_size))
372  throw invalid_parameter_error(
373  "For a 1D and 2D image array, the array_size must be a "
374  "Value >= 1 and <= info::device::image_max_array_size.",
375  PI_ERROR_INVALID_VALUE);
376 
377  if ((nullptr == UserPtr) && (0 != Desc.image_row_pitch))
378  throw invalid_parameter_error(
379  "The row_pitch must be 0 if host_ptr is nullptr.",
380  PI_ERROR_INVALID_VALUE);
381 
382  if ((nullptr == UserPtr) && (0 != Desc.image_slice_pitch))
383  throw invalid_parameter_error(
384  "The slice_pitch must be 0 if host_ptr is nullptr.",
385  PI_ERROR_INVALID_VALUE);
386 
387  if (0 != Desc.num_mip_levels)
388  throw invalid_parameter_error("The mip_levels must be 0.",
389  PI_ERROR_INVALID_VALUE);
390 
391  if (0 != Desc.num_samples)
392  throw invalid_parameter_error("The num_samples must be 0.",
393  PI_ERROR_INVALID_VALUE);
394 
395  if (nullptr != Desc.buffer)
396  throw invalid_parameter_error(
397  "The buffer must be nullptr, because SYCL does not support "
398  "image creation from memory objects.",
399  PI_ERROR_INVALID_VALUE);
400 
401  return true;
402 }
403 
404 template <int Dimensions>
406  const RT::PiMemImageFormat &Format, ContextImplPtr Context) {
407  (void)Context;
410  !checkAny(
415  throw invalid_parameter_error(
416  "CL_INTENSITY or CL_LUMINANCE format can only be used if channel "
417  "data type = CL_UNORM_INT8, CL_UNORM_INT16, CL_SNORM_INT8, "
418  "CL_SNORM_INT16, CL_HALF_FLOAT, or CL_FLOAT.",
419  PI_ERROR_INVALID_VALUE);
420 
427  throw invalid_parameter_error(
428  "type = CL_UNORM_SHORT_565, CL_UNORM_SHORT_555 or "
429  "CL_UNORM_INT_101010."
430  "These channel types can only be used with CL_RGB or CL_RGBx channel "
431  "order.",
432  PI_ERROR_INVALID_VALUE);
433 
436  !checkAny(
440  throw invalid_parameter_error(
441  "CL_ARGB, CL_BGRA, CL_ABGR These formats can only be used if "
442  "channel data type = CL_UNORM_INT8, CL_SNORM_INT8, CL_SIGNED_INT8 "
443  "or CL_UNSIGNED_INT8.",
444  PI_ERROR_INVALID_VALUE);
445 
446  return true;
447 }
448 
449 template <int Dimensions>
450 std::vector<device>
451 image_impl<Dimensions>::getDevices(const ContextImplPtr Context) {
452  return Context->get_info<info::context::devices>();
453 }
454 
455 template class image_impl<1>;
456 template class image_impl<2>;
457 template class image_impl<3>;
458 
459 } // namespace detail
460 } // namespace sycl
461 } // __SYCL_INLINE_NAMESPACE(cl)
_pi_image_desc::num_samples
pi_uint32 num_samples
Definition: pi.h:905
cl::sycl::detail::getImageElementSize
uint8_t getImageElementSize(uint8_t NumChannels, image_channel_type Type)
Definition: image_impl.cpp:71
PI_IMAGE_INFO_ROW_PITCH
@ PI_IMAGE_INFO_ROW_PITCH
Definition: pi.h:341
_pi_mem
PI Mem mapping to CUDA memory allocations, both data and texture/surface.
Definition: pi_cuda.hpp:221
piMemGetInfo
pi_result piMemGetInfo(pi_mem mem, pi_mem_info param_name, size_t param_value_size, void *param_value, size_t *param_value_size_ret)
Definition: pi_esimd_emulator.cpp:1073
_pi_image_desc::image_array_size
size_t image_array_size
Definition: pi.h:901
cl::sycl::detail::SYCLMemObjT::MSizeInBytes
size_t MSizeInBytes
Definition: sycl_mem_obj_t.hpp:342
cl::sycl::detail::MemoryManager::allocateMemImage
static void * allocateMemImage(ContextImplPtr TargetContext, SYCLMemObjI *MemObj, void *UserPtr, bool HostPtrReadOnly, size_t Size, const RT::PiMemImageDesc &Desc, const RT::PiMemImageFormat &Format, const EventImplPtr &InteropEvent, const ContextImplPtr &InteropContext, const sycl::property_list &PropsList, RT::PiEvent &OutEventToWait)
Definition: memory_manager.cpp:406
PI_MEM_TYPE_IMAGE1D
@ PI_MEM_TYPE_IMAGE1D
Definition: pi.h:400
cl::sycl::detail::ContextImplPtr
std::shared_ptr< detail::context_impl > ContextImplPtr
Definition: memory_manager.hpp:31
PI_IMAGE_CHANNEL_ORDER_A
@ PI_IMAGE_CHANNEL_ORDER_A
Definition: pi.h:421
PI_IMAGE_CHANNEL_TYPE_UNORM_SHORT_565
@ PI_IMAGE_CHANNEL_TYPE_UNORM_SHORT_565
Definition: pi.h:443
context_impl.hpp
PI_IMAGE_CHANNEL_TYPE_HALF_FLOAT
@ PI_IMAGE_CHANNEL_TYPE_HALF_FLOAT
Definition: pi.h:452
_pi_image_format::image_channel_data_type
pi_image_channel_type image_channel_data_type
Definition: pi.h:893
cl::sycl::event
An event object can be used to synchronize memory transfers, enqueues of kernels and signaling barrie...
Definition: event.hpp:32
PI_IMAGE_CHANNEL_TYPE_UNORM_INT8
@ PI_IMAGE_CHANNEL_TYPE_UNORM_INT8
Definition: pi.h:441
PI_IMAGE_CHANNEL_ORDER_INTENSITY
@ PI_IMAGE_CHANNEL_ORDER_INTENSITY
Definition: pi.h:430
_pi_image_format::image_channel_order
pi_image_channel_order image_channel_order
Definition: pi.h:892
_pi_image_desc::image_type
pi_mem_type image_type
Definition: pi.h:897
PI_IMAGE_INFO_FORMAT
@ PI_IMAGE_INFO_FORMAT
Definition: pi.h:339
cl::sycl::detail::getImageInfo
static void getImageInfo(const ContextImplPtr Context, RT::PiMemImageInfo Info, T &Dest, RT::PiMem InteropMemObject)
Definition: image_impl.cpp:256
cl::sycl::detail::image_impl
Definition: image_impl.hpp:70
PI_IMAGE_CHANNEL_TYPE_SIGNED_INT8
@ PI_IMAGE_CHANNEL_TYPE_SIGNED_INT8
Definition: pi.h:446
cl::sycl::detail::checkAnyImpl
static bool checkAnyImpl(ValT Value, VarT Variant, Args... Arguments)
Definition: image_impl.cpp:35
cl::sycl::detail::InitializedVal
Definition: common.hpp:227
PI_IMAGE_CHANNEL_ORDER_RG
@ PI_IMAGE_CHANNEL_ORDER_RG
Definition: pi.h:423
PI_IMAGE_INFO_SLICE_PITCH
@ PI_IMAGE_INFO_SLICE_PITCH
Definition: pi.h:342
PI_MEM_SIZE
@ PI_MEM_SIZE
Definition: pi.h:912
PI_IMAGE_CHANNEL_ORDER_RGBx
@ PI_IMAGE_CHANNEL_ORDER_RGBx
Definition: pi.h:434
__SYCL_FALLTHROUGH
#define __SYCL_FALLTHROUGH
Definition: defines_elementary.hpp:88
sycl
Definition: invoke_simd.hpp:68
PI_IMAGE_CHANNEL_TYPE_SNORM_INT16
@ PI_IMAGE_CHANNEL_TYPE_SNORM_INT16
Definition: pi.h:440
_pi_image_desc::image_height
size_t image_height
Definition: pi.h:899
PI_IMAGE_CHANNEL_ORDER_BGRA
@ PI_IMAGE_CHANNEL_ORDER_BGRA
Definition: pi.h:427
cl::sycl::info::context::devices
@ devices
cl::sycl::detail::SYCLMemObjT::MInteropMemObject
RT::PiMem MInteropMemObject
Definition: sycl_mem_obj_t.hpp:333
_pi_image_desc::image_slice_pitch
size_t image_slice_pitch
Definition: pi.h:903
_pi_image_info
_pi_image_info
Definition: pi.h:338
cl::sycl::range
Defines the iteration domain of either a single work-group in a parallel dispatch,...
Definition: buffer.hpp:24
cl::sycl::detail::get
Definition: tuple.hpp:59
cl::sycl::detail::getImageNumberChannels
uint8_t getImageNumberChannels(image_channel_order Order)
Definition: image_impl.cpp:44
PI_IMAGE_CHANNEL_ORDER_LUMINANCE
@ PI_IMAGE_CHANNEL_ORDER_LUMINANCE
Definition: pi.h:431
PI_IMAGE_CHANNEL_TYPE_SIGNED_INT16
@ PI_IMAGE_CHANNEL_TYPE_SIGNED_INT16
Definition: pi.h:447
PI_IMAGE_CHANNEL_TYPE_SIGNED_INT32
@ PI_IMAGE_CHANNEL_TYPE_SIGNED_INT32
Definition: pi.h:448
_pi_image_desc::image_depth
size_t image_depth
Definition: pi.h:900
cl::sycl::device
The SYCL device class encapsulates a single SYCL device on which kernels may be executed.
Definition: device.hpp:36
cl::sycl::detail::convertChannelOrder
RT::PiMemImageChannelOrder convertChannelOrder(image_channel_order Order)
Definition: image_impl.cpp:107
PI_MEM_TYPE_IMAGE2D
@ PI_MEM_TYPE_IMAGE2D
Definition: pi.h:397
image_impl.hpp
PI_IMAGE_CHANNEL_ORDER_R
@ PI_IMAGE_CHANNEL_ORDER_R
Definition: pi.h:422
_pi_image_channel_order
_pi_image_channel_order
Definition: pi.h:420
PI_IMAGE_CHANNEL_TYPE_FLOAT
@ PI_IMAGE_CHANNEL_TYPE_FLOAT
Definition: pi.h:453
cl::sycl::detail::image_impl::allocateMem
void * allocateMem(ContextImplPtr Context, bool InitFromUserData, void *HostPtr, RT::PiEvent &OutEventToWait) override
Definition: image_impl.cpp:302
PI_MEM_TYPE_IMAGE1D_ARRAY
@ PI_MEM_TYPE_IMAGE1D_ARRAY
Definition: pi.h:401
PI_IMAGE_INFO_DEPTH
@ PI_IMAGE_INFO_DEPTH
Definition: pi.h:345
cl::sycl::detail::plugin::call
void call(ArgsT... Args) const
Calls the API, traces the call, checks the result.
Definition: plugin.hpp:217
cl
We provide new interfaces for matrix muliply in this patch:
Definition: access.hpp:13
piMemImageGetInfo
pi_result piMemImageGetInfo(pi_mem image, pi_image_info param_name, size_t param_value_size, void *param_value, size_t *param_value_size_ret)
Definition: pi_esimd_emulator.cpp:1665
PI_IMAGE_CHANNEL_ORDER_sRGBA
@ PI_IMAGE_CHANNEL_ORDER_sRGBA
Definition: pi.h:435
_pi_image_desc::buffer
pi_mem buffer
Definition: pi.h:906
PI_IMAGE_CHANNEL_TYPE_UNSIGNED_INT16
@ PI_IMAGE_CHANNEL_TYPE_UNSIGNED_INT16
Definition: pi.h:450
PI_IMAGE_INFO_WIDTH
@ PI_IMAGE_INFO_WIDTH
Definition: pi.h:343
cl::sycl::detail::plugin
The plugin class provides a unified interface to the underlying low-level runtimes for the device-agn...
Definition: plugin.hpp:90
PI_IMAGE_CHANNEL_ORDER_RGx
@ PI_IMAGE_CHANNEL_ORDER_RGx
Definition: pi.h:433
image.hpp
_pi_image_format
Definition: pi.h:891
PI_IMAGE_CHANNEL_TYPE_UNORM_INT_101010
@ PI_IMAGE_CHANNEL_TYPE_UNORM_INT_101010
Definition: pi.h:445
cl::sycl::detail::convertChannelType
RT::PiMemImageChannelType convertChannelType(image_channel_type Type)
Definition: image_impl.cpp:181
PI_IMAGE_CHANNEL_ORDER_RGBA
@ PI_IMAGE_CHANNEL_ORDER_RGBA
Definition: pi.h:426
all_of
bool all_of(const simd_mask< _Tp, _Abi > &) noexcept
PI_IMAGE_CHANNEL_ORDER_ABGR
@ PI_IMAGE_CHANNEL_ORDER_ABGR
Definition: pi.h:429
_pi_image_desc::image_width
size_t image_width
Definition: pi.h:898
_pi_image_channel_type
_pi_image_channel_type
Definition: pi.h:438
cl::sycl::detail::getSyclObjImpl
decltype(Obj::impl) getSyclObjImpl(const Obj &SyclObject)
Definition: common.hpp:204
PI_IMAGE_CHANNEL_TYPE_UNSIGNED_INT8
@ PI_IMAGE_CHANNEL_TYPE_UNSIGNED_INT8
Definition: pi.h:449
PI_IMAGE_CHANNEL_TYPE_UNSIGNED_INT32
@ PI_IMAGE_CHANNEL_TYPE_UNSIGNED_INT32
Definition: pi.h:451
_pi_image_desc::image_row_pitch
size_t image_row_pitch
Definition: pi.h:902
PI_IMAGE_CHANNEL_TYPE_UNORM_SHORT_555
@ PI_IMAGE_CHANNEL_TYPE_UNORM_SHORT_555
Definition: pi.h:444
PI_IMAGE_CHANNEL_ORDER_ARGB
@ PI_IMAGE_CHANNEL_ORDER_ARGB
Definition: pi.h:428
_pi_image_desc
Definition: pi.h:896
std
Definition: accessor.hpp:2617
_pi_event
PI Event mapping to CUevent.
Definition: pi_cuda.hpp:590
PI_MEM_TYPE_IMAGE2D_ARRAY
@ PI_MEM_TYPE_IMAGE2D_ARRAY
Definition: pi.h:399
cl::sycl::detail::checkAny
static bool checkAny(const T Value, Args... Arguments)
Definition: image_impl.cpp:40
cl::sycl::context
The context class represents a SYCL context on which kernel functions may be executed.
Definition: context.hpp:38
PI_IMAGE_CHANNEL_ORDER_RA
@ PI_IMAGE_CHANNEL_ORDER_RA
Definition: pi.h:424
PI_IMAGE_INFO_ELEMENT_SIZE
@ PI_IMAGE_INFO_ELEMENT_SIZE
Definition: pi.h:340
cl::sycl::detail::checkImageValueRange
static bool checkImageValueRange(const std::vector< device > &Devices, const size_t Value)
Definition: image_impl.cpp:22
PI_IMAGE_CHANNEL_ORDER_RGB
@ PI_IMAGE_CHANNEL_ORDER_RGB
Definition: pi.h:425
cl::sycl::image_channel_type
image_channel_type
Definition: image.hpp:41
PI_IMAGE_INFO_HEIGHT
@ PI_IMAGE_INFO_HEIGHT
Definition: pi.h:344
cl::sycl::detail::SYCLMemObjT
Definition: sycl_mem_obj_t.hpp:39
_pi_image_desc::num_mip_levels
pi_uint32 num_mip_levels
Definition: pi.h:904
cl::sycl::Dimensions
Dimensions
Definition: backend.hpp:142
PI_MEM_TYPE_IMAGE3D
@ PI_MEM_TYPE_IMAGE3D
Definition: pi.h:398
PI_IMAGE_CHANNEL_TYPE_SNORM_INT8
@ PI_IMAGE_CHANNEL_TYPE_SNORM_INT8
Definition: pi.h:439
cl::sycl::image_channel_order
image_channel_order
Definition: image.hpp:23
PI_IMAGE_CHANNEL_TYPE_UNORM_INT16
@ PI_IMAGE_CHANNEL_TYPE_UNORM_INT16
Definition: pi.h:442
PI_IMAGE_CHANNEL_ORDER_Rx
@ PI_IMAGE_CHANNEL_ORDER_Rx
Definition: pi.h:432
__SYCL_INLINE_NAMESPACE
#define __SYCL_INLINE_NAMESPACE(X)
Definition: defines_elementary.hpp:12
memory_manager.hpp