Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,9 @@ void *pitched_alloc_device(size_t *resultPitch,

This function will allocate a memory region aimed to be used for
two-dimensional images. It allocates memory that is guaranteed to
adhere to the device's alignment requirements for USM images.
adhere to the device's alignment requirements for USM images. E.g.,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that we need to clarify the pitched_alloc_device API entry point, because it is guaranteed to return the right thing for a user.

What we should clarify is a case described below, where user does not wish to use the pitched_alloc_device, but instead another USM allocation function which on its own may not follow any requirements for images.

I would maybe suggest renaming the section into "Alignment restrictions and queries" to generalize it and add a paragraph (either at the beginning, or at the end) saying that base USM pointer that use used as a storage for an image may have additional backend-specific requirements for the alignment. For example, for OpenCL and Level Zero backend the base USM pointer that is used as an image storage must be aligned to a pixel size.

for Level Zero and OpenCL, the USM base pointer is aligned to the
number of pixels.

If the user does not wish to use `pitched_alloc_device` to allocate
two-dimensional USM images, but prefers to use another USM allocation
Expand Down