diff --git a/opencl/source/api/api.cpp b/opencl/source/api/api.cpp index dc8eb4f960..3cc9b8b8df 100644 --- a/opencl/source/api/api.cpp +++ b/opencl/source/api/api.cpp @@ -1153,7 +1153,7 @@ cl_int CL_API_CALL clGetImageParamsINTEL(cl_context context, retVal = Image::validateImageFormat(imageFormat); } if (CL_SUCCESS == retVal) { - surfaceFormat = (ClSurfaceFormatInfo *)Image::getSurfaceFormatFromTable(memFlags, imageFormat, pContext->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + surfaceFormat = (ClSurfaceFormatInfo *)Image::getSurfaceFormatFromTable(memFlags, imageFormat, pContext->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); retVal = Image::validate(pContext, MemoryPropertiesParser::createMemoryProperties(memFlags, 0, 0), surfaceFormat, imageDesc, nullptr); } if (CL_SUCCESS == retVal) { diff --git a/opencl/source/cl_device/cl_device_caps.cpp b/opencl/source/cl_device/cl_device_caps.cpp index fb8d4f111f..f1058e79b6 100644 --- a/opencl/source/cl_device/cl_device_caps.cpp +++ b/opencl/source/cl_device/cl_device_caps.cpp @@ -111,7 +111,7 @@ void ClDevice::initializeCaps() { deviceInfo.clCVersion = "OpenCL C 1.2 "; break; } - deviceInfo.platformLP = (hwInfo.capabilityTable.clVersionSupport == 12) ? true : false; + deviceInfo.platformLP = (hwInfo.capabilityTable.supportsOcl21Features == false); deviceInfo.spirVersions = spirVersions.c_str(); auto supportsVme = hwInfo.capabilityTable.supportsVme; auto supportsAdvancedVme = hwInfo.capabilityTable.supportsVme; diff --git a/opencl/source/context/context.cpp b/opencl/source/context/context.cpp index 7680178b1d..07b4fbebb4 100644 --- a/opencl/source/context/context.cpp +++ b/opencl/source/context/context.cpp @@ -308,7 +308,7 @@ cl_int Context::getSupportedImageFormats( }; if (flags & CL_MEM_READ_ONLY) { - if (this->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport >= 20) { + if (this->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features) { appendImageFormats(SurfaceFormats::readOnly20()); } else { appendImageFormats(SurfaceFormats::readOnly12()); @@ -328,7 +328,7 @@ cl_int Context::getSupportedImageFormats( appendImageFormats(SurfaceFormats::readWriteDepth()); } } else if (nv12ExtensionEnabled && (flags & CL_MEM_NO_ACCESS_INTEL)) { - if (this->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport >= 20) { + if (this->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features) { appendImageFormats(SurfaceFormats::readOnly20()); } else { appendImageFormats(SurfaceFormats::readOnly12()); diff --git a/opencl/source/gen11/hw_info_ehl.inl b/opencl/source/gen11/hw_info_ehl.inl index 750d944c20..b2b282900d 100644 --- a/opencl/source/gen11/hw_info_ehl.inl +++ b/opencl/source/gen11/hw_info_ehl.inl @@ -71,6 +71,7 @@ const RuntimeCapabilityTable EHL::capabilityTable{ true, // supportsImages true, // supportsDeviceEnqueue false, // supportsPipes + false, // supportsOcl21Features true // hostPtrTrackingEnabled }; diff --git a/opencl/source/gen11/hw_info_icllp.inl b/opencl/source/gen11/hw_info_icllp.inl index f6d3f6537f..bf78a898b0 100644 --- a/opencl/source/gen11/hw_info_icllp.inl +++ b/opencl/source/gen11/hw_info_icllp.inl @@ -72,6 +72,7 @@ const RuntimeCapabilityTable ICLLP::capabilityTable{ true, // supportsImages true, // supportsDeviceEnqueue true, // supportsPipes + true, // supportsOcl21Features true // hostPtrTrackingEnabled }; diff --git a/opencl/source/gen11/hw_info_lkf.inl b/opencl/source/gen11/hw_info_lkf.inl index b5fde8fb12..69bec3dae0 100644 --- a/opencl/source/gen11/hw_info_lkf.inl +++ b/opencl/source/gen11/hw_info_lkf.inl @@ -71,6 +71,7 @@ const RuntimeCapabilityTable LKF::capabilityTable{ true, // supportsImages true, // supportsDeviceEnqueue false, // supportsPipes + false, // supportsOcl21Features true // hostPtrTrackingEnabled }; diff --git a/opencl/source/gen12lp/hw_info_tgllp.inl b/opencl/source/gen12lp/hw_info_tgllp.inl index f3139752fa..903724c867 100644 --- a/opencl/source/gen12lp/hw_info_tgllp.inl +++ b/opencl/source/gen12lp/hw_info_tgllp.inl @@ -73,6 +73,7 @@ const RuntimeCapabilityTable TGLLP::capabilityTable{ true, // supportsImages true, // supportsDeviceEnqueue false, // supportsPipes + true, // supportsOcl21Features false // hostPtrTrackingEnabled }; diff --git a/opencl/source/gen8/hw_info_bdw.inl b/opencl/source/gen8/hw_info_bdw.inl index daa1cc1506..616c066f00 100644 --- a/opencl/source/gen8/hw_info_bdw.inl +++ b/opencl/source/gen8/hw_info_bdw.inl @@ -76,6 +76,7 @@ const RuntimeCapabilityTable BDW::capabilityTable{ true, // supportsImages true, // supportsDeviceEnqueue true, // supportsPipes + true, // supportsOcl21Features true // hostPtrTrackingEnabled }; diff --git a/opencl/source/gen9/hw_info_bxt.inl b/opencl/source/gen9/hw_info_bxt.inl index e1eb1161f7..4ef04a2768 100644 --- a/opencl/source/gen9/hw_info_bxt.inl +++ b/opencl/source/gen9/hw_info_bxt.inl @@ -73,6 +73,7 @@ const RuntimeCapabilityTable BXT::capabilityTable{ true, // supportsImages false, // supportsDeviceEnqueue false, // supportsPipes + false, // supportsOcl21Features true // hostPtrTrackingEnabled }; diff --git a/opencl/source/gen9/hw_info_cfl.inl b/opencl/source/gen9/hw_info_cfl.inl index 86d447364d..d9bcca0546 100644 --- a/opencl/source/gen9/hw_info_cfl.inl +++ b/opencl/source/gen9/hw_info_cfl.inl @@ -68,6 +68,7 @@ const RuntimeCapabilityTable CFL::capabilityTable{ true, // supportsImages true, // supportsDeviceEnqueue true, // supportsPipes + true, // supportsOcl21Features true // hostPtrTrackingEnabled }; diff --git a/opencl/source/gen9/hw_info_glk.inl b/opencl/source/gen9/hw_info_glk.inl index cca4f6dd67..24b72fada9 100644 --- a/opencl/source/gen9/hw_info_glk.inl +++ b/opencl/source/gen9/hw_info_glk.inl @@ -68,6 +68,7 @@ const RuntimeCapabilityTable GLK::capabilityTable{ true, // supportsImages false, // supportsDeviceEnqueue false, // supportsPipes + false, // supportsOcl21Features true // hostPtrTrackingEnabled }; diff --git a/opencl/source/gen9/hw_info_kbl.inl b/opencl/source/gen9/hw_info_kbl.inl index d8b9ba3087..662049521d 100644 --- a/opencl/source/gen9/hw_info_kbl.inl +++ b/opencl/source/gen9/hw_info_kbl.inl @@ -68,6 +68,7 @@ const RuntimeCapabilityTable KBL::capabilityTable{ true, // supportsImages true, // supportsDeviceEnqueue true, // supportsPipes + true, // supportsOcl21Features true // hostPtrTrackingEnabled }; diff --git a/opencl/source/gen9/hw_info_skl.inl b/opencl/source/gen9/hw_info_skl.inl index 97cb93b56c..a25a9973ef 100644 --- a/opencl/source/gen9/hw_info_skl.inl +++ b/opencl/source/gen9/hw_info_skl.inl @@ -76,6 +76,7 @@ const RuntimeCapabilityTable SKL::capabilityTable{ true, // supportsImages true, // supportsDeviceEnqueue true, // supportsPipes + true, // supportsOcl21Features true // hostPtrTrackingEnabled }; WorkaroundTable SKL::workaroundTable = {}; diff --git a/opencl/source/helpers/surface_formats.cpp b/opencl/source/helpers/surface_formats.cpp index 361fdbd610..2292f64b65 100644 --- a/opencl/source/helpers/surface_formats.cpp +++ b/opencl/source/helpers/surface_formats.cpp @@ -139,9 +139,9 @@ ArrayRef SurfaceFormats::readWriteDepth() noexcept { return ArrayRef(readWriteDepthSurfaceFormats); } -ArrayRef SurfaceFormats::surfaceFormats(cl_mem_flags flags, unsigned int clVersionSupport) noexcept { +ArrayRef SurfaceFormats::surfaceFormats(cl_mem_flags flags, bool supportsOcl20Features) noexcept { if (flags & CL_MEM_READ_ONLY) { - if(clVersionSupport >= 20 ) { + if(supportsOcl20Features) { return readOnly20(); } else { @@ -156,7 +156,7 @@ ArrayRef SurfaceFormats::surfaceFormats(cl_mem_flags } } -ArrayRef SurfaceFormats::surfaceFormats(cl_mem_flags flags, const cl_image_format *imageFormat, unsigned int clVersionSupport) noexcept { +ArrayRef SurfaceFormats::surfaceFormats(cl_mem_flags flags, const cl_image_format *imageFormat, bool supportsOcl20Features) noexcept { if (NEO::IsNV12Image(imageFormat)) { return planarYuv(); } @@ -172,7 +172,7 @@ ArrayRef SurfaceFormats::surfaceFormats(cl_mem_flags } } else if (flags & CL_MEM_READ_ONLY) { - if(clVersionSupport >= 20 ) { + if(supportsOcl20Features) { return readOnly20(); } else { diff --git a/opencl/source/helpers/surface_formats.h b/opencl/source/helpers/surface_formats.h index 66450d5fb1..8c65d3b60f 100644 --- a/opencl/source/helpers/surface_formats.h +++ b/opencl/source/helpers/surface_formats.h @@ -41,8 +41,8 @@ class SurfaceFormats { static ArrayRef readOnlyDepth() noexcept; static ArrayRef readWriteDepth() noexcept; - static ArrayRef surfaceFormats(cl_mem_flags flags, unsigned int clVersionSupport) noexcept; - static ArrayRef surfaceFormats(cl_mem_flags flags, const cl_image_format *imageFormat, unsigned int clVersionSupport) noexcept; + static ArrayRef surfaceFormats(cl_mem_flags flags, bool supportsOcl20Features) noexcept; + static ArrayRef surfaceFormats(cl_mem_flags flags, const cl_image_format *imageFormat, bool supportsOcl20Features) noexcept; }; } // namespace NEO diff --git a/opencl/source/mem_obj/image.cpp b/opencl/source/mem_obj/image.cpp index 4001938689..7627afcd1c 100644 --- a/opencl/source/mem_obj/image.cpp +++ b/opencl/source/mem_obj/image.cpp @@ -1030,7 +1030,7 @@ cl_int Image::writeNV12Planes(const void *hostPtr, size_t hostPtrRowPitch) { imageDesc.mem_object = this; // get access to the Y plane (CL_R) imageDesc.image_depth = 0; - const ClSurfaceFormatInfo *surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + const ClSurfaceFormatInfo *surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); // Create NV12 UV Plane image std::unique_ptr imageYPlane(Image::create( @@ -1055,7 +1055,7 @@ cl_int Image::writeNV12Planes(const void *hostPtr, size_t hostPtrRowPitch) { imageFormat.image_channel_order = CL_RG; hostPtr = static_cast(static_cast(hostPtr) + (hostPtrRowPitch * this->imageDesc.image_height)); - surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); // Create NV12 UV Plane image std::unique_ptr imageUVPlane(Image::create( context, @@ -1072,13 +1072,13 @@ cl_int Image::writeNV12Planes(const void *hostPtr, size_t hostPtrRowPitch) { return retVal; } -const ClSurfaceFormatInfo *Image::getSurfaceFormatFromTable(cl_mem_flags flags, const cl_image_format *imageFormat, unsigned int clVersionSupport) { +const ClSurfaceFormatInfo *Image::getSurfaceFormatFromTable(cl_mem_flags flags, const cl_image_format *imageFormat, bool supportsOcl20Features) { if (!imageFormat) { DEBUG_BREAK_IF("Invalid format"); return nullptr; } - ArrayRef formats = SurfaceFormats::surfaceFormats(flags, imageFormat, clVersionSupport); + ArrayRef formats = SurfaceFormats::surfaceFormats(flags, imageFormat, supportsOcl20Features); for (auto &format : formats) { if (format.OCLImageFormat.image_channel_data_type == imageFormat->image_channel_data_type && @@ -1136,7 +1136,7 @@ Image *Image::validateAndCreateImage(Context *context, return nullptr; } - const auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + const auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); errcodeRet = Image::validate(context, memoryProperties, surfaceFormat, imageDesc, hostPtr); if (errcodeRet != CL_SUCCESS) { diff --git a/opencl/source/mem_obj/image.h b/opencl/source/mem_obj/image.h index 25fd9372cb..6ccfebf2c1 100644 --- a/opencl/source/mem_obj/image.h +++ b/opencl/source/mem_obj/image.h @@ -168,7 +168,7 @@ class Image : public MemObj { uint32_t peekMipCount() { return mipCount; } void setMipCount(uint32_t mipCountNew) { this->mipCount = mipCountNew; } - static const ClSurfaceFormatInfo *getSurfaceFormatFromTable(cl_mem_flags flags, const cl_image_format *imageFormat, unsigned int clVersionSupport); + static const ClSurfaceFormatInfo *getSurfaceFormatFromTable(cl_mem_flags flags, const cl_image_format *imageFormat, bool supportsOcl20Features); static cl_int validateRegionAndOrigin(const size_t *origin, const size_t *region, const cl_image_desc &imgDesc); cl_int writeNV12Planes(const void *hostPtr, size_t hostPtrRowPitch); diff --git a/opencl/source/platform/extensions.cpp b/opencl/source/platform/extensions.cpp index 1354e7151f..7b2d44afae 100644 --- a/opencl/source/platform/extensions.cpp +++ b/opencl/source/platform/extensions.cpp @@ -38,7 +38,7 @@ std::string getExtensionsList(const HardwareInfo &hwInfo) { allExtensionsList.append(deviceExtensionsList); - if (hwInfo.capabilityTable.clVersionSupport >= 21) { + if (hwInfo.capabilityTable.supportsOcl21Features) { allExtensionsList += "cl_khr_subgroups "; allExtensionsList += "cl_khr_il_program "; if (hwInfo.capabilityTable.supportsVme) { diff --git a/opencl/source/sharings/d3d/d3d_sharing.cpp b/opencl/source/sharings/d3d/d3d_sharing.cpp index cb319a8048..57c1797118 100644 --- a/opencl/source/sharings/d3d/d3d_sharing.cpp +++ b/opencl/source/sharings/d3d/d3d_sharing.cpp @@ -82,8 +82,8 @@ void D3DSharing::updateImgInfoAndDesc(Gmm *gmm, ImageInfo &imgInfo, ImagePl } template -const ClSurfaceFormatInfo *D3DSharing::findSurfaceFormatInfo(GMM_RESOURCE_FORMAT_ENUM gmmFormat, cl_mem_flags flags, unsigned int clVersionSupport) { - ArrayRef formats = SurfaceFormats::surfaceFormats(flags, clVersionSupport); +const ClSurfaceFormatInfo *D3DSharing::findSurfaceFormatInfo(GMM_RESOURCE_FORMAT_ENUM gmmFormat, cl_mem_flags flags, bool supportsOcl20Features) { + ArrayRef formats = SurfaceFormats::surfaceFormats(flags, supportsOcl20Features); for (auto &format : formats) { if (gmmFormat == format.surfaceFormat.GMMSurfaceFormat) { return &format; diff --git a/opencl/source/sharings/d3d/d3d_sharing.h b/opencl/source/sharings/d3d/d3d_sharing.h index 63b1a21fb8..435e1f0218 100644 --- a/opencl/source/sharings/d3d/d3d_sharing.h +++ b/opencl/source/sharings/d3d/d3d_sharing.h @@ -36,7 +36,7 @@ class D3DSharing : public SharingHandler { unsigned int &getSubresource() { return subresource; } typename D3DQuery *getQuery() { return d3dQuery; } bool isSharedResource() { return sharedResource; } - static const ClSurfaceFormatInfo *findSurfaceFormatInfo(GMM_RESOURCE_FORMAT_ENUM gmmFormat, cl_mem_flags flags, unsigned int clVersionSupport); + static const ClSurfaceFormatInfo *findSurfaceFormatInfo(GMM_RESOURCE_FORMAT_ENUM gmmFormat, cl_mem_flags flags, bool supportsOcl20Features); static bool isFormatWithPlane1(DXGI_FORMAT format); protected: diff --git a/opencl/source/sharings/d3d/d3d_surface.cpp b/opencl/source/sharings/d3d/d3d_surface.cpp index a1dbec40f8..f4acc79e9a 100644 --- a/opencl/source/sharings/d3d/d3d_surface.cpp +++ b/opencl/source/sharings/d3d/d3d_surface.cpp @@ -71,7 +71,7 @@ Image *D3DSurface::create(Context *context, cl_dx9_surface_info_khr *surfaceInfo } imgInfo.plane = GmmTypesConverter::convertPlane(imagePlane); - auto *clSurfaceFormat = Image::getSurfaceFormatFromTable(flags, &imgFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto *clSurfaceFormat = Image::getSurfaceFormatFromTable(flags, &imgFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); imgInfo.surfaceFormat = &clSurfaceFormat->surfaceFormat; bool isSharedResource = false; diff --git a/opencl/source/sharings/d3d/d3d_texture.cpp b/opencl/source/sharings/d3d/d3d_texture.cpp index d04bfd603f..eaecd6d689 100644 --- a/opencl/source/sharings/d3d/d3d_texture.cpp +++ b/opencl/source/sharings/d3d/d3d_texture.cpp @@ -91,7 +91,7 @@ Image *D3DTexture::create2d(Context *context, D3DTexture2d *d3dTexture, cl_ clSurfaceFormat = findYuvSurfaceFormatInfo(textureDesc.Format, imagePlane, flags); imgInfo.surfaceFormat = &clSurfaceFormat->surfaceFormat; } else { - clSurfaceFormat = findSurfaceFormatInfo(alloc->getDefaultGmm()->gmmResourceInfo->getResourceFormat(), flags, context->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + clSurfaceFormat = findSurfaceFormatInfo(alloc->getDefaultGmm()->gmmResourceInfo->getResourceFormat(), flags, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); imgInfo.surfaceFormat = &clSurfaceFormat->surfaceFormat; } @@ -155,7 +155,7 @@ Image *D3DTexture::create3d(Context *context, D3DTexture3d *d3dTexture, cl_ updateImgInfoAndDesc(alloc->getDefaultGmm(), imgInfo, ImagePlane::NO_PLANE, 0u); auto d3dTextureObj = new D3DTexture(context, d3dTexture, subresource, textureStaging, sharedResource); - auto *clSurfaceFormat = findSurfaceFormatInfo(alloc->getDefaultGmm()->gmmResourceInfo->getResourceFormat(), flags, context->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto *clSurfaceFormat = findSurfaceFormatInfo(alloc->getDefaultGmm()->gmmResourceInfo->getResourceFormat(), flags, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); imgInfo.qPitch = alloc->getDefaultGmm()->queryQPitch(GMM_RESOURCE_TYPE::RESOURCE_3D); imgInfo.surfaceFormat = &clSurfaceFormat->surfaceFormat; @@ -184,5 +184,5 @@ const ClSurfaceFormatInfo *D3DTexture::findYuvSurfaceFormatInfo(DXGI_FORMAT imgFormat.image_channel_data_type = CL_UNORM_INT8; } - return Image::getSurfaceFormatFromTable(flags, &imgFormat, 12); + return Image::getSurfaceFormatFromTable(flags, &imgFormat, false /* supportsOcl20Features */); } diff --git a/opencl/source/sharings/gl/windows/gl_texture_windows.cpp b/opencl/source/sharings/gl/windows/gl_texture_windows.cpp index 1416b0ed09..1c6a24fa63 100644 --- a/opencl/source/sharings/gl/windows/gl_texture_windows.cpp +++ b/opencl/source/sharings/gl/windows/gl_texture_windows.cpp @@ -111,7 +111,7 @@ Image *GlTexture::createSharedGlTexture(Context *context, cl_mem_flags flags, cl errorCode.set(CL_INVALID_GL_OBJECT); return nullptr; } - auto surfaceFormatInfoAddress = Image::getSurfaceFormatFromTable(flags, &imgFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormatInfoAddress = Image::getSurfaceFormatFromTable(flags, &imgFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); if (!surfaceFormatInfoAddress) { memoryManager->freeGraphicsMemory(alloc); errorCode.set(CL_INVALID_GL_OBJECT); diff --git a/opencl/source/sharings/unified/unified_image.cpp b/opencl/source/sharings/unified/unified_image.cpp index d2dea5a473..fa1c189db0 100644 --- a/opencl/source/sharings/unified/unified_image.cpp +++ b/opencl/source/sharings/unified/unified_image.cpp @@ -26,7 +26,7 @@ Image *UnifiedImage::createSharedUnifiedImage(Context *context, cl_mem_flags fla ErrorCodeHelper errorCode(errcodeRet, CL_SUCCESS); UnifiedSharingFunctions *sharingFunctions = context->getSharing(); - auto *clSurfaceFormat = Image::getSurfaceFormatFromTable(flags, imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto *clSurfaceFormat = Image::getSurfaceFormatFromTable(flags, imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); ImageInfo imgInfo = {}; imgInfo.imgDesc = Image::convertDescriptor(*imageDesc); imgInfo.surfaceFormat = &clSurfaceFormat->surfaceFormat; diff --git a/opencl/source/sharings/va/va_surface.cpp b/opencl/source/sharings/va/va_surface.cpp index d3dd7d1ed3..4983fafa0a 100644 --- a/opencl/source/sharings/va/va_surface.cpp +++ b/opencl/source/sharings/va/va_surface.cpp @@ -51,7 +51,7 @@ Image *VASurface::createSharedVaSurface(Context *context, VASharingFunctions *sh UNRECOVERABLE_IF(true); } - auto gmmSurfaceFormat = Image::getSurfaceFormatFromTable(flags, &gmmImgFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); //vaImage.format.fourcc == VA_FOURCC_NV12 + auto gmmSurfaceFormat = Image::getSurfaceFormatFromTable(flags, &gmmImgFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); //vaImage.format.fourcc == VA_FOURCC_NV12 if (DebugManager.flags.EnableExtendedVaFormats.get() && vaImage.format.fourcc == VA_FOURCC_P010) { channelType = CL_UNORM_INT16; @@ -60,7 +60,7 @@ Image *VASurface::createSharedVaSurface(Context *context, VASharingFunctions *sh imgInfo.surfaceFormat = &gmmSurfaceFormat->surfaceFormat; cl_image_format imgFormat = {channelOrder, channelType}; - auto imgSurfaceFormat = Image::getSurfaceFormatFromTable(flags, &imgFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto imgSurfaceFormat = Image::getSurfaceFormatFromTable(flags, &imgFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); sharingFunctions->extGetSurfaceHandle(surface, &sharedHandle); AllocationProperties properties(context->getDevice(0)->getRootDeviceIndex(), diff --git a/opencl/test/unit_test/api/cl_create_image_tests.cpp b/opencl/test/unit_test/api/cl_create_image_tests.cpp index 6e1c701b43..63e63928da 100644 --- a/opencl/test/unit_test/api/cl_create_image_tests.cpp +++ b/opencl/test/unit_test/api/cl_create_image_tests.cpp @@ -918,7 +918,7 @@ TEST_F(clCreateImageFromImageTest, GivenImage2dWhenCreatingImage2dFromImageWithT nullptr, &retVal); - if (pContext->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport < 20) { + if (pContext->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features == false) { EXPECT_EQ(CL_IMAGE_FORMAT_NOT_SUPPORTED, retVal); EXPECT_EQ(nullptr, imageFromImageObject); } else { @@ -976,7 +976,7 @@ TEST_F(clCreateImageFromImageTest, GivenImage2dWhenCreatingImage2dFromImageWithD nullptr, &retVal); - if (pContext->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport >= 20) { + if (pContext->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features) { EXPECT_EQ(CL_INVALID_IMAGE_FORMAT_DESCRIPTOR, retVal); } else { EXPECT_EQ(CL_IMAGE_FORMAT_NOT_SUPPORTED, retVal); diff --git a/opencl/test/unit_test/aub_tests/command_queue/enqueue_copy_image_aub_tests.cpp b/opencl/test/unit_test/aub_tests/command_queue/enqueue_copy_image_aub_tests.cpp index ba8a0b1b99..9c6ff1c00a 100644 --- a/opencl/test/unit_test/aub_tests/command_queue/enqueue_copy_image_aub_tests.cpp +++ b/opencl/test/unit_test/aub_tests/command_queue/enqueue_copy_image_aub_tests.cpp @@ -83,7 +83,7 @@ HWTEST_P(AUBCopyImage, simple) { imageDesc.num_samples = 0; imageDesc.mem_object = NULL; // clang-format on - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, pClDevice->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, pClDevice->getHardwareInfo().capabilityTable.supportsOcl21Features); auto retVal = CL_INVALID_VALUE; srcImage.reset(Image::create( context.get(), diff --git a/opencl/test/unit_test/aub_tests/command_queue/enqueue_fill_image_aub_tests.cpp b/opencl/test/unit_test/aub_tests/command_queue/enqueue_fill_image_aub_tests.cpp index d1507f2735..180a773595 100644 --- a/opencl/test/unit_test/aub_tests/command_queue/enqueue_fill_image_aub_tests.cpp +++ b/opencl/test/unit_test/aub_tests/command_queue/enqueue_fill_image_aub_tests.cpp @@ -100,7 +100,7 @@ struct AubFillImage CommandStreamFixture::SetUp(pCmdQ); context = std::make_unique(pClDevice); - if ((pClDevice->getHardwareInfo().capabilityTable.clVersionSupport < 20) && (channelOrder == CL_sRGBA || channelOrder == CL_sBGRA)) { + if ((pClDevice->getHardwareInfo().capabilityTable.supportsOcl21Features == false) && (channelOrder == CL_sRGBA || channelOrder == CL_sBGRA)) { GTEST_SKIP(); } } @@ -182,7 +182,7 @@ HWTEST_P(AubFillImage, simple) { auto retVal = CL_INVALID_VALUE; cl_mem_flags flags = CL_MEM_READ_ONLY; - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); image.reset(Image::create( context.get(), MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), diff --git a/opencl/test/unit_test/aub_tests/command_queue/enqueue_kernel_aub_tests.cpp b/opencl/test/unit_test/aub_tests/command_queue/enqueue_kernel_aub_tests.cpp index 88a1bdf530..790c8cf656 100644 --- a/opencl/test/unit_test/aub_tests/command_queue/enqueue_kernel_aub_tests.cpp +++ b/opencl/test/unit_test/aub_tests/command_queue/enqueue_kernel_aub_tests.cpp @@ -370,7 +370,7 @@ INSTANTIATE_TEST_CASE_P( struct AUBSimpleArgNonUniformFixture : public KernelAUBFixture { void SetUp() override { - if (NEO::defaultHwInfo->capabilityTable.clVersionSupport < 20) { + if (NEO::defaultHwInfo->capabilityTable.supportsOcl21Features == false) { GTEST_SKIP(); } KernelAUBFixture::SetUp(); @@ -430,7 +430,7 @@ struct AUBSimpleArgNonUniformFixture : public KernelAUBFixturecapabilityTable.clVersionSupport < 20) { + if (NEO::defaultHwInfo->capabilityTable.supportsOcl21Features == false) { return; } if (destMemory) { diff --git a/opencl/test/unit_test/aub_tests/command_queue/enqueue_map_image_aub_tests.cpp b/opencl/test/unit_test/aub_tests/command_queue/enqueue_map_image_aub_tests.cpp index 4818ebfad2..7342fd4d17 100644 --- a/opencl/test/unit_test/aub_tests/command_queue/enqueue_map_image_aub_tests.cpp +++ b/opencl/test/unit_test/aub_tests/command_queue/enqueue_map_image_aub_tests.cpp @@ -124,7 +124,7 @@ HWTEST_P(AUBMapImage, MapUpdateUnmapVerify) { auto retVal = CL_INVALID_VALUE; cl_mem_flags flags = CL_MEM_COPY_HOST_PTR; - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, pClDevice->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, pClDevice->getHardwareInfo().capabilityTable.supportsOcl21Features); srcImage.reset(Image::create( context.get(), MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), diff --git a/opencl/test/unit_test/aub_tests/command_queue/enqueue_read_image_aub_tests.cpp b/opencl/test/unit_test/aub_tests/command_queue/enqueue_read_image_aub_tests.cpp index c1d57c234d..0e8ed9b5bd 100644 --- a/opencl/test/unit_test/aub_tests/command_queue/enqueue_read_image_aub_tests.cpp +++ b/opencl/test/unit_test/aub_tests/command_queue/enqueue_read_image_aub_tests.cpp @@ -141,7 +141,7 @@ HWTEST_P(AUBReadImage, simpleUnalignedMemory) { } cl_mem_flags flags = CL_MEM_USE_HOST_PTR; - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); auto retVal = CL_INVALID_VALUE; srcImage.reset(Image::create( context.get(), diff --git a/opencl/test/unit_test/aub_tests/command_queue/enqueue_read_write_image_aub_fixture.h b/opencl/test/unit_test/aub_tests/command_queue/enqueue_read_write_image_aub_fixture.h index bd8696ac66..415b89b172 100644 --- a/opencl/test/unit_test/aub_tests/command_queue/enqueue_read_write_image_aub_fixture.h +++ b/opencl/test/unit_test/aub_tests/command_queue/enqueue_read_write_image_aub_fixture.h @@ -77,7 +77,7 @@ struct AUBImageUnaligned imageDesc.mem_object = NULL; cl_mem_flags flags = CL_MEM_USE_HOST_PTR | CL_MEM_READ_WRITE; - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, pClDevice->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, pClDevice->getHardwareInfo().capabilityTable.supportsOcl21Features); auto retVal = CL_INVALID_VALUE; auto image = std::unique_ptr(Image::create( @@ -172,7 +172,7 @@ struct AUBImageUnaligned imageDesc.mem_object = NULL; cl_mem_flags flags = CL_MEM_USE_HOST_PTR | CL_MEM_READ_WRITE; - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, pClDevice->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, pClDevice->getHardwareInfo().capabilityTable.supportsOcl21Features); auto retVal = CL_INVALID_VALUE; auto image = std::unique_ptr(Image::create( diff --git a/opencl/test/unit_test/aub_tests/command_queue/enqueue_verify_memory_image_aub_tests.cpp b/opencl/test/unit_test/aub_tests/command_queue/enqueue_verify_memory_image_aub_tests.cpp index 484cc747fd..1add0b35f1 100644 --- a/opencl/test/unit_test/aub_tests/command_queue/enqueue_verify_memory_image_aub_tests.cpp +++ b/opencl/test/unit_test/aub_tests/command_queue/enqueue_verify_memory_image_aub_tests.cpp @@ -70,7 +70,7 @@ HWTEST_P(VerifyMemoryImageHw, givenDifferentImagesWhenValidatingMemoryThenSucces cl_mem_flags flags = CL_MEM_READ_ONLY; auto surfaceFormat = Image:: - getSurfaceFormatFromTable(flags, &imageFormat, pClDevice->getHardwareInfo().capabilityTable.clVersionSupport); + getSurfaceFormatFromTable(flags, &imageFormat, pClDevice->getHardwareInfo().capabilityTable.supportsOcl21Features); auto retVal = CL_INVALID_VALUE; std::unique_ptr image(Image::create( context, diff --git a/opencl/test/unit_test/aub_tests/command_queue/enqueue_write_image_aub_tests.cpp b/opencl/test/unit_test/aub_tests/command_queue/enqueue_write_image_aub_tests.cpp index 7ef4bad965..f3ffe29367 100644 --- a/opencl/test/unit_test/aub_tests/command_queue/enqueue_write_image_aub_tests.cpp +++ b/opencl/test/unit_test/aub_tests/command_queue/enqueue_write_image_aub_tests.cpp @@ -136,7 +136,7 @@ HWTEST_P(AUBWriteImage, simpleUnalignedMemory) { auto retVal = CL_INVALID_VALUE; cl_mem_flags flags = 0; - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); dstImage.reset(Image::create( context.get(), MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), diff --git a/opencl/test/unit_test/aub_tests/fixtures/aub_parent_kernel_fixture.h b/opencl/test/unit_test/aub_tests/fixtures/aub_parent_kernel_fixture.h index 09268f12a6..13c020bd28 100644 --- a/opencl/test/unit_test/aub_tests/fixtures/aub_parent_kernel_fixture.h +++ b/opencl/test/unit_test/aub_tests/fixtures/aub_parent_kernel_fixture.h @@ -20,11 +20,11 @@ class AUBParentKernelFixture : public CommandEnqueueAUBFixture, using HelloWorldKernelFixture::SetUp; void SetUp() override { - CommandEnqueueAUBFixture::SetUp(); - ASSERT_NE(nullptr, pClDevice); - if (pClDevice->getHardwareInfo().capabilityTable.clVersionSupport < 20) { + if (defaultHwInfo->capabilityTable.supportsOcl21Features == false) { GTEST_SKIP(); } + CommandEnqueueAUBFixture::SetUp(); + ASSERT_NE(nullptr, pClDevice); HelloWorldKernelFixture::SetUp(pClDevice, programFile, kernelName, "-cl-std=CL2.0"); } void TearDown() override { diff --git a/opencl/test/unit_test/aub_tests/gen11/execution_model/enqueue_parent_kernel_tests_gen11.cpp b/opencl/test/unit_test/aub_tests/gen11/execution_model/enqueue_parent_kernel_tests_gen11.cpp index 44c60d71dc..36efd62cd9 100644 --- a/opencl/test/unit_test/aub_tests/gen11/execution_model/enqueue_parent_kernel_tests_gen11.cpp +++ b/opencl/test/unit_test/aub_tests/gen11/execution_model/enqueue_parent_kernel_tests_gen11.cpp @@ -53,7 +53,7 @@ GEN11TEST_F(GEN11AUBParentKernelFixture, EnqueueParentKernel) { desc.image_slice_pitch = 0; // clang-format on - auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); Image *image = Image::create( pContext, {}, diff --git a/opencl/test/unit_test/aub_tests/gen12lp/execution_model/enqueue_parent_kernel_tests_gen12lp.cpp b/opencl/test/unit_test/aub_tests/gen12lp/execution_model/enqueue_parent_kernel_tests_gen12lp.cpp index d67b882b4f..69302994ea 100644 --- a/opencl/test/unit_test/aub_tests/gen12lp/execution_model/enqueue_parent_kernel_tests_gen12lp.cpp +++ b/opencl/test/unit_test/aub_tests/gen12lp/execution_model/enqueue_parent_kernel_tests_gen12lp.cpp @@ -53,7 +53,7 @@ GEN12LPTEST_F(GEN12LPAUBParentKernelFixture, EnqueueParentKernel) { desc.image_slice_pitch = 0; // clang-format on - auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); Image *image = Image::create( pContext, {}, diff --git a/opencl/test/unit_test/aub_tests/gen8/execution_model/enqueue_parent_kernel_tests_gen8.cpp b/opencl/test/unit_test/aub_tests/gen8/execution_model/enqueue_parent_kernel_tests_gen8.cpp index 0487a6aac3..71e6508c1f 100644 --- a/opencl/test/unit_test/aub_tests/gen8/execution_model/enqueue_parent_kernel_tests_gen8.cpp +++ b/opencl/test/unit_test/aub_tests/gen8/execution_model/enqueue_parent_kernel_tests_gen8.cpp @@ -53,7 +53,7 @@ GEN8TEST_F(GEN8AUBParentKernelFixture, EnqueueParentKernel) { desc.image_row_pitch = 0; desc.image_slice_pitch = 0; - auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); std::unique_ptr image(Image::create( pContext, {}, diff --git a/opencl/test/unit_test/aub_tests/gen9/execution_model/enqueue_parent_kernel_tests_gen9.cpp b/opencl/test/unit_test/aub_tests/gen9/execution_model/enqueue_parent_kernel_tests_gen9.cpp index cb56c4c1f5..99601ac73e 100644 --- a/opencl/test/unit_test/aub_tests/gen9/execution_model/enqueue_parent_kernel_tests_gen9.cpp +++ b/opencl/test/unit_test/aub_tests/gen9/execution_model/enqueue_parent_kernel_tests_gen9.cpp @@ -51,7 +51,7 @@ GEN9TEST_F(AUBParentKernelFixture, EnqueueParentKernel) { desc.image_slice_pitch = 0; // clang-format on - auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); Image *image = Image::create( pContext, {}, diff --git a/opencl/test/unit_test/aub_tests/gen9/skl/command_queue/run_kernel_aub_tests_skl.cpp b/opencl/test/unit_test/aub_tests/gen9/skl/command_queue/run_kernel_aub_tests_skl.cpp index aee8362c42..3a126a554b 100644 --- a/opencl/test/unit_test/aub_tests/gen9/skl/command_queue/run_kernel_aub_tests_skl.cpp +++ b/opencl/test/unit_test/aub_tests/gen9/skl/command_queue/run_kernel_aub_tests_skl.cpp @@ -329,7 +329,7 @@ SKLTEST_F(AUBRunKernelIntegrateTest, deviceSideVme) { refMemory[xMovement + yMovement * testWidth + 1] = 0xFF; cl_mem_flags flags = CL_MEM_READ_ONLY | CL_MEM_COPY_HOST_PTR; - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); auto srcImage = Image::create( context, MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), diff --git a/opencl/test/unit_test/aub_tests/mem_obj/create_image_aub_tests.cpp b/opencl/test/unit_test/aub_tests/mem_obj/create_image_aub_tests.cpp index 7661945cca..17c5d20501 100644 --- a/opencl/test/unit_test/aub_tests/mem_obj/create_image_aub_tests.cpp +++ b/opencl/test/unit_test/aub_tests/mem_obj/create_image_aub_tests.cpp @@ -95,7 +95,7 @@ HWTEST_P(AUBCreateImageArray, CheckArrayImages) { imageDesc.image_height = 1; } cl_mem_flags flags = CL_MEM_COPY_HOST_PTR; - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); auto imgInfo = MockGmm::initImgInfo(imageDesc, 0, surfaceFormat); imgInfo.linearStorage = !hwHelper.tilingAllowed(false, Image::isImage1d(imageDesc), false); auto queryGmm = MockGmm::queryImgParams(pDevice->getGmmClientContext(), imgInfo); @@ -221,7 +221,7 @@ INSTANTIATE_TEST_CASE_P( testing::ValuesIn(copyHostPtrFlags)); HWTEST_P(CopyHostPtrTest, imageWithDoubledRowPitchThatIsCreatedWithCopyHostPtrFlagHasProperRowPitchSet) { - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); auto imgInfo = MockGmm::initImgInfo(imageDesc, 0, surfaceFormat); MockGmm::queryImgParams(pDevice->getGmmClientContext(), imgInfo); @@ -291,7 +291,7 @@ HWTEST_P(CopyHostPtrTest, imageWithDoubledRowPitchThatIsCreatedWithCopyHostPtrFl HWTEST_P(UseHostPtrTest, imageWithRowPitchCreatedWithUseHostPtrFlagCopiedActuallyVerifyMapImageData) { imageDesc.image_width = 546; imageDesc.image_height = 1; - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); auto imgInfo = MockGmm::initImgInfo(imageDesc, 0, surfaceFormat); MockGmm::queryImgParams(pDevice->getGmmClientContext(), imgInfo); auto passedRowPitch = imgInfo.rowPitch + 32; @@ -407,7 +407,7 @@ HWTEST_F(AUBCreateImage, image3DCreatedWithDoubledSlicePitchWhenQueriedForDataRe data += inputSlicePitch; } cl_mem_flags flags = CL_MEM_READ_WRITE | CL_MEM_COPY_HOST_PTR; - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); image.reset(Image::create(context, MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), flags, 0, surfaceFormat, &imageDesc, host_ptr, retVal)); diff --git a/opencl/test/unit_test/command_queue/enqueue_map_image_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_map_image_tests.cpp index ca55ee3b9a..79c63bf79d 100644 --- a/opencl/test/unit_test/command_queue/enqueue_map_image_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_map_image_tests.cpp @@ -960,7 +960,7 @@ TEST_F(EnqueueMapImageTest, givenImage1DArrayWhenEnqueueMapImageIsCalledThenRetu imageFormat.image_channel_order = CL_RGBA; imageFormat.image_channel_data_type = CL_UNSIGNED_INT16; - const ClSurfaceFormatInfo *surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + const ClSurfaceFormatInfo *surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); auto allocation = context->getMemoryManager()->allocateGraphicsMemoryWithProperties(MockAllocationProperties{context->getDevice(0)->getRootDeviceIndex(), imgSize}); ASSERT_NE(allocation, nullptr); diff --git a/opencl/test/unit_test/command_queue/enqueue_thread_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_thread_tests.cpp index b1fb7ef3e8..1169a48cad 100644 --- a/opencl/test/unit_test/command_queue/enqueue_thread_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_thread_tests.cpp @@ -216,7 +216,7 @@ HWTEST_F(EnqueueThreading, enqueueCopyBufferToImage) { imageDesc.image_width = 1024u; cl_mem_flags flags = CL_MEM_WRITE_ONLY; - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); std::unique_ptr dstImage(Image::create(context, MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal)); ASSERT_NE(nullptr, dstImage.get()); @@ -240,7 +240,7 @@ HWTEST_F(EnqueueThreading, enqueueCopyImage) { imageDesc.image_type = CL_MEM_OBJECT_IMAGE1D; imageDesc.image_width = 1024u; cl_mem_flags flags = CL_MEM_WRITE_ONLY; - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); std::unique_ptr srcImage(Image::create(context, MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal)); ASSERT_NE(nullptr, srcImage.get()); std::unique_ptr dstImage(Image::create(context, MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal)); @@ -268,7 +268,7 @@ HWTEST_F(EnqueueThreading, enqueueCopyImageToBuffer) { imageDesc.image_width = 1024u; cl_mem_flags flags = CL_MEM_WRITE_ONLY; - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); std::unique_ptr srcImage(Image::create(context, MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal)); ASSERT_NE(nullptr, srcImage.get()); @@ -307,7 +307,7 @@ HWTEST_F(EnqueueThreading, enqueueFillImage) { imageDesc.image_width = 1024u; cl_mem_flags flags = CL_MEM_WRITE_ONLY; - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); std::unique_ptr image(Image::create(context, MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal)); ASSERT_NE(nullptr, image.get()); @@ -353,7 +353,7 @@ HWTEST_F(EnqueueThreading, enqueueReadImage) { imageDesc.image_width = 1024u; cl_mem_flags flags = CL_MEM_WRITE_ONLY; - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); std::unique_ptr image(Image::create(context, MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal)); ASSERT_NE(nullptr, image.get()); @@ -403,7 +403,7 @@ HWTEST_F(EnqueueThreading, enqueueWriteImage) { imageDesc.image_width = 1024u; cl_mem_flags flags = CL_MEM_READ_ONLY; - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); std::unique_ptr image(Image::create(context, MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal)); ASSERT_NE(nullptr, image.get()); diff --git a/opencl/test/unit_test/command_queue/multiple_map_image_tests.cpp b/opencl/test/unit_test/command_queue/multiple_map_image_tests.cpp index d82990d686..f399cca56d 100644 --- a/opencl/test/unit_test/command_queue/multiple_map_image_tests.cpp +++ b/opencl/test/unit_test/command_queue/multiple_map_image_tests.cpp @@ -112,7 +112,7 @@ struct MultipleMapImageTest : public DeviceFixture, public ::testing::Test { VariableBackup backup(&imageFactory[eRenderCoreFamily].createImageFunction); imageFactory[eRenderCoreFamily].createImageFunction = MockImage::createMockImage; - auto surfaceFormat = Image::getSurfaceFormatFromTable(Traits::flags, &Traits::imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(Traits::flags, &Traits::imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); cl_int retVal = CL_SUCCESS; auto img = Image::create(context, MemoryPropertiesParser::createMemoryProperties(Traits::flags, 0, 0), Traits::flags, 0, surfaceFormat, &Traits::imageDesc, Traits::hostPtr, retVal); diff --git a/opencl/test/unit_test/context/driver_diagnostics_tests.cpp b/opencl/test/unit_test/context/driver_diagnostics_tests.cpp index 029d015080..99570276e1 100644 --- a/opencl/test/unit_test/context/driver_diagnostics_tests.cpp +++ b/opencl/test/unit_test/context/driver_diagnostics_tests.cpp @@ -559,7 +559,7 @@ TEST_F(PerformanceHintTest, givenCompressedImageWhenItsCreatedThenProperPerforma imageDesc.image_slice_pitch = 0; cl_mem_flags flags = CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR; - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); auto image = std::unique_ptr(Image::create( context.get(), @@ -618,7 +618,7 @@ TEST_F(PerformanceHintTest, givenImageWithNoGmmWhenItsCreatedThenNoPerformanceHi imageDesc.image_slice_pitch = 0; cl_mem_flags flags = CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR; - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); auto image = std::unique_ptr(Image::create( context.get(), @@ -679,7 +679,7 @@ TEST_F(PerformanceHintTest, givenUncompressedImageWhenItsCreatedThenProperPerfor imageDesc.image_slice_pitch = 0; cl_mem_flags flags = CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR; - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); auto image = std::unique_ptr(Image::create( context.get(), diff --git a/opencl/test/unit_test/context/get_supported_image_formats_tests.cpp b/opencl/test/unit_test/context/get_supported_image_formats_tests.cpp index c8e435acae..4c056d29b6 100644 --- a/opencl/test/unit_test/context/get_supported_image_formats_tests.cpp +++ b/opencl/test/unit_test/context/get_supported_image_formats_tests.cpp @@ -147,7 +147,7 @@ TEST_P(GetSupportedImageFormatsTest, retrieveImageFormatsSRGB) { } } - if (isReadOnly && ((&castToObject(devices[0])->getDevice())->getHardwareInfo().capabilityTable.clVersionSupport >= 20)) { + if (isReadOnly && ((&castToObject(devices[0])->getDevice())->getHardwareInfo().capabilityTable.supportsOcl21Features)) { EXPECT_TRUE(sRGBAFormatFound & sBGRAFormatFound); } else { EXPECT_FALSE(sRGBAFormatFound | sBGRAFormatFound); @@ -287,8 +287,8 @@ TEST_P(NV12ExtensionSupportedImageFormatsTest, givenNV12ExtensionWhenQueriedForI nullptr, &numImageFormats); - unsigned int clVersionSupport = device.get()->getHardwareInfo().capabilityTable.clVersionSupport; - size_t expectedNumReadOnlyFormats = (clVersionSupport >= 20) ? SurfaceFormats::readOnly20().size() : SurfaceFormats::readOnly12().size(); + auto supportsOcl20Features = device.get()->getHardwareInfo().capabilityTable.supportsOcl21Features; + size_t expectedNumReadOnlyFormats = (supportsOcl20Features) ? SurfaceFormats::readOnly20().size() : SurfaceFormats::readOnly12().size(); if (Image::isImage2dOr2dArray(imageFormats) && imageFormatsFlags == CL_MEM_READ_ONLY) { expectedNumReadOnlyFormats += SurfaceFormats::readOnlyDepth().size(); diff --git a/opencl/test/unit_test/d3d_sharing/d3d_tests_part1.cpp b/opencl/test/unit_test/d3d_sharing/d3d_tests_part1.cpp index dff3e53f0c..562ba31468 100644 --- a/opencl/test/unit_test/d3d_sharing/d3d_tests_part1.cpp +++ b/opencl/test/unit_test/d3d_sharing/d3d_tests_part1.cpp @@ -632,7 +632,7 @@ TYPED_TEST_P(D3DTests, givenReadonlyFormatWhenLookingForSurfaceFormatThenReturnV format.OCLImageFormat.image_channel_order == CL_BGRA || format.OCLImageFormat.image_channel_order == CL_RG || format.OCLImageFormat.image_channel_order == CL_R) { - auto surfaceFormat = D3DSharing::findSurfaceFormatInfo(format.surfaceFormat.GMMSurfaceFormat, CL_MEM_READ_ONLY, 12); + auto surfaceFormat = D3DSharing::findSurfaceFormatInfo(format.surfaceFormat.GMMSurfaceFormat, CL_MEM_READ_ONLY, false /* supportsOcl20Features */); ASSERT_NE(nullptr, surfaceFormat); EXPECT_EQ(&format, surfaceFormat); } @@ -647,7 +647,7 @@ TYPED_TEST_P(D3DTests, givenWriteOnlyFormatWhenLookingForSurfaceFormatThenReturn format.OCLImageFormat.image_channel_order == CL_BGRA || format.OCLImageFormat.image_channel_order == CL_RG || format.OCLImageFormat.image_channel_order == CL_R) { - auto surfaceFormat = D3DSharing::findSurfaceFormatInfo(format.surfaceFormat.GMMSurfaceFormat, CL_MEM_WRITE_ONLY, context->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = D3DSharing::findSurfaceFormatInfo(format.surfaceFormat.GMMSurfaceFormat, CL_MEM_WRITE_ONLY, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); ASSERT_NE(nullptr, surfaceFormat); EXPECT_EQ(&format, surfaceFormat); } @@ -662,7 +662,7 @@ TYPED_TEST_P(D3DTests, givenReadWriteFormatWhenLookingForSurfaceFormatThenReturn format.OCLImageFormat.image_channel_order == CL_BGRA || format.OCLImageFormat.image_channel_order == CL_RG || format.OCLImageFormat.image_channel_order == CL_R) { - auto surfaceFormat = D3DSharing::findSurfaceFormatInfo(format.surfaceFormat.GMMSurfaceFormat, CL_MEM_READ_WRITE, context->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = D3DSharing::findSurfaceFormatInfo(format.surfaceFormat.GMMSurfaceFormat, CL_MEM_READ_WRITE, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); ASSERT_NE(nullptr, surfaceFormat); EXPECT_EQ(&format, surfaceFormat); } diff --git a/opencl/test/unit_test/device/device_caps_tests.cpp b/opencl/test/unit_test/device/device_caps_tests.cpp index 50b9c191c1..d3f594fc62 100644 --- a/opencl/test/unit_test/device/device_caps_tests.cpp +++ b/opencl/test/unit_test/device/device_caps_tests.cpp @@ -179,7 +179,7 @@ TEST_F(DeviceGetCapsTest, WhenCreatingDeviceThenCapsArePopulatedCorrectly) { EXPECT_EQ(16384u, sharedCaps.image2DMaxWidth); EXPECT_EQ(16384u, sharedCaps.image2DMaxHeight); EXPECT_EQ(2048u, sharedCaps.imageMaxArraySize); - if (device->getHardwareInfo().capabilityTable.clVersionSupport == 12 && is64bit) { + if (device->getHardwareInfo().capabilityTable.supportsOcl21Features == false && is64bit) { EXPECT_TRUE(sharedCaps.force32BitAddressess); } } diff --git a/opencl/test/unit_test/fixtures/image_fixture.h b/opencl/test/unit_test/fixtures/image_fixture.h index a984a286e2..ffd16347bf 100644 --- a/opencl/test/unit_test/fixtures/image_fixture.h +++ b/opencl/test/unit_test/fixtures/image_fixture.h @@ -75,7 +75,7 @@ struct ImageHelper { static Image *create(Context *context = Traits::context, const cl_image_desc *imgDesc = &Traits::imageDesc, const cl_image_format *imgFormat = &Traits::imageFormat) { auto retVal = CL_INVALID_VALUE; - auto surfaceFormat = Image::getSurfaceFormatFromTable(Traits::flags, imgFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(Traits::flags, imgFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); auto image = Image::create( context, NEO::MemoryPropertiesParser::createMemoryProperties(Traits::flags, 0, 0), diff --git a/opencl/test/unit_test/gen11/image_tests_gen11.cpp b/opencl/test/unit_test/gen11/image_tests_gen11.cpp index 324389e969..72628c6e54 100644 --- a/opencl/test/unit_test/gen11/image_tests_gen11.cpp +++ b/opencl/test/unit_test/gen11/image_tests_gen11.cpp @@ -36,7 +36,7 @@ struct AppendSurfaceStateParamsTest : public ::testing::Test { } void createImage() { - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); EXPECT_NE(nullptr, surfaceFormat); image.reset(Image::create(&context, MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal)); } diff --git a/opencl/test/unit_test/kernel/kernel_image_arg_tests.cpp b/opencl/test/unit_test/kernel/kernel_image_arg_tests.cpp index a5ee0058f9..865c715997 100644 --- a/opencl/test/unit_test/kernel/kernel_image_arg_tests.cpp +++ b/opencl/test/unit_test/kernel/kernel_image_arg_tests.cpp @@ -98,7 +98,7 @@ TEST_F(KernelImageArgTest, givenImageWithNumSamplesWhenSetArgIsCalledThenPatchNu imgDesc.image_width = 5; imgDesc.image_height = 5; - auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imgFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imgFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); auto sampleImg = Image::create(context.get(), {}, 0, 0, surfaceFormat, &imgDesc, nullptr, retVal); EXPECT_EQ(CL_SUCCESS, retVal); @@ -120,7 +120,7 @@ TEST_F(KernelImageArgTest, givenImageWithWriteOnlyAccessAndReadOnlyArgWhenCheckC cl_mem_flags flags = CL_MEM_WRITE_ONLY; imgDesc.image_width = 5; imgDesc.image_height = 5; - auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imgFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imgFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); std::unique_ptr img(Image::create(context.get(), MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), flags, 0, surfaceFormat, &imgDesc, nullptr, retVal)); pKernelInfo->kernelArgInfo[0].metadata.accessQualifier = NEO::KernelArgMetadata::AccessReadOnly; cl_mem memObj = img.get(); @@ -159,7 +159,7 @@ TEST_F(KernelImageArgTest, givenImageWithReadOnlyAccessAndWriteOnlyArgWhenCheckC cl_mem_flags flags = CL_MEM_READ_ONLY; imgDesc.image_width = 5; imgDesc.image_height = 5; - auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imgFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imgFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); std::unique_ptr img(Image::create(context.get(), MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), flags, 0, surfaceFormat, &imgDesc, nullptr, retVal)); pKernelInfo->kernelArgInfo[0].metadata.accessQualifier = NEO::KernelArgMetadata::AccessWriteOnly; cl_mem memObj = img.get(); @@ -179,7 +179,7 @@ TEST_F(KernelImageArgTest, givenImageWithReadOnlyAccessAndReadOnlyArgWhenCheckCo cl_mem_flags flags = CL_MEM_READ_ONLY; imgDesc.image_width = 5; imgDesc.image_height = 5; - auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imgFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imgFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); std::unique_ptr img(Image::create(context.get(), MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), flags, 0, surfaceFormat, &imgDesc, nullptr, retVal)); pKernelInfo->kernelArgInfo[0].metadata.accessQualifier = NEO::KernelArgMetadata::AccessReadOnly; cl_mem memObj = img.get(); @@ -195,7 +195,7 @@ TEST_F(KernelImageArgTest, givenImageWithWriteOnlyAccessAndWriteOnlyArgWhenCheck cl_mem_flags flags = CL_MEM_WRITE_ONLY; imgDesc.image_width = 5; imgDesc.image_height = 5; - auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imgFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imgFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); std::unique_ptr img(Image::create(context.get(), MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), flags, 0, surfaceFormat, &imgDesc, nullptr, retVal)); pKernelInfo->kernelArgInfo[0].metadata.accessQualifier = NEO::KernelArgMetadata::AccessWriteOnly; cl_mem memObj = img.get(); @@ -212,7 +212,7 @@ HWTEST_F(KernelImageArgTest, givenImgWithMcsAllocWhenMakeResidentThenMakeMcsAllo imgDesc.image_width = 5; imgDesc.image_height = 5; - auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imgFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imgFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); auto img = Image::create(context.get(), {}, 0, 0, surfaceFormat, &imgDesc, nullptr, retVal); EXPECT_EQ(CL_SUCCESS, retVal); auto mcsAlloc = context->getMemoryManager()->allocateGraphicsMemoryWithProperties(MockAllocationProperties{pDevice->getRootDeviceIndex(), MemoryConstants::pageSize}); @@ -240,7 +240,7 @@ TEST_F(KernelImageArgTest, givenKernelWithSettedArgWhenUnSetCalledThenArgIsUnset cl_mem_flags flags = CL_MEM_WRITE_ONLY; imgDesc.image_width = 5; imgDesc.image_height = 5; - auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imgFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imgFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); std::unique_ptr img(Image::create(context.get(), MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), flags, 0, surfaceFormat, &imgDesc, nullptr, retVal)); cl_mem memObj = img.get(); @@ -277,7 +277,7 @@ TEST_F(KernelImageArgTest, givenKernelWithSharedImageWhenSetArgCalledThenUsingSh cl_mem_flags flags = CL_MEM_WRITE_ONLY; imgDesc.image_width = 5; imgDesc.image_height = 5; - auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imgFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imgFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); std::unique_ptr img(Image::create(context.get(), MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), flags, 0, surfaceFormat, &imgDesc, nullptr, retVal)); cl_mem memObj = img.get(); @@ -410,4 +410,4 @@ TEST_F(KernelImageArgTest, givenNotUsedBindlessImagesAndImageArgWhenPatchingSurf auto patchLocation = reinterpret_cast(ptrOffset(pKernel->getCrossThreadData(), crossThreadDataOffset)); EXPECT_EQ(0xdeadu, *patchLocation); -} \ No newline at end of file +} diff --git a/opencl/test/unit_test/kernel/kernel_tests.cpp b/opencl/test/unit_test/kernel/kernel_tests.cpp index 46aad026db..351313e850 100644 --- a/opencl/test/unit_test/kernel/kernel_tests.cpp +++ b/opencl/test/unit_test/kernel/kernel_tests.cpp @@ -2079,7 +2079,7 @@ HWTEST_F(KernelResidencyTest, test_MakeArgsResidentCheckImageFromImage) { cl_image_format imageFormat; imageFormat.image_channel_data_type = CL_UNORM_INT8; imageFormat.image_channel_order = CL_NV12_INTEL; - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, pClDevice->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, pClDevice->getHardwareInfo().capabilityTable.supportsOcl21Features); cl_image_desc imageDesc = {}; imageDesc.image_type = CL_MEM_OBJECT_IMAGE2D; @@ -2096,7 +2096,7 @@ HWTEST_F(KernelResidencyTest, test_MakeArgsResidentCheckImageFromImage) { //create Y plane imageFormat.image_channel_order = CL_R; flags = CL_MEM_READ_ONLY; - surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); imageDesc.image_width = 0; imageDesc.image_height = 0; diff --git a/opencl/test/unit_test/mem_obj/create_image_format_tests.cpp b/opencl/test/unit_test/mem_obj/create_image_format_tests.cpp index 613f8927d0..e030722672 100644 --- a/opencl/test/unit_test/mem_obj/create_image_format_tests.cpp +++ b/opencl/test/unit_test/mem_obj/create_image_format_tests.cpp @@ -29,7 +29,7 @@ class CreateImageFormatTest : public testing::TestWithParam { indexImageFormat = GetParam(); ArrayRef - surfaceFormatTable = SurfaceFormats::surfaceFormats(flags, defaultHwInfo->capabilityTable.clVersionSupport); + surfaceFormatTable = SurfaceFormats::surfaceFormats(flags, defaultHwInfo->capabilityTable.supportsOcl21Features); ASSERT_GT(surfaceFormatTable.size(), indexImageFormat); surfaceFormat = &surfaceFormatTable[indexImageFormat]; diff --git a/opencl/test/unit_test/mem_obj/image1d_tests.cpp b/opencl/test/unit_test/mem_obj/image1d_tests.cpp index c3301a1345..96844f16b0 100644 --- a/opencl/test/unit_test/mem_obj/image1d_tests.cpp +++ b/opencl/test/unit_test/mem_obj/image1d_tests.cpp @@ -72,7 +72,7 @@ typedef CreateImage1DTest CreateImage1DType; HWTEST_P(CreateImage1DType, validTypes) { cl_mem_flags flags = CL_MEM_READ_WRITE; - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, pClDevice->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, pClDevice->getHardwareInfo().capabilityTable.supportsOcl21Features); auto image = Image::create( context, MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), diff --git a/opencl/test/unit_test/mem_obj/image2d_from_buffer_tests.cpp b/opencl/test/unit_test/mem_obj/image2d_from_buffer_tests.cpp index b221e0bbb6..94f54aad5a 100644 --- a/opencl/test/unit_test/mem_obj/image2d_from_buffer_tests.cpp +++ b/opencl/test/unit_test/mem_obj/image2d_from_buffer_tests.cpp @@ -59,7 +59,7 @@ class Image2dFromBufferTest : public DeviceFixture, public ::testing::Test { Image *createImage() { cl_mem_flags flags = CL_MEM_READ_ONLY; - auto surfaceFormat = (ClSurfaceFormatInfo *)Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = (ClSurfaceFormatInfo *)Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); return Image::create(&context, MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), flags, 0, surfaceFormat, &imageDesc, NULL, retVal); } cl_image_format imageFormat; @@ -90,7 +90,7 @@ TEST_F(Image2dFromBufferTest, CreateImage2dFromBuffer) { TEST_F(Image2dFromBufferTest, givenBufferWhenCreateImage2dArrayFromBufferThenImageDescriptorIsInvalid) { imageDesc.image_type = CL_MEM_OBJECT_IMAGE2D_ARRAY; cl_mem_flags flags = CL_MEM_READ_ONLY; - auto surfaceFormat = (ClSurfaceFormatInfo *)Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = (ClSurfaceFormatInfo *)Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); retVal = Image::validate(&context, MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), surfaceFormat, &imageDesc, NULL); EXPECT_EQ(CL_INVALID_IMAGE_DESCRIPTOR, retVal); } @@ -106,7 +106,7 @@ TEST_F(Image2dFromBufferTest, givenInvalidRowPitchWhenCreateImage2dFromBufferThe char ptr[10]; imageDesc.image_row_pitch = 255; cl_mem_flags flags = CL_MEM_READ_ONLY; - auto surfaceFormat = (ClSurfaceFormatInfo *)Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = (ClSurfaceFormatInfo *)Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); retVal = Image::validate(&context, MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), surfaceFormat, &imageDesc, ptr); EXPECT_EQ(CL_INVALID_IMAGE_FORMAT_DESCRIPTOR, retVal); } @@ -135,7 +135,7 @@ TEST_F(Image2dFromBufferTest, InvalidHostPtrAlignment) { imageDesc.mem_object = clCreateBuffer(&context, CL_MEM_USE_HOST_PTR, size, nonAlignedHostPtr, &retVal); ASSERT_NE(nullptr, imageDesc.mem_object); cl_mem_flags flags = CL_MEM_READ_ONLY; - auto surfaceFormat = (ClSurfaceFormatInfo *)Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = (ClSurfaceFormatInfo *)Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); retVal = Image::validate(&context, MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), surfaceFormat, &imageDesc, NULL); EXPECT_EQ(CL_INVALID_IMAGE_FORMAT_DESCRIPTOR, retVal); @@ -148,7 +148,7 @@ TEST_F(Image2dFromBufferTest, givenInvalidFlagsWhenValidateIsCalledThenReturnErr cl_mem_flags flags[] = {CL_MEM_USE_HOST_PTR, CL_MEM_COPY_HOST_PTR}; for (auto flag : flags) { - const auto surfaceFormat = Image::getSurfaceFormatFromTable(flag, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + const auto surfaceFormat = Image::getSurfaceFormatFromTable(flag, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); retVal = Image::validate(&context, MemoryPropertiesParser::createMemoryProperties(flag, 0, 0), surfaceFormat, &imageDesc, reinterpret_cast(0x12345)); EXPECT_EQ(CL_INVALID_VALUE, retVal); } @@ -161,7 +161,7 @@ TEST_F(Image2dFromBufferTest, givenOneChannel8BitColorsNoRowPitchSpecifiedAndToo imageFormat.image_channel_data_type = CL_UNORM_INT8; imageFormat.image_channel_order = CL_R; - const auto surfaceFormat = static_cast(Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport)); + const auto surfaceFormat = static_cast(Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features)); retVal = Image::validate(&context, MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), surfaceFormat, &imageDesc, NULL); EXPECT_EQ(CL_INVALID_IMAGE_FORMAT_DESCRIPTOR, retVal); } @@ -173,7 +173,7 @@ TEST_F(Image2dFromBufferTest, givenOneChannel16BitColorsNoRowPitchSpecifiedAndTo imageFormat.image_channel_data_type = CL_UNORM_INT16; imageFormat.image_channel_order = CL_R; - const auto surfaceFormat = static_cast(Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport)); + const auto surfaceFormat = static_cast(Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features)); retVal = Image::validate(&context, MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), surfaceFormat, &imageDesc, NULL); EXPECT_EQ(CL_INVALID_IMAGE_FORMAT_DESCRIPTOR, retVal); } @@ -185,7 +185,7 @@ TEST_F(Image2dFromBufferTest, givenFourChannel8BitColorsNoRowPitchSpecifiedAndTo imageFormat.image_channel_data_type = CL_UNORM_INT8; imageFormat.image_channel_order = CL_RGBA; - const auto surfaceFormat = static_cast(Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport)); + const auto surfaceFormat = static_cast(Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features)); retVal = Image::validate(&context, MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), surfaceFormat, &imageDesc, NULL); EXPECT_EQ(CL_INVALID_IMAGE_FORMAT_DESCRIPTOR, retVal); } @@ -197,7 +197,7 @@ TEST_F(Image2dFromBufferTest, givenFourChannel16BitColorsNoRowPitchSpecifiedAndT imageFormat.image_channel_data_type = CL_UNORM_INT16; imageFormat.image_channel_order = CL_RGBA; - const auto surfaceFormat = static_cast(Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport)); + const auto surfaceFormat = static_cast(Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features)); retVal = Image::validate(&context, MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), surfaceFormat, &imageDesc, NULL); EXPECT_EQ(CL_INVALID_IMAGE_FORMAT_DESCRIPTOR, retVal); } @@ -210,7 +210,7 @@ TEST_F(Image2dFromBufferTest, givenFourChannel8BitColorsAndNotTooLargeRowPitchSp imageFormat.image_channel_data_type = CL_UNORM_INT8; imageFormat.image_channel_order = CL_RGBA; - const auto surfaceFormat = static_cast(Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport)); + const auto surfaceFormat = static_cast(Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features)); retVal = Image::validate(&context, MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), surfaceFormat, &imageDesc, NULL); EXPECT_EQ(CL_SUCCESS, retVal); } @@ -224,7 +224,7 @@ TEST_F(Image2dFromBufferTest, givenFourChannel8BitColorsAndTooLargeRowPitchSpeci imageFormat.image_channel_data_type = CL_UNORM_INT8; imageFormat.image_channel_order = CL_RGBA; - const auto surfaceFormat = static_cast(Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport)); + const auto surfaceFormat = static_cast(Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features)); retVal = Image::validate(&context, MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), surfaceFormat, &imageDesc, NULL); EXPECT_EQ(CL_INVALID_IMAGE_FORMAT_DESCRIPTOR, retVal); } @@ -238,7 +238,7 @@ TEST_F(Image2dFromBufferTest, givenUnalignedImageWidthAndNoSpaceInBufferForAlign imageFormat.image_channel_data_type = CL_UNORM_INT8; imageFormat.image_channel_order = CL_R; - const auto surfaceFormat = static_cast(Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport)); + const auto surfaceFormat = static_cast(Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features)); retVal = Image::validate(&context, MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), surfaceFormat, &imageDesc, NULL); EXPECT_EQ(CL_INVALID_IMAGE_FORMAT_DESCRIPTOR, retVal); } diff --git a/opencl/test/unit_test/mem_obj/image2d_tests.cpp b/opencl/test/unit_test/mem_obj/image2d_tests.cpp index 09b906d2e3..815964eff6 100644 --- a/opencl/test/unit_test/mem_obj/image2d_tests.cpp +++ b/opencl/test/unit_test/mem_obj/image2d_tests.cpp @@ -54,7 +54,7 @@ class CreateImage2DTest : public DeviceFixture, DeviceFixture::TearDown(); } Image *createImageWithFlags(cl_mem_flags flags) { - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); return Image::create(context, MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal); } cl_image_format imageFormat; diff --git a/opencl/test/unit_test/mem_obj/image3d_tests.cpp b/opencl/test/unit_test/mem_obj/image3d_tests.cpp index 7cecea8b19..0eab9f889a 100644 --- a/opencl/test/unit_test/mem_obj/image3d_tests.cpp +++ b/opencl/test/unit_test/mem_obj/image3d_tests.cpp @@ -60,7 +60,7 @@ class CreateImage3DTest : public DeviceFixture, HWTEST_F(CreateImage3DTest, validTypes) { cl_mem_flags flags = CL_MEM_READ_WRITE; - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); auto image = Image::create(context, MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal); ASSERT_EQ(CL_SUCCESS, retVal); @@ -88,7 +88,7 @@ HWTEST_F(CreateImage3DTest, validTypes) { HWTEST_F(CreateImage3DTest, calculate3dImageQpitchTiledAndLinear) { bool defaultTiling = DebugManager.flags.ForceLinearImages.get(); imageDesc.image_height = 1; - auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); auto imgInfo = MockGmm::initImgInfo(imageDesc, 0, surfaceFormat); MockGmm::queryImgParams(context->getDevice(0)->getGmmClientContext(), imgInfo); @@ -113,7 +113,7 @@ HWTEST_F(CreateImage3DTest, calculate3dImageQpitchTiledAndLinear) { DebugManager.flags.ForceLinearImages.set(!defaultTiling); // query again - surfaceFormat = Image::getSurfaceFormatFromTable(0, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + surfaceFormat = Image::getSurfaceFormatFromTable(0, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); MockGmm::queryImgParams(context->getDevice(0)->getGmmClientContext(), imgInfo); image = Image::create( diff --git a/opencl/test/unit_test/mem_obj/image_array_size_tests.cpp b/opencl/test/unit_test/mem_obj/image_array_size_tests.cpp index 44d2bc3d90..42f4819cec 100644 --- a/opencl/test/unit_test/mem_obj/image_array_size_tests.cpp +++ b/opencl/test/unit_test/mem_obj/image_array_size_tests.cpp @@ -72,7 +72,7 @@ typedef ImageArraySizeTest CreateImageArraySize; HWTEST_P(CreateImageArraySize, arrayTypes) { cl_mem_flags flags = CL_MEM_READ_WRITE; - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); auto image = Image::create( context, MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), @@ -113,7 +113,7 @@ typedef ImageArraySizeTest CreateImageNonArraySize; HWTEST_P(CreateImageNonArraySize, NonArrayTypes) { cl_mem_flags flags = CL_MEM_READ_WRITE; - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); auto image = Image::create( context, MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), diff --git a/opencl/test/unit_test/mem_obj/image_from_subbuffer_tests.cpp b/opencl/test/unit_test/mem_obj/image_from_subbuffer_tests.cpp index b358cd9b97..bdf3a60be5 100644 --- a/opencl/test/unit_test/mem_obj/image_from_subbuffer_tests.cpp +++ b/opencl/test/unit_test/mem_obj/image_from_subbuffer_tests.cpp @@ -61,7 +61,7 @@ class ImageFromSubBufferTest : public DeviceFixture, public ::testing::Test { Image *createImage() { cl_mem_flags flags = CL_MEM_READ_ONLY; - auto surfaceFormat = (ClSurfaceFormatInfo *)Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = (ClSurfaceFormatInfo *)Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); return Image::create(&context, MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), flags, 0, surfaceFormat, &imageDesc, NULL, retVal); } cl_image_format imageFormat; diff --git a/opencl/test/unit_test/mem_obj/image_redescribe_tests.cpp b/opencl/test/unit_test/mem_obj/image_redescribe_tests.cpp index a39828bd42..53a6267fa7 100644 --- a/opencl/test/unit_test/mem_obj/image_redescribe_tests.cpp +++ b/opencl/test/unit_test/mem_obj/image_redescribe_tests.cpp @@ -50,7 +50,7 @@ class ImageRedescribeTest : public testing::TestWithParamgetHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); image.reset(Image::create( &context, MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), @@ -192,7 +192,7 @@ TEST_P(ImageRedescribeTest, givenImageWithMaxSizesWhenItIsRedescribedThenNewImag imageDesc.num_samples = 0; imageDesc.mem_object = NULL; cl_mem_flags flags = CL_MEM_READ_WRITE; - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); auto bigImage = std::unique_ptr(Image::create(&context, MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), flags, diff --git a/opencl/test/unit_test/mem_obj/image_snorm_tests.cpp b/opencl/test/unit_test/mem_obj/image_snorm_tests.cpp index 13ed006016..4f89f5ec58 100644 --- a/opencl/test/unit_test/mem_obj/image_snorm_tests.cpp +++ b/opencl/test/unit_test/mem_obj/image_snorm_tests.cpp @@ -40,12 +40,12 @@ TEST_P(SnormSurfaceFormatAccessFlagsTests, givenSnormFormatWhenGetSurfaceFormatF cl_mem_flags flags = GetParam(); for (const auto &snormSurfaceFormat : referenceSnormSurfaceFormats) { - auto format = Image::getSurfaceFormatFromTable(flags, &snormSurfaceFormat.OCLImageFormat, 12); + auto format = Image::getSurfaceFormatFromTable(flags, &snormSurfaceFormat.OCLImageFormat, false /* supportsOcl20Features */); EXPECT_NE(nullptr, format); EXPECT_TRUE(memcmp(&snormSurfaceFormat, format, sizeof(ClSurfaceFormatInfo)) == 0); } for (const auto &snormSurfaceFormat : referenceSnormSurfaceFormats) { - auto format = Image::getSurfaceFormatFromTable(flags, &snormSurfaceFormat.OCLImageFormat, 20); + auto format = Image::getSurfaceFormatFromTable(flags, &snormSurfaceFormat.OCLImageFormat, true /* supportsOcl20Features */); EXPECT_NE(nullptr, format); EXPECT_TRUE(memcmp(&snormSurfaceFormat, format, sizeof(ClSurfaceFormatInfo)) == 0); } diff --git a/opencl/test/unit_test/mem_obj/image_tests.cpp b/opencl/test/unit_test/mem_obj/image_tests.cpp index 9c09cc66cd..569f062dae 100644 --- a/opencl/test/unit_test/mem_obj/image_tests.cpp +++ b/opencl/test/unit_test/mem_obj/image_tests.cpp @@ -46,7 +46,7 @@ class CreateImageTest : public DeviceFixture, CreateImageTest() { } Image *createImageWithFlags(cl_mem_flags flags) { - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); return Image::create(context, MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal); } @@ -120,7 +120,7 @@ TEST(TestSliceAndRowPitch, ForDifferentDescriptorsGetHostPtrSlicePitchAndRowPitc imageDesc.image_slice_pitch = 0; cl_mem_flags flags = CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR; - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); auto image = Image::create( &context, MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), @@ -345,7 +345,7 @@ TEST(TestCreateImage, UseSharedContextToCreateImage) { imageDesc.image_slice_pitch = 0; cl_mem_flags flags = CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR; - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); auto image = Image::create( &context, @@ -406,7 +406,7 @@ TEST(TestCreateImageUseHostPtr, CheckMemoryAllocationForDifferenHostPtrAlignment true}; cl_mem_flags flags = CL_MEM_HOST_NO_ACCESS | CL_MEM_USE_HOST_PTR; - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); for (int i = 0; i < 4; i++) { auto image = Image::create( &context, @@ -443,7 +443,7 @@ TEST(TestCreateImageUseHostPtr, givenZeroCopyImageValuesWhenUsingHostPtrThenZero imageFormat.image_channel_order = CL_R; cl_mem_flags flags = CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR; - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); auto hostPtr = alignedMalloc(imageDesc.image_width * surfaceFormat->surfaceFormat.ImageElementSizeInBytes, MemoryConstants::cacheLineSize); auto image = std::unique_ptr(Image::create( @@ -554,7 +554,7 @@ struct CreateImageHostPtr } Image *createImage(cl_int &retVal) { - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); return Image::create( context, MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), @@ -961,7 +961,7 @@ INSTANTIATE_TEST_CASE_P( TEST(ImageGetSurfaceFormatInfoTest, givenNullptrFormatWhenGetSurfaceFormatInfoIsCalledThenReturnsNullptr) { MockContext context; - auto surfaceFormat = Image::getSurfaceFormatFromTable(0, nullptr, context.getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(0, nullptr, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); EXPECT_EQ(nullptr, surfaceFormat); } @@ -970,7 +970,7 @@ HWTEST_F(ImageCompressionTests, givenTiledImageWhenCreatingAllocationThenPreferR imageDesc.image_width = 5; imageDesc.image_height = 5; MockContext context; - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); auto image = std::unique_ptr(Image::create(mockContext.get(), MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal)); @@ -984,7 +984,7 @@ TEST_F(ImageCompressionTests, givenNonTiledImageWhenCreatingAllocationThenDontPr imageDesc.image_type = CL_MEM_OBJECT_IMAGE1D; imageDesc.image_width = 5; MockContext context; - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); auto image = std::unique_ptr(Image::create(mockContext.get(), MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal)); @@ -1182,7 +1182,7 @@ TEST(ImageTest, givenClMemForceLinearStorageSetWhenCreateImageThenDisallowTiling imageFormat.image_channel_order = CL_R; cl_mem_flags flags = CL_MEM_READ_WRITE | CL_MEM_FORCE_LINEAR_STORAGE_INTEL; - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); auto image = std::unique_ptr(Image::create( &context, @@ -1229,7 +1229,7 @@ TEST(ImageTest, givenClMemCopyHostPointerPassedToImageCreateWhenAllocationIsNotI imageFormat.image_channel_data_type = CL_UNSIGNED_INT8; imageFormat.image_channel_order = CL_R; MockContext context; - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); std::unique_ptr image(Image::create(&ctx, MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), flags, 0, surfaceFormat, &imageDesc, memory, retVal)); EXPECT_NE(nullptr, image); diff --git a/opencl/test/unit_test/mem_obj/image_tiled_tests.cpp b/opencl/test/unit_test/mem_obj/image_tiled_tests.cpp index 22fcc04377..a3d556faf9 100644 --- a/opencl/test/unit_test/mem_obj/image_tiled_tests.cpp +++ b/opencl/test/unit_test/mem_obj/image_tiled_tests.cpp @@ -70,7 +70,7 @@ class CreateTiledImageTest : public DeviceFixture, HWTEST_P(CreateTiledImageTest, isTiledImageIsSetForTiledImages) { MockContext context; cl_mem_flags flags = CL_MEM_READ_WRITE; - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, pClDevice->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, pClDevice->getHardwareInfo().capabilityTable.supportsOcl21Features); auto image = Image::create( &context, MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), diff --git a/opencl/test/unit_test/mem_obj/image_validate_tests.cpp b/opencl/test/unit_test/mem_obj/image_validate_tests.cpp index 620d17f5c4..c589c2929f 100644 --- a/opencl/test/unit_test/mem_obj/image_validate_tests.cpp +++ b/opencl/test/unit_test/mem_obj/image_validate_tests.cpp @@ -112,12 +112,12 @@ TEST(ImageDepthFormatTest, returnSurfaceFormatForDepthFormats) { imgFormat.image_channel_order = CL_DEPTH; imgFormat.image_channel_data_type = CL_FLOAT; - auto surfaceFormatInfo = Image::getSurfaceFormatFromTable(CL_MEM_READ_WRITE, &imgFormat, defaultHwInfo->capabilityTable.clVersionSupport); + auto surfaceFormatInfo = Image::getSurfaceFormatFromTable(CL_MEM_READ_WRITE, &imgFormat, defaultHwInfo->capabilityTable.supportsOcl21Features); ASSERT_NE(surfaceFormatInfo, nullptr); EXPECT_TRUE(surfaceFormatInfo->surfaceFormat.GMMSurfaceFormat == GMM_FORMAT_R32_FLOAT_TYPE); imgFormat.image_channel_data_type = CL_UNORM_INT16; - surfaceFormatInfo = Image::getSurfaceFormatFromTable(CL_MEM_READ_WRITE, &imgFormat, defaultHwInfo->capabilityTable.clVersionSupport); + surfaceFormatInfo = Image::getSurfaceFormatFromTable(CL_MEM_READ_WRITE, &imgFormat, defaultHwInfo->capabilityTable.supportsOcl21Features); ASSERT_NE(surfaceFormatInfo, nullptr); EXPECT_TRUE(surfaceFormatInfo->surfaceFormat.GMMSurfaceFormat == GMM_FORMAT_R16_UNORM_TYPE); } @@ -127,12 +127,12 @@ TEST(ImageDepthFormatTest, returnSurfaceFormatForWriteOnlyDepthFormats) { imgFormat.image_channel_order = CL_DEPTH; imgFormat.image_channel_data_type = CL_FLOAT; - auto surfaceFormatInfo = Image::getSurfaceFormatFromTable(CL_MEM_WRITE_ONLY, &imgFormat, defaultHwInfo->capabilityTable.clVersionSupport); + auto surfaceFormatInfo = Image::getSurfaceFormatFromTable(CL_MEM_WRITE_ONLY, &imgFormat, defaultHwInfo->capabilityTable.supportsOcl21Features); ASSERT_NE(surfaceFormatInfo, nullptr); EXPECT_TRUE(surfaceFormatInfo->surfaceFormat.GMMSurfaceFormat == GMM_FORMAT_R32_FLOAT_TYPE); imgFormat.image_channel_data_type = CL_UNORM_INT16; - surfaceFormatInfo = Image::getSurfaceFormatFromTable(CL_MEM_WRITE_ONLY, &imgFormat, defaultHwInfo->capabilityTable.clVersionSupport); + surfaceFormatInfo = Image::getSurfaceFormatFromTable(CL_MEM_WRITE_ONLY, &imgFormat, defaultHwInfo->capabilityTable.supportsOcl21Features); ASSERT_NE(surfaceFormatInfo, nullptr); EXPECT_TRUE(surfaceFormatInfo->surfaceFormat.GMMSurfaceFormat == GMM_FORMAT_R16_UNORM_TYPE); } @@ -142,13 +142,13 @@ TEST(ImageDepthFormatTest, returnSurfaceFormatForDepthStencilFormats) { imgFormat.image_channel_order = CL_DEPTH_STENCIL; imgFormat.image_channel_data_type = CL_UNORM_INT24; - auto surfaceFormatInfo = Image::getSurfaceFormatFromTable(CL_MEM_READ_ONLY, &imgFormat, defaultHwInfo->capabilityTable.clVersionSupport); + auto surfaceFormatInfo = Image::getSurfaceFormatFromTable(CL_MEM_READ_ONLY, &imgFormat, defaultHwInfo->capabilityTable.supportsOcl21Features); ASSERT_NE(surfaceFormatInfo, nullptr); EXPECT_TRUE(surfaceFormatInfo->surfaceFormat.GMMSurfaceFormat == GMM_FORMAT_GENERIC_32BIT); imgFormat.image_channel_order = CL_DEPTH_STENCIL; imgFormat.image_channel_data_type = CL_FLOAT; - surfaceFormatInfo = Image::getSurfaceFormatFromTable(CL_MEM_READ_ONLY, &imgFormat, defaultHwInfo->capabilityTable.clVersionSupport); + surfaceFormatInfo = Image::getSurfaceFormatFromTable(CL_MEM_READ_ONLY, &imgFormat, defaultHwInfo->capabilityTable.supportsOcl21Features); ASSERT_NE(surfaceFormatInfo, nullptr); EXPECT_TRUE(surfaceFormatInfo->surfaceFormat.GMMSurfaceFormat == GMM_FORMAT_R32G32_FLOAT_TYPE); } diff --git a/opencl/test/unit_test/mem_obj/mem_obj_destruction_tests.cpp b/opencl/test/unit_test/mem_obj/mem_obj_destruction_tests.cpp index 7533caa4ed..b960d6957e 100644 --- a/opencl/test/unit_test/mem_obj/mem_obj_destruction_tests.cpp +++ b/opencl/test/unit_test/mem_obj/mem_obj_destruction_tests.cpp @@ -329,7 +329,7 @@ HWTEST_F(UsmDestructionTests, givenSharedUsmAllocationWhenBlockingFreeIsCalledTh MockClDevice mockClDevice(&mockDevice); MockContext mockContext(&mockClDevice, false); - if (mockContext.getDevice(0u)->getHardwareInfo().capabilityTable.clVersionSupport < 20) { + if (mockContext.getDevice(0u)->getHardwareInfo().capabilityTable.supportsOcl21Features == false) { GTEST_SKIP(); } @@ -368,7 +368,7 @@ HWTEST_F(UsmDestructionTests, givenUsmAllocationWhenBlockingFreeIsCalledThenWait MockClDevice mockClDevice(&mockDevice); MockContext mockContext(&mockClDevice, false); - if (mockContext.getDevice(0u)->getHardwareInfo().capabilityTable.clVersionSupport < 20) { + if (mockContext.getDevice(0u)->getHardwareInfo().capabilityTable.supportsOcl21Features == false) { GTEST_SKIP(); } diff --git a/opencl/test/unit_test/mem_obj/nv12_image_tests.cpp b/opencl/test/unit_test/mem_obj/nv12_image_tests.cpp index 060f6f2223..6e9b10f605 100644 --- a/opencl/test/unit_test/mem_obj/nv12_image_tests.cpp +++ b/opencl/test/unit_test/mem_obj/nv12_image_tests.cpp @@ -73,12 +73,12 @@ class Nv12ImageTest : public testing::Test { } void validateImageWithFlags(cl_mem_flags flags) { - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); retVal = Image::validate(&context, MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), surfaceFormat, &imageDesc, nullptr); } Image *createImageWithFlags(cl_mem_flags flags) { - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); return Image::create(&context, MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal); } @@ -396,7 +396,7 @@ HWTEST_F(Nv12ImageTest, checkIfPlanesAreWritten) { // Create Parent NV12 image cl_mem_flags flags = CL_MEM_READ_ONLY | CL_MEM_ACCESS_FLAGS_UNRESTRICTED_INTEL | CL_MEM_USE_HOST_PTR; - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); auto imageNV12 = Image::create(contextWithMockCmdQ, MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), flags, 0, surfaceFormat, &imageDesc, hostPtr, retVal); diff --git a/opencl/test/unit_test/mem_obj/packed_yuv_image_tests.cpp b/opencl/test/unit_test/mem_obj/packed_yuv_image_tests.cpp index c6c001b688..33bac088d9 100644 --- a/opencl/test/unit_test/mem_obj/packed_yuv_image_tests.cpp +++ b/opencl/test/unit_test/mem_obj/packed_yuv_image_tests.cpp @@ -54,7 +54,7 @@ class PackedYuvImageTest : public testing::Test, retVal = Image::validateImageFormat(&imageFormat); if (retVal != CL_SUCCESS) return; - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); retVal = Image::validate(&context, MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), surfaceFormat, &imageDesc, nullptr); } @@ -70,7 +70,7 @@ cl_channel_order packedYuvChannels[] = {CL_YUYV_INTEL, CL_UYVY_INTEL, CL_YVYU_IN TEST_P(PackedYuvImageTest, isPackedYuvImageReturnsTrue) { flags = CL_MEM_READ_ONLY; - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); auto image = Image::create( &context, MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), diff --git a/opencl/test/unit_test/memory_manager/memory_manager_tests.cpp b/opencl/test/unit_test/memory_manager/memory_manager_tests.cpp index 0b53baafa6..945fd993e8 100644 --- a/opencl/test/unit_test/memory_manager/memory_manager_tests.cpp +++ b/opencl/test/unit_test/memory_manager/memory_manager_tests.cpp @@ -706,7 +706,7 @@ TEST(OsAgnosticMemoryManager, givenHostPointerNotRequiringCopyWhenAllocateGraphi imageFormat.image_channel_order = CL_RGBA; cl_mem_flags flags = CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR; - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, defaultHwInfo->capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, defaultHwInfo->capabilityTable.supportsOcl21Features); auto imgInfo = MockGmm::initImgInfo(imgDesc, 0, surfaceFormat); imgInfo.rowPitch = imgDesc.image_width * 4; @@ -746,7 +746,7 @@ TEST(OsAgnosticMemoryManager, givenHostPointerRequiringCopyWhenAllocateGraphicsM imageFormat.image_channel_order = CL_RGBA; cl_mem_flags flags = CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR; - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, defaultHwInfo->capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, defaultHwInfo->capabilityTable.supportsOcl21Features); auto imgInfo = MockGmm::initImgInfo(imgDesc, 0, surfaceFormat); imgInfo.rowPitch = imgDesc.image_width * 4; @@ -1858,7 +1858,7 @@ TEST(MemoryManagerTest, givenAllowedTilingWhenIsCopyRequiredIsCalledThenTrueIsRe imageFormat.image_channel_order = CL_R; cl_mem_flags flags = CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR; - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, defaultHwInfo->capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, defaultHwInfo->capabilityTable.supportsOcl21Features); imgInfo.imgDesc = Image::convertDescriptor(imageDesc); imgInfo.surfaceFormat = &surfaceFormat->surfaceFormat; @@ -1884,7 +1884,7 @@ TEST(MemoryManagerTest, givenDifferentRowPitchWhenIsCopyRequiredIsCalledThenTrue imageFormat.image_channel_order = CL_R; cl_mem_flags flags = CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR; - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, defaultHwInfo->capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, defaultHwInfo->capabilityTable.supportsOcl21Features); imgInfo.imgDesc = Image::convertDescriptor(imageDesc); imgInfo.surfaceFormat = &surfaceFormat->surfaceFormat; @@ -1905,7 +1905,7 @@ TEST(MemoryManagerTest, givenDifferentSlicePitchAndTilingNotAllowedWhenIsCopyReq imageFormat.image_channel_order = CL_R; cl_mem_flags flags = CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR; - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, defaultHwInfo->capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, defaultHwInfo->capabilityTable.supportsOcl21Features); cl_image_desc imageDesc{}; imageDesc.image_type = CL_MEM_OBJECT_IMAGE1D; @@ -1931,7 +1931,7 @@ TEST(MemoryManagerTest, givenNotCachelinAlignedPointerWhenIsCopyRequiredIsCalled imageFormat.image_channel_order = CL_R; cl_mem_flags flags = CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR; - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, defaultHwInfo->capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, defaultHwInfo->capabilityTable.supportsOcl21Features); cl_image_desc imageDesc{}; imageDesc.image_type = CL_MEM_OBJECT_IMAGE1D; @@ -1956,7 +1956,7 @@ TEST(MemoryManagerTest, givenCachelineAlignedPointerAndProperDescriptorValuesWhe imageFormat.image_channel_order = CL_R; cl_mem_flags flags = CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR; - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, defaultHwInfo->capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, defaultHwInfo->capabilityTable.supportsOcl21Features); cl_image_desc imageDesc{}; imageDesc.image_type = CL_MEM_OBJECT_IMAGE1D; @@ -1988,7 +1988,7 @@ TEST(MemoryManagerTest, givenForcedLinearImages3DImageAndProperDescriptorValuesW imageFormat.image_channel_order = CL_R; cl_mem_flags flags = CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR; - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, defaultHwInfo->capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, defaultHwInfo->capabilityTable.supportsOcl21Features); cl_image_desc imageDesc{}; imageDesc.image_type = CL_MEM_OBJECT_IMAGE3D; diff --git a/opencl/test/unit_test/memory_manager/unified_memory_manager_tests.cpp b/opencl/test/unit_test/memory_manager/unified_memory_manager_tests.cpp index 8615714d5c..091b981009 100644 --- a/opencl/test/unit_test/memory_manager/unified_memory_manager_tests.cpp +++ b/opencl/test/unit_test/memory_manager/unified_memory_manager_tests.cpp @@ -709,7 +709,7 @@ TEST(UnfiedSharedMemoryTransferCalls, givenHostUsmAllocationWhenPtrIsUsedForTran MockContext mockContext; cl_context clContext = &mockContext; - if (mockContext.getDevice(0u)->getHardwareInfo().capabilityTable.clVersionSupport < 20) { + if (mockContext.getDevice(0u)->getHardwareInfo().capabilityTable.supportsOcl21Features == false) { GTEST_SKIP(); } diff --git a/opencl/test/unit_test/os_interface/linux/drm_memory_manager_tests.cpp b/opencl/test/unit_test/os_interface/linux/drm_memory_manager_tests.cpp index b73ca7dd5f..4960221151 100644 --- a/opencl/test/unit_test/os_interface/linux/drm_memory_manager_tests.cpp +++ b/opencl/test/unit_test/os_interface/linux/drm_memory_manager_tests.cpp @@ -1332,7 +1332,7 @@ HWTEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenTiledImageWithMipCountZe auto retVal = CL_SUCCESS; cl_mem_flags flags = CL_MEM_WRITE_ONLY; - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); std::unique_ptr dstImage(Image::create(&context, MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal)); EXPECT_EQ(CL_SUCCESS, retVal); @@ -1379,7 +1379,7 @@ HWTEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenTiledImageWithMipCountNo auto retVal = CL_SUCCESS; cl_mem_flags flags = CL_MEM_WRITE_ONLY; - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); std::unique_ptr dstImage(Image::create(&context, MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal)); EXPECT_EQ(CL_SUCCESS, retVal); @@ -1419,7 +1419,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenTiledImageIsBeingCreatedAn InjectedFunction method = [&](size_t failureIndex) { cl_mem_flags flags = CL_MEM_WRITE_ONLY; - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); std::unique_ptr dstImage(Image::create(&context, MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal)); if (MemoryManagement::nonfailingAllocation == failureIndex) { @@ -1480,7 +1480,7 @@ HWTEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenTiledImageIsBeingCreated auto retVal = CL_SUCCESS; cl_mem_flags flags = CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR; - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); std::unique_ptr dstImage(Image::create(&context, MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), flags, 0, surfaceFormat, &imageDesc, data, retVal)); EXPECT_EQ(CL_SUCCESS, retVal); @@ -1525,7 +1525,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenMemoryAllocatedForImageThe auto retVal = CL_SUCCESS; cl_mem_flags flags = CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR; - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); std::unique_ptr dstImage(Image::create(&context, MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), flags, 0, surfaceFormat, &imageDesc, data, retVal)); EXPECT_EQ(CL_SUCCESS, retVal); @@ -1557,7 +1557,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenNonTiledImgWithMipCountZer auto retVal = CL_SUCCESS; cl_mem_flags flags = CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR; - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); std::unique_ptr dstImage(Image::create(&context, MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), flags, 0, surfaceFormat, &imageDesc, data, retVal)); EXPECT_EQ(CL_SUCCESS, retVal); @@ -1601,7 +1601,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenNonTiledImgWithMipCountNon auto retVal = CL_SUCCESS; cl_mem_flags flags = CL_MEM_WRITE_ONLY; - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); std::unique_ptr dstImage(Image::create(&context, MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), flags, 0, surfaceFormat, &imageDesc, data, retVal)); EXPECT_EQ(CL_SUCCESS, retVal); @@ -1645,7 +1645,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhen1DarrayImageIsBeingCreated auto retVal = CL_SUCCESS; cl_mem_flags flags = CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR; - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); std::unique_ptr dstImage(Image::create(&context, MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), flags, 0, surfaceFormat, &imageDesc, data, retVal)); auto imageGraphicsAllocation = dstImage->getGraphicsAllocation(); @@ -1679,7 +1679,7 @@ TEST_F(DrmMemoryManagerTest, givenHostPointerNotRequiringCopyWhenAllocateGraphic cl_mem_flags flags = CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR; MockContext context(device); - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); auto imgInfo = MockGmm::initImgInfo(imgDesc, 0, surfaceFormat); imgInfo.rowPitch = imgDesc.image_width * surfaceFormat->surfaceFormat.ImageElementSizeInBytes; @@ -1788,7 +1788,7 @@ TEST_F(DrmMemoryManagerTest, givenOsHandleWithNonTiledObjectWhenCreateFromShared imgInfo.imgDesc = Image::convertDescriptor(imgDesc); MockContext context(device); - gmmSurfaceFormat = Image::getSurfaceFormatFromTable(flags, &gmmImgFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + gmmSurfaceFormat = Image::getSurfaceFormatFromTable(flags, &gmmImgFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); imgInfo.surfaceFormat = &gmmSurfaceFormat->surfaceFormat; imgInfo.plane = GMM_PLANE_Y; @@ -1830,7 +1830,7 @@ TEST_F(DrmMemoryManagerTest, givenOsHandleWithTileYObjectWhenCreateFromSharedHan imgInfo.imgDesc = Image::convertDescriptor(imgDesc); MockContext context(device); - gmmSurfaceFormat = Image::getSurfaceFormatFromTable(flags, &gmmImgFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + gmmSurfaceFormat = Image::getSurfaceFormatFromTable(flags, &gmmImgFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); imgInfo.surfaceFormat = &gmmSurfaceFormat->surfaceFormat; imgInfo.plane = GMM_PLANE_Y; @@ -1872,7 +1872,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmMemoryManagerWhenCreateFromSharedHandleFail imgInfo.imgDesc = Image::convertDescriptor(imgDesc); MockContext context(device); - gmmSurfaceFormat = Image::getSurfaceFormatFromTable(flags, &gmmImgFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + gmmSurfaceFormat = Image::getSurfaceFormatFromTable(flags, &gmmImgFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); imgInfo.surfaceFormat = &gmmSurfaceFormat->surfaceFormat; imgInfo.plane = GMM_PLANE_Y; diff --git a/opencl/test/unit_test/os_interface/windows/wddm_memory_manager_tests.cpp b/opencl/test/unit_test/os_interface/windows/wddm_memory_manager_tests.cpp index 9b78f1a095..ff7fe29c78 100644 --- a/opencl/test/unit_test/os_interface/windows/wddm_memory_manager_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/wddm_memory_manager_tests.cpp @@ -642,7 +642,7 @@ HWTEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenTiledImageWithMipCount auto retVal = CL_SUCCESS; cl_mem_flags flags = CL_MEM_WRITE_ONLY; - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); std::unique_ptr dstImage(Image::create(&context, MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal)); EXPECT_EQ(CL_SUCCESS, retVal); @@ -671,7 +671,7 @@ TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenTiledImageWithMipCountNo auto retVal = CL_SUCCESS; cl_mem_flags flags = CL_MEM_WRITE_ONLY; - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); std::unique_ptr dstImage(Image::create(&context, MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal)); EXPECT_EQ(CL_SUCCESS, retVal); @@ -707,7 +707,7 @@ HWTEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenTiledImageIsBeingCreat auto retVal = CL_SUCCESS; cl_mem_flags flags = CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR; - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); std::unique_ptr dstImage(Image::create(&context, MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), flags, 0, surfaceFormat, &imageDesc, data, retVal)); EXPECT_EQ(CL_SUCCESS, retVal); @@ -736,7 +736,7 @@ TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenNonTiledImgWithMipCountZ auto retVal = CL_SUCCESS; cl_mem_flags flags = CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR; - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); std::unique_ptr dstImage(Image::create(&context, MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), flags, 0, surfaceFormat, &imageDesc, data, retVal)); EXPECT_EQ(CL_SUCCESS, retVal); @@ -764,7 +764,7 @@ TEST_F(WddmMemoryManagerTest, givenWddmMemoryManagerWhenNonTiledImgWithMipCountN auto retVal = CL_SUCCESS; cl_mem_flags flags = CL_MEM_WRITE_ONLY; - auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport); + auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features); std::unique_ptr dstImage(Image::create(&context, MemoryPropertiesParser::createMemoryProperties(flags, 0, 0), flags, 0, surfaceFormat, &imageDesc, nullptr, retVal)); EXPECT_EQ(CL_SUCCESS, retVal); diff --git a/opencl/test/unit_test/platform/platform_tests.cpp b/opencl/test/unit_test/platform/platform_tests.cpp index d496a0a2e4..e04fc17030 100644 --- a/opencl/test/unit_test/platform/platform_tests.cpp +++ b/opencl/test/unit_test/platform/platform_tests.cpp @@ -242,7 +242,7 @@ TEST_F(PlatformTest, givenSupportingCl21WhenPlatformSupportsFp64ThenFillMatching std::string compilerExtensions = convertEnabledExtensionsToCompilerInternalOptions(extensionsList.c_str()); EXPECT_THAT(compilerExtensions, ::testing::HasSubstr(std::string(" -cl-ext=-all,+cl"))); - if (hwInfo->capabilityTable.clVersionSupport > 20) { + if (hwInfo->capabilityTable.supportsOcl21Features) { EXPECT_THAT(compilerExtensions, ::testing::HasSubstr(std::string("cl_khr_subgroups"))); EXPECT_THAT(compilerExtensions, ::testing::HasSubstr(std::string("cl_khr_il_program"))); if (hwInfo->capabilityTable.supportsVme) { @@ -274,6 +274,7 @@ TEST_F(PlatformTest, givenNotSupportingCl21WhenPlatformNotSupportFp64ThenNotFill HardwareInfo TesthwInfo = *defaultHwInfo; TesthwInfo.capabilityTable.ftrSupportsFP64 = false; TesthwInfo.capabilityTable.clVersionSupport = 10; + TesthwInfo.capabilityTable.supportsOcl21Features = false; std::string extensionsList = getExtensionsList(TesthwInfo); if (TesthwInfo.capabilityTable.supportsImages) { @@ -308,6 +309,7 @@ TEST_F(PlatformTest, givenSupporteImagesAndClVersion21WhenCreateExtentionsListTh HardwareInfo hwInfo = *defaultHwInfo; hwInfo.capabilityTable.supportsImages = true; hwInfo.capabilityTable.clVersionSupport = 21; + hwInfo.capabilityTable.supportsOcl21Features = true; std::string extensionsList = getExtensionsList(hwInfo); std::string compilerExtensions = convertEnabledExtensionsToCompilerInternalOptions(extensionsList.c_str()); diff --git a/opencl/test/unit_test/sharings/gl/windows/gl_texture_tests.cpp b/opencl/test/unit_test/sharings/gl/windows/gl_texture_tests.cpp index 1a756d754c..91ef0f9726 100644 --- a/opencl/test/unit_test/sharings/gl/windows/gl_texture_tests.cpp +++ b/opencl/test/unit_test/sharings/gl/windows/gl_texture_tests.cpp @@ -209,7 +209,7 @@ TEST_F(GlSharingTextureTests, givenDifferentHwFormatWhenSurfaceFormatInfoIsSetTh cl_int retVal = CL_INVALID_VALUE; cl_image_format imageFormat = {}; GlTexture::setClImageFormat(GL_DEPTH32F_STENCIL8, imageFormat); - auto format = Image::getSurfaceFormatFromTable(CL_MEM_READ_ONLY, &imageFormat, defaultHwInfo->capabilityTable.clVersionSupport); + auto format = Image::getSurfaceFormatFromTable(CL_MEM_READ_ONLY, &imageFormat, defaultHwInfo->capabilityTable.supportsOcl21Features); ASSERT_NE(format, nullptr); auto newHwFormat = 217u; diff --git a/shared/source/helpers/hw_info.h b/shared/source/helpers/hw_info.h index bad1d9c6c8..0d27a5a08b 100644 --- a/shared/source/helpers/hw_info.h +++ b/shared/source/helpers/hw_info.h @@ -55,6 +55,7 @@ struct RuntimeCapabilityTable { bool supportsImages; bool supportsDeviceEnqueue; bool supportsPipes; + bool supportsOcl21Features; bool hostPtrTrackingEnabled; };