performance: enable staging for reads from image

Related-To: NEO-14026

Also, provide performance hint if ptr from
user does not meet restrictions.

Signed-off-by: Szymon Morek <szymon.morek@intel.com>
This commit is contained in:
Szymon Morek
2025-02-13 11:13:17 +00:00
committed by Compute-Runtime-Automation
parent 68a0aa0525
commit be2ac667fc
10 changed files with 76 additions and 29 deletions

View File

@@ -1558,4 +1558,12 @@ void CommandQueue::unregisterGpgpuAndBcsCsrClients() {
}
}
size_t CommandQueue::calculateHostPtrSizeForImage(const size_t *region, size_t rowPitch, size_t slicePitch, Image *image) {
auto bytesPerPixel = image->getSurfaceFormatInfo().surfaceFormat.imageElementSizeInBytes;
auto dstRowPitch = rowPitch ? rowPitch : region[0] * bytesPerPixel;
auto dstSlicePitch = slicePitch ? slicePitch : ((image->getImageDesc().image_type == CL_MEM_OBJECT_IMAGE1D_ARRAY ? 1 : region[1]) * dstRowPitch);
return Image::calculateHostPtrSize(region, dstRowPitch, dstSlicePitch, bytesPerPixel, image->getImageDesc().image_type);
}
} // namespace NEO