Add error code for get device info relative to images

if image are not supported

Related-To: NEO-3931
Change-Id: I527da2dc857cd15dae6535dd389378511eb71b6d
Signed-off-by: Katarzyna Cencelewska <katarzyna.cencelewska@intel.com>
This commit is contained in:
Katarzyna Cencelewska
2020-01-14 16:36:53 +01:00
committed by sys_ocldev
parent 318d9620ae
commit 1b072cf170
6 changed files with 558 additions and 59 deletions

View File

@@ -998,12 +998,14 @@ cl_int CL_API_CALL clGetSupportedImageFormats(cl_context context,
"imageFormats", imageFormats,
"numImageFormats", numImageFormats);
auto pContext = castToObject<Context>(context);
auto pPlatform = platform();
auto pDevice = pPlatform->getDevice(0);
if (pContext) {
retVal = pContext->getSupportedImageFormats(pDevice, flags, imageType, numEntries,
imageFormats, numImageFormats);
auto pDevice = pContext->getDevice(0);
if (pDevice->getHardwareInfo().capabilityTable.supportsImages) {
retVal = pContext->getSupportedImageFormats(pDevice, flags, imageType, numEntries,
imageFormats, numImageFormats);
} else {
retVal = CL_INVALID_VALUE;
}
} else {
retVal = CL_INVALID_CONTEXT;
}