image create check

Signed-off-by: John Falkowski <john.falkowski@intel.com>
This commit is contained in:
John Falkowski
2022-10-25 17:46:52 +00:00
committed by Compute-Runtime-Automation
parent 0eb090a451
commit 333906e278
2 changed files with 24 additions and 0 deletions

View File

@@ -352,6 +352,12 @@ ze_result_t DeviceImp::getCommandQueueGroupProperties(uint32_t *pCount,
ze_result_t DeviceImp::createImage(const ze_image_desc_t *desc, ze_image_handle_t *phImage) {
auto productFamily = neoDevice->getHardwareInfo().platform.eProductFamily;
Image *pImage = nullptr;
if (neoDevice->getDeviceInfo().imageSupport == false) {
*phImage = nullptr;
return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
}
auto result = Image::create(productFamily, this, desc, &pImage);
if (result == ZE_RESULT_SUCCESS) {
*phImage = pImage->toHandle();