24 inline namespace _V1 {
30 template <int Dimensions, typename AllocatorT> class
image;
31 template <typename DataT, int Dimensions, access::mode AccessMode,
32 access::target AccessTarget, access::placeholder IsPlaceholder,
33 typename property_listT>
67 size_t WHD[3] = {1, 1, 1};
68 for (
int I = 0; I < MDimensions; I++)
71 MRowPitch = MElementSize * WHD[0];
72 MSlicePitch = MRowPitch * WHD[1];
73 BaseT::MSizeInBytes = MSlicePitch * WHD[2];
76 void setPitches(
const range<2> &Pitch) {
79 (MDimensions == 3) ? Pitch[1] : MRowPitch;
82 (MDimensions == 3) ? MRange[2] : MRange[1];
84 BaseT::MSizeInBytes = MSlicePitch * NumSlices;
90 std::unique_ptr<SYCLMemObjAllocator> Allocator, uint8_t
Dimensions,
92 :
image_impl((
void *)
nullptr, Order, Type, ImageRange,
97 std::unique_ptr<SYCLMemObjAllocator> Allocator, uint8_t
Dimensions,
99 :
image_impl((
void *)
nullptr, Order, Type, ImageRange, Pitch,
100 std::move(Allocator),
Dimensions, PropList) {}
104 std::unique_ptr<SYCLMemObjAllocator> Allocator, uint8_t
Dimensions,
106 : BaseT(PropList, std::move(Allocator)), MDimensions(
Dimensions),
107 MRange(ImageRange), MOrder(Order), MType(Type),
116 std::unique_ptr<SYCLMemObjAllocator> Allocator, uint8_t
Dimensions,
118 : BaseT(PropList, std::move(Allocator)), MDimensions(
Dimensions),
119 MRange(ImageRange), MOrder(Order), MType(Type),
128 std::unique_ptr<SYCLMemObjAllocator> Allocator, uint8_t
Dimensions,
130 : BaseT(PropList, std::move(Allocator)), MDimensions(
Dimensions),
131 MRange(ImageRange), MOrder(Order), MType(Type),
141 std::unique_ptr<SYCLMemObjAllocator> Allocator, uint8_t
Dimensions,
144 MRange(ImageRange), MOrder(Order), MType(Type),
148 BaseT::handleHostData(std::const_pointer_cast<void>(HData),
155 std::unique_ptr<SYCLMemObjAllocator> Allocator, uint8_t
Dimensions,
158 MRange(ImageRange), MOrder(Order), MType(Type),
162 BaseT::handleHostData(std::const_pointer_cast<void>(HData),
169 std::unique_ptr<SYCLMemObjAllocator> Allocator, uint8_t
Dimensions,
171 : BaseT(PropList, std::move(Allocator)), MDimensions(
Dimensions),
172 MRange(ImageRange), MOrder(Order), MType(Type),
183 std::unique_ptr<SYCLMemObjAllocator> Allocator, uint8_t
Dimensions,
185 : BaseT(PropList, std::move(Allocator)), MDimensions(
Dimensions),
186 MRange(ImageRange), MOrder(Order), MType(Type),
197 std::unique_ptr<SYCLMemObjAllocator> Allocator, uint8_t
Dimensions,
200 MRange(ImageRange), MOrder(Order), MType(Type),
205 BaseT::handleHostData(std::const_pointer_cast<void>(HData),
214 std::unique_ptr<SYCLMemObjAllocator> Allocator, uint8_t
Dimensions,
217 MRange(ImageRange), MOrder(Order), MType(Type),
222 BaseT::handleHostData(std::const_pointer_cast<void>(HData),
228 std::unique_ptr<SYCLMemObjAllocator> Allocator,
232 event AvailableEvent,
233 std::unique_ptr<SYCLMemObjAllocator> Allocator, uint8_t
Dimensions,
235 bool OwnNativeHandle,
range<3> Range3WithOnes);
275 BaseT::updateHostMemory();
281 void *UserObj,
const void *HostObj,
282 uint32_t Dim,
size_t Range[3],
285 void sampledImageDestructorNotification(
void *UserObj);
290 void unsampledImageDestructorNotification(
void *UserObj);
296 if (MDimensions == 1)
298 if (MDimensions == 2)
309 constexpr
int XTermPos = 0, YTermPos = 1, ZTermPos = 2;
311 Desc.
image_height = MDimensions > 1 ? MRange[YTermPos] : 1;
312 Desc.
image_depth = MDimensions > 2 ? MRange[ZTermPos] : 1;
338 uint8_t MDimensions = 0;
339 bool MIsArrayImage =
false;
343 uint8_t MNumChannels = 0;
344 size_t MElementSize = 0;
345 size_t MRowPitch = 0;
346 size_t MSlicePitch = 0;
349 std::optional<image_sampler> MSampler = std::nullopt;
The context class represents a SYCL context on which kernel functions may be executed.
image_impl(image_channel_order Order, image_channel_type Type, const range< 3 > &ImageRange, const range< 2 > &Pitch, std::unique_ptr< SYCLMemObjAllocator > Allocator, uint8_t Dimensions, const property_list &PropList={})
image_impl(const void *HData, image_channel_order Order, image_channel_type Type, image_sampler Sampler, const range< 3 > &ImageRange, const range< 2 > &Pitch, std::unique_ptr< SYCLMemObjAllocator > Allocator, uint8_t Dimensions, const property_list &PropList={})
image_impl(const std::shared_ptr< const void > &HData, image_channel_order Order, image_channel_type Type, const range< 3 > &ImageRange, std::unique_ptr< SYCLMemObjAllocator > Allocator, uint8_t Dimensions, const property_list &PropList, bool IsConstPtr)
size_t getRowPitch() const
image_sampler getSampler() const noexcept
image_channel_type getChannelType() const
range< 3 > get_range() const
image_impl(void *HData, image_channel_order Order, image_channel_type Type, const range< 3 > &ImageRange, std::unique_ptr< SYCLMemObjAllocator > Allocator, uint8_t Dimensions, const property_list &PropList={})
size_t getElementSize() const
MemObjType getType() const override
image_impl(const void *HData, image_channel_order Order, image_channel_type Type, image_sampler Sampler, const range< 3 > &ImageRange, std::unique_ptr< SYCLMemObjAllocator > Allocator, uint8_t Dimensions, const property_list &PropList={})
image_impl(const std::shared_ptr< const void > &HData, image_channel_order Order, image_channel_type Type, image_sampler Sampler, const range< 3 > &ImageRange, const range< 2 > &Pitch, std::unique_ptr< SYCLMemObjAllocator > Allocator, uint8_t Dimensions, const property_list &PropList)
image_impl(const std::shared_ptr< const void > &HData, image_channel_order Order, image_channel_type Type, const range< 3 > &ImageRange, const range< 2 > &Pitch, std::unique_ptr< SYCLMemObjAllocator > Allocator, uint8_t Dimensions, const property_list &PropList, bool IsConstPtr)
range< 2 > get_pitch() const
image_impl(const std::shared_ptr< const void > &HData, image_channel_order Order, image_channel_type Type, image_sampler Sampler, const range< 3 > &ImageRange, std::unique_ptr< SYCLMemObjAllocator > Allocator, uint8_t Dimensions, const property_list &PropList)
size_t getSlicePitch() const
size_t size() const noexcept
image_impl(void *HData, image_channel_order Order, image_channel_type Type, const range< 3 > &ImageRange, const range< 2 > &Pitch, std::unique_ptr< SYCLMemObjAllocator > Allocator, uint8_t Dimensions, const property_list &PropList={})
image_impl(const void *HData, image_channel_order Order, image_channel_type Type, const range< 3 > &ImageRange, std::unique_ptr< SYCLMemObjAllocator > Allocator, uint8_t Dimensions, const property_list &PropList={})
image_impl(image_channel_order Order, image_channel_type Type, const range< 3 > &ImageRange, std::unique_ptr< SYCLMemObjAllocator > Allocator, uint8_t Dimensions, const property_list &PropList={})
image_channel_order getChannelOrder() const
An event object can be used to synchronize memory transfers, enqueues of kernels and signaling barrie...
Objects of the property_list class are containers for the SYCL properties.
Defines the iteration domain of either a single work-group in a parallel dispatch,...
class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor accessor(buffer< DataT, Dimensions, AllocatorT >) -> accessor< DataT, Dimensions, access::mode::read_write, target::device, access::placeholder::true_t >
Buffer accessor.
void unsampledImageConstructorNotification(void *ImageObj, void *AccessorObj, const std::optional< image_target > &Target, access::mode Mode, const void *Type, uint32_t ElemSize, const code_location &CodeLoc)
uint8_t getImageElementSize(uint8_t NumChannels, image_channel_type Type)
sycl::detail::pi::PiMemImageChannelOrder convertChannelOrder(image_channel_order Order)
std::shared_ptr< sycl::detail::context_impl > ContextImplPtr
sycl::detail::pi::PiMemObjectType getImageType(int Dimensions)
constexpr size_t getNextPowerOfTwo(size_t Var)
void sampledImageConstructorNotification(void *ImageObj, void *AccessorObj, const std::optional< image_target > &Target, const void *Type, uint32_t ElemSize, const code_location &CodeLoc)
sycl::detail::pi::PiMemImageChannelType convertChannelType(image_channel_type Type)
uint8_t getImageNumberChannels(image_channel_order Order)
std::shared_ptr< sycl::detail::context_impl > ContextImplPtr
class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(local_accessor) local_accessor class __SYCL_EBO __SYCL_SPECIAL_CLASS Dimensions
uintptr_t pi_native_handle
@ PI_MEM_TYPE_IMAGE1D_ARRAY
@ PI_MEM_TYPE_IMAGE2D_ARRAY
_Abi const simd< _Tp, _Abi > & noexcept