SWDEV-286147 - Added image support check before using

Change-Id: I4b8ae854bf3488ef2418f0864a15b2fef0a889da


[ROCm/clr commit: 4c5c0419be]
Этот коммит содержится в:
Sarbojit Sarkar committed 2021-06-11 11:51:08 -04:00
1 родитель bd55ad07a9
Коммит b21a5c64f6
1 file changed
+5
+5
Просмотреть файл
@@ -630,6 +630,11 @@ hipError_t ihipMallocPitch(void** ptr, size_t* pitch, size_t width, size_t heigh
return hipSuccess;
}
if (device && !device->info().imageSupport_) {
LogPrintfError("Image is not supported on device %p \n", device);
return hipErrorInvalidValue;
}
const amd::Image::Format imageFormat(*image_format);
*pitch = amd::alignUp(width * imageFormat.getElementSize(), device->info().imagePitchAlignment_);