refactor: remove always true variable - supportsOcl21Features

Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2025-10-02 10:33:48 +00:00
committed by Compute-Runtime-Automation
parent 0cf67302b2
commit e9af7aee15
85 changed files with 302 additions and 501 deletions

View File

@@ -1272,8 +1272,7 @@ cl_int CL_API_CALL clGetImageParamsINTEL(cl_context context,
}
if (CL_SUCCESS == retVal) {
auto pClDevice = pContext->getDevice(0);
surfaceFormat = Image::getSurfaceFormatFromTable(memFlags, imageFormat,
pClDevice->getHardwareInfo().capabilityTable.supportsOcl21Features);
surfaceFormat = Image::getSurfaceFormatFromTable(memFlags, imageFormat);
retVal = Image::validate(pContext, ClMemoryPropertiesHelper::createMemoryProperties(memFlags, 0, 0, &pClDevice->getDevice()),
surfaceFormat, imageDesc, nullptr);
}

View File

@@ -142,7 +142,6 @@ void ClDevice::initializeCaps() {
}
deviceInfo.latestConformanceVersionPassed = latestConformanceVersionPassed;
initializeOpenclCAllVersions();
deviceInfo.platformLP = (hwInfo.capabilityTable.supportsOcl21Features == false);
deviceInfo.spirVersions = spirVersions.c_str();
initializeILsWithVersion();

View File

@@ -395,11 +395,7 @@ cl_int Context::getSupportedImageFormats(
};
if (flags & CL_MEM_READ_ONLY) {
if (this->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features) {
appendImageFormats(SurfaceFormats::readOnly20());
} else {
appendImageFormats(SurfaceFormats::readOnly12());
}
appendImageFormats(SurfaceFormats::readOnly());
if (Image::isImage2d(imageType) && nv12ExtensionEnabled) {
appendImageFormats(SurfaceFormats::planarYuv());
}
@@ -415,11 +411,7 @@ cl_int Context::getSupportedImageFormats(
appendImageFormats(SurfaceFormats::readWriteDepth());
}
} else if (nv12ExtensionEnabled && (flags & CL_MEM_NO_ACCESS_INTEL)) {
if (this->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features) {
appendImageFormats(SurfaceFormats::readOnly20());
} else {
appendImageFormats(SurfaceFormats::readOnly12());
}
appendImageFormats(SurfaceFormats::readOnly());
if (Image::isImage2d(imageType)) {
appendImageFormats(SurfaceFormats::planarYuv());
}

View File

@@ -80,9 +80,8 @@ namespace NEO {
//Initialize this with the required formats first.
//Append the optional one later
const ClSurfaceFormatInfo SurfaceFormats::readOnlySurfaceFormats12[] = { COMMONFORMATS, READONLYFORMATS };
const ClSurfaceFormatInfo SurfaceFormats::readOnlySurfaceFormats20[] = { COMMONFORMATS, READONLYFORMATS, SRGBFORMATS };
const ClSurfaceFormatInfo SurfaceFormats::readOnlySurfaceFormats[] = { COMMONFORMATS, READONLYFORMATS, SRGBFORMATS };
const ClSurfaceFormatInfo SurfaceFormats::writeOnlySurfaceFormats[] = { COMMONFORMATS };
@@ -108,12 +107,8 @@ const ClSurfaceFormatInfo SurfaceFormats::readOnlyDepthSurfaceFormats[] = { DEPT
const ClSurfaceFormatInfo SurfaceFormats::readWriteDepthSurfaceFormats[] = { DEPTHFORMATS };
ArrayRef<const ClSurfaceFormatInfo> SurfaceFormats::readOnly12() noexcept {
return ArrayRef<const ClSurfaceFormatInfo>(readOnlySurfaceFormats12);
}
ArrayRef<const ClSurfaceFormatInfo> SurfaceFormats::readOnly20() noexcept {
return ArrayRef<const ClSurfaceFormatInfo>(readOnlySurfaceFormats20);
ArrayRef<const ClSurfaceFormatInfo> SurfaceFormats::readOnly() noexcept {
return ArrayRef<const ClSurfaceFormatInfo>(readOnlySurfaceFormats);
}
ArrayRef<const ClSurfaceFormatInfo> SurfaceFormats::writeOnly() noexcept {
@@ -145,14 +140,9 @@ ArrayRef<const ClSurfaceFormatInfo> SurfaceFormats::readWriteDepth() noexcept {
return ArrayRef<const ClSurfaceFormatInfo>(readWriteDepthSurfaceFormats);
}
ArrayRef<const ClSurfaceFormatInfo> SurfaceFormats::surfaceFormats(cl_mem_flags flags, bool supportsOcl20Features) noexcept {
ArrayRef<const ClSurfaceFormatInfo> SurfaceFormats::surfaceFormats(cl_mem_flags flags) noexcept {
if (flags & CL_MEM_READ_ONLY) {
if(supportsOcl20Features) {
return readOnly20();
}
else {
return readOnly12();
}
return readOnly();
}
else if (flags & CL_MEM_WRITE_ONLY) {
return writeOnly();
@@ -162,7 +152,7 @@ ArrayRef<const ClSurfaceFormatInfo> SurfaceFormats::surfaceFormats(cl_mem_flags
}
}
ArrayRef<const ClSurfaceFormatInfo> SurfaceFormats::surfaceFormats(cl_mem_flags flags, const cl_image_format *imageFormat, bool supportsOcl20Features) noexcept {
ArrayRef<const ClSurfaceFormatInfo> SurfaceFormats::surfaceFormats(cl_mem_flags flags, const cl_image_format *imageFormat) noexcept {
if (NEO::isNV12Image(imageFormat)) {
return planarYuv();
}
@@ -178,12 +168,7 @@ ArrayRef<const ClSurfaceFormatInfo> SurfaceFormats::surfaceFormats(cl_mem_flags
}
}
else if (flags & CL_MEM_READ_ONLY) {
if(supportsOcl20Features) {
return readOnly20();
}
else {
return readOnly12();
}
return readOnly();
}
else if (flags & CL_MEM_WRITE_ONLY) {
return writeOnly();

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2023 Intel Corporation
* Copyright (C) 2018-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -20,8 +20,7 @@ struct ClSurfaceFormatInfo {
class SurfaceFormats {
private:
static const ClSurfaceFormatInfo readOnlySurfaceFormats12[];
static const ClSurfaceFormatInfo readOnlySurfaceFormats20[];
static const ClSurfaceFormatInfo readOnlySurfaceFormats[];
static const ClSurfaceFormatInfo writeOnlySurfaceFormats[];
static const ClSurfaceFormatInfo readWriteSurfaceFormats[];
static const ClSurfaceFormatInfo readOnlyDepthSurfaceFormats[];
@@ -32,8 +31,7 @@ class SurfaceFormats {
static const ClSurfaceFormatInfo packedSurfaceFormats[];
public:
static ArrayRef<const ClSurfaceFormatInfo> readOnly12() noexcept;
static ArrayRef<const ClSurfaceFormatInfo> readOnly20() noexcept;
static ArrayRef<const ClSurfaceFormatInfo> readOnly() noexcept;
static ArrayRef<const ClSurfaceFormatInfo> writeOnly() noexcept;
static ArrayRef<const ClSurfaceFormatInfo> readWrite() noexcept;
static ArrayRef<const ClSurfaceFormatInfo> packedYuv() noexcept;
@@ -42,8 +40,8 @@ class SurfaceFormats {
static ArrayRef<const ClSurfaceFormatInfo> readOnlyDepth() noexcept;
static ArrayRef<const ClSurfaceFormatInfo> readWriteDepth() noexcept;
static ArrayRef<const ClSurfaceFormatInfo> surfaceFormats(cl_mem_flags flags, bool supportsOcl20Features) noexcept;
static ArrayRef<const ClSurfaceFormatInfo> surfaceFormats(cl_mem_flags flags, const cl_image_format *imageFormat, bool supportsOcl20Features) noexcept;
static ArrayRef<const ClSurfaceFormatInfo> surfaceFormats(cl_mem_flags flags) noexcept;
static ArrayRef<const ClSurfaceFormatInfo> surfaceFormats(cl_mem_flags flags, const cl_image_format *imageFormat) noexcept;
};
} // namespace NEO

View File

@@ -974,7 +974,7 @@ cl_int Image::writeNV12Planes(const void *hostPtr, size_t hostPtrRowPitch, uint3
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.supportsOcl21Features);
const ClSurfaceFormatInfo *surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
// Create NV12 UV Plane image
std::unique_ptr<Image> imageYPlane(Image::create(
@@ -999,7 +999,7 @@ cl_int Image::writeNV12Planes(const void *hostPtr, size_t hostPtrRowPitch, uint3
imageFormat.image_channel_order = CL_RG;
hostPtr = static_cast<const void *>(static_cast<const char *>(hostPtr) + (hostPtrRowPitch * this->imageDesc.image_height));
surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
// Create NV12 UV Plane image
std::unique_ptr<Image> imageUVPlane(Image::create(
context,
@@ -1016,13 +1016,13 @@ cl_int Image::writeNV12Planes(const void *hostPtr, size_t hostPtrRowPitch, uint3
return retVal;
}
const ClSurfaceFormatInfo *Image::getSurfaceFormatFromTable(cl_mem_flags flags, const cl_image_format *imageFormat, bool supportsOcl20Features) {
const ClSurfaceFormatInfo *Image::getSurfaceFormatFromTable(cl_mem_flags flags, const cl_image_format *imageFormat) {
if (!imageFormat) {
DEBUG_BREAK_IF("Invalid format");
return nullptr;
}
ArrayRef<const ClSurfaceFormatInfo> formats = SurfaceFormats::surfaceFormats(flags, imageFormat, supportsOcl20Features);
ArrayRef<const ClSurfaceFormatInfo> formats = SurfaceFormats::surfaceFormats(flags, imageFormat);
for (auto &format : formats) {
if (format.oclImageFormat.image_channel_data_type == imageFormat->image_channel_data_type &&
@@ -1324,7 +1324,7 @@ cl_mem Image::validateAndCreateImage(cl_context context,
return nullptr;
}
const auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, imageFormat, pContext->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
const auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, imageFormat);
errcodeRet = Image::validate(pContext, memoryProperties, surfaceFormat, imageDesc, hostPtr);
if (errcodeRet != CL_SUCCESS) {

View File

@@ -184,7 +184,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, bool supportsOcl20Features);
static const ClSurfaceFormatInfo *getSurfaceFormatFromTable(cl_mem_flags flags, const cl_image_format *imageFormat);
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, uint32_t rootDeviceIndex);

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2023 Intel Corporation
* Copyright (C) 2018-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -71,8 +71,8 @@ void D3DSharing<D3D>::updateImgInfoAndDesc(Gmm *gmm, ImageInfo &imgInfo, ImagePl
}
template <typename D3D>
const ClSurfaceFormatInfo *D3DSharing<D3D>::findSurfaceFormatInfo(int gmmFormat, cl_mem_flags flags, bool supportsOcl20Features, bool packedSupported) {
ArrayRef<const ClSurfaceFormatInfo> formats = SurfaceFormats::surfaceFormats(flags, supportsOcl20Features);
const ClSurfaceFormatInfo *D3DSharing<D3D>::findSurfaceFormatInfo(int gmmFormat, cl_mem_flags flags, bool packedSupported) {
ArrayRef<const ClSurfaceFormatInfo> formats = SurfaceFormats::surfaceFormats(flags);
for (auto &format : formats) {
if (gmmFormat == format.surfaceFormat.gmmSurfaceFormat) {
return &format;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2023 Intel Corporation
* Copyright (C) 2018-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -37,7 +37,7 @@ class D3DSharing : public SharingHandler {
unsigned int &getSubresource() { return subresource; }
D3DQuery *getQuery() { return d3dQuery; }
bool isSharedResource() { return sharedResource; }
static const ClSurfaceFormatInfo *findSurfaceFormatInfo(int gmmFormat, cl_mem_flags flags, bool supportsOcl20Features, bool packedSupported);
static const ClSurfaceFormatInfo *findSurfaceFormatInfo(int gmmFormat, cl_mem_flags flags, bool packedSupported);
static bool isFormatWithPlane1(DXGI_FORMAT format);
protected:

View File

@@ -73,7 +73,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.supportsOcl21Features);
auto *clSurfaceFormat = Image::getSurfaceFormatFromTable(flags, &imgFormat);
imgInfo.surfaceFormat = &clSurfaceFormat->surfaceFormat;
bool isSharedResource = false;

View File

@@ -107,7 +107,7 @@ Image *D3DTexture<D3D>::create2d(Context *context, D3DTexture2d *d3dTexture, cl_
clSurfaceFormat = findYuvSurfaceFormatInfo(textureDesc.Format, imagePlane, flags);
imgInfo.surfaceFormat = &clSurfaceFormat->surfaceFormat;
} else {
clSurfaceFormat = D3DSharing<D3D>::findSurfaceFormatInfo(alloc->getDefaultGmm()->gmmResourceInfo->getResourceFormat(), flags, hwInfo->capabilityTable.supportsOcl21Features, gfxCoreHelper.packedFormatsSupported());
clSurfaceFormat = D3DSharing<D3D>::findSurfaceFormatInfo(alloc->getDefaultGmm()->gmmResourceInfo->getResourceFormat(), flags, gfxCoreHelper.packedFormatsSupported());
imgInfo.surfaceFormat = &clSurfaceFormat->surfaceFormat;
}
@@ -191,7 +191,7 @@ Image *D3DTexture<D3D>::create3d(Context *context, D3DTexture3d *d3dTexture, cl_
auto hwInfo = rootDeviceEnvironment.getHardwareInfo();
auto &gfxCoreHelper = rootDeviceEnvironment.getHelper<GfxCoreHelper>();
auto d3dTextureObj = new D3DTexture<D3D>(context, d3dTexture, subresource, textureStaging, sharedResource);
auto *clSurfaceFormat = D3DSharing<D3D>::findSurfaceFormatInfo(alloc->getDefaultGmm()->gmmResourceInfo->getResourceFormat(), flags, hwInfo->capabilityTable.supportsOcl21Features, gfxCoreHelper.packedFormatsSupported());
auto *clSurfaceFormat = D3DSharing<D3D>::findSurfaceFormatInfo(alloc->getDefaultGmm()->gmmResourceInfo->getResourceFormat(), flags, gfxCoreHelper.packedFormatsSupported());
imgInfo.qPitch = alloc->getDefaultGmm()->queryQPitch(GMM_RESOURCE_TYPE::RESOURCE_3D);
imgInfo.surfaceFormat = &clSurfaceFormat->surfaceFormat;
@@ -223,7 +223,7 @@ const ClSurfaceFormatInfo *D3DTexture<D3D>::findYuvSurfaceFormatInfo(DXGI_FORMAT
imgFormat.image_channel_data_type = CL_UNORM_INT8;
}
return Image::getSurfaceFormatFromTable(flags, &imgFormat, false /* supportsOcl20Features */);
return Image::getSurfaceFormatFromTable(flags, &imgFormat);
}
template class NEO::D3DTexture<D3DTypesHelper::D3D10>;

View File

@@ -163,7 +163,7 @@ Image *GlTexture::createSharedGlTexture(Context *context, cl_mem_flags flags, cl
return nullptr;
}
auto surfaceFormatInfoAddress = Image::getSurfaceFormatFromTable(flags, &imgFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormatInfoAddress = Image::getSurfaceFormatFromTable(flags, &imgFormat);
if (!surfaceFormatInfoAddress) {
errorCode.set(CL_INVALID_GL_OBJECT);
return nullptr;

View File

@@ -115,7 +115,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.supportsOcl21Features);
auto surfaceFormatInfoAddress = Image::getSurfaceFormatFromTable(flags, &imgFormat);
if (!surfaceFormatInfoAddress) {
memoryManager->freeGraphicsMemory(alloc);
errorCode.set(CL_INVALID_GL_OBJECT);

View File

@@ -23,7 +23,7 @@ namespace NEO {
Image *UnifiedImage::createSharedUnifiedImage(Context *context, cl_mem_flags flags, UnifiedSharingMemoryDescription description,
const cl_image_format *imageFormat, const cl_image_desc *imageDesc, cl_int *errcodeRet) {
auto *clSurfaceFormat = Image::getSurfaceFormatFromTable(flags, imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto *clSurfaceFormat = Image::getSurfaceFormatFromTable(flags, imageFormat);
ImageInfo imgInfo = {};
imgInfo.imgDesc = Image::convertDescriptor(*imageDesc);
imgInfo.surfaceFormat = &clSurfaceFormat->surfaceFormat;

View File

@@ -108,7 +108,7 @@ VAStatus VASurface::getSurfaceDescription(SharedSurfaceInfo &surfaceInfo, VAShar
return vaStatus;
}
void VASurface::applyPlanarOptions(SharedSurfaceInfo &sharedSurfaceInfo, cl_uint plane, cl_mem_flags flags, bool supportOcl21) {
void VASurface::applyPlanarOptions(SharedSurfaceInfo &sharedSurfaceInfo, cl_uint plane, cl_mem_flags flags) {
bool isRGBPFormat = debugManager.flags.EnableExtendedVaFormats.get() && sharedSurfaceInfo.imageFourcc == VA_FOURCC_RGBP;
if (plane == 0) {
@@ -125,7 +125,7 @@ void VASurface::applyPlanarOptions(SharedSurfaceInfo &sharedSurfaceInfo, cl_uint
UNRECOVERABLE_IF(true);
}
auto gmmSurfaceFormat = Image::getSurfaceFormatFromTable(flags, &sharedSurfaceInfo.gmmImgFormat, supportOcl21); // vaImage.format.fourcc == VA_FOURCC_NV12
auto gmmSurfaceFormat = Image::getSurfaceFormatFromTable(flags, &sharedSurfaceInfo.gmmImgFormat); // vaImage.format.fourcc == VA_FOURCC_NV12
if (debugManager.flags.EnableExtendedVaFormats.get() && sharedSurfaceInfo.imageFourcc == VA_FOURCC_RGBP) {
sharedSurfaceInfo.channelType = CL_UNORM_INT8;
@@ -192,10 +192,8 @@ Image *VASurface::createSharedVaSurface(Context *context, VASharingFunctions *sh
sharedSurfaceInfo.imgInfo.imgDesc.imageType = ImageType::image2D;
bool supportOcl21 = context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features;
if (VASurface::isSupportedPlanarFormat(sharedSurfaceInfo.imageFourcc)) {
applyPlanarOptions(sharedSurfaceInfo, plane, flags, supportOcl21);
applyPlanarOptions(sharedSurfaceInfo, plane, flags);
} else if (VASurface::isSupportedPackedFormat(sharedSurfaceInfo.imageFourcc)) {
applyPackedOptions(sharedSurfaceInfo);
} else {
@@ -224,7 +222,7 @@ Image *VASurface::createSharedVaSurface(Context *context, VASharingFunctions *sh
lock.unlock();
cl_image_format imgFormat = {sharedSurfaceInfo.channelOrder, sharedSurfaceInfo.channelType};
auto imgSurfaceFormat = Image::getSurfaceFormatFromTable(flags, &imgFormat, supportOcl21);
auto imgSurfaceFormat = Image::getSurfaceFormatFromTable(flags, &imgFormat);
sharedSurfaceInfo.imgInfo.surfaceFormat = &imgSurfaceFormat->surfaceFormat;
sharedSurfaceInfo.imgInfo.imgDesc.imageRowPitch = sharedSurfaceInfo.imgInfo.rowPitch;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2022 Intel Corporation
* Copyright (C) 2018-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -45,7 +45,7 @@ class VASurface : VASharing {
static bool isSupportedPlanarFormat(uint32_t imageFourcc);
static bool isSupportedPackedFormat(uint32_t imageFourcc);
static VAStatus getSurfaceDescription(SharedSurfaceInfo &surfaceInfo, VASharingFunctions *sharingFunctions, VASurfaceID *surface);
static void applyPlanarOptions(SharedSurfaceInfo &sharedSurfaceInfo, cl_uint plane, cl_mem_flags flags, bool supportOcl21);
static void applyPlanarOptions(SharedSurfaceInfo &sharedSurfaceInfo, cl_uint plane, cl_mem_flags flags);
static void applyPackedOptions(SharedSurfaceInfo &sharedSurfaceInfo);
static void applyPlaneSettings(SharedSurfaceInfo &sharedSurfaceInfo, cl_uint plane);

View File

@@ -1205,15 +1205,10 @@ TEST_F(ClCreateImageFromImageTest, GivenImage2dWhenCreatingImage2dFromImageWithT
nullptr,
&retVal);
if (pContext->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features == false) {
EXPECT_EQ(CL_IMAGE_FORMAT_NOT_SUPPORTED, retVal);
EXPECT_EQ(nullptr, imageFromImageObject);
} else {
EXPECT_EQ(CL_SUCCESS, retVal);
EXPECT_NE(nullptr, imageFromImageObject);
retVal = clReleaseMemObject(imageFromImageObject);
EXPECT_EQ(CL_SUCCESS, retVal);
}
EXPECT_EQ(CL_SUCCESS, retVal);
EXPECT_NE(nullptr, imageFromImageObject);
retVal = clReleaseMemObject(imageFromImageObject);
EXPECT_EQ(CL_SUCCESS, retVal);
retVal = clReleaseMemObject(image);
EXPECT_EQ(CL_SUCCESS, retVal);
@@ -1263,11 +1258,7 @@ TEST_F(ClCreateImageFromImageTest, GivenImage2dWhenCreatingImage2dFromImageWithD
nullptr,
&retVal);
if (pContext->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features) {
EXPECT_EQ(CL_INVALID_IMAGE_FORMAT_DESCRIPTOR, retVal);
} else {
EXPECT_EQ(CL_IMAGE_FORMAT_NOT_SUPPORTED, retVal);
}
EXPECT_EQ(CL_INVALID_IMAGE_FORMAT_DESCRIPTOR, retVal);
EXPECT_EQ(nullptr, imageFromImageObject);
retVal = clReleaseMemObject(image);

View File

@@ -109,7 +109,7 @@ struct MultitileMulticontextTests : public MulticontextOclAubFixture, public ::t
imageFormat.image_channel_order = CL_RGBA;
cl_mem_flags flags = 0;
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
cl_image_desc imageDesc;
imageDesc.image_type = CL_MEM_OBJECT_IMAGE2D;

View File

@@ -227,7 +227,7 @@ void CompressionXeHPAndLater<testLocalMemory>::givenCompressedImageWhenReadingTh
csr->getInternalAllocationStorage()->storeAllocation(std::unique_ptr<GraphicsAllocation>(allocation), TEMPORARY_ALLOCATION);
cl_mem_flags flags = CL_MEM_USE_HOST_PTR;
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
auto retVal = CL_INVALID_VALUE;
std::unique_ptr<Image> srcImage(Image::create(
context,

View File

@@ -65,7 +65,7 @@ struct AUBCopyImage
imageDesc.num_samples = 0;
imageDesc.mem_object = NULL;
// clang-format on
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, pClDevice->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
auto retVal = CL_INVALID_VALUE;
srcImage.reset(Image::create(
context,

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2024 Intel Corporation
* Copyright (C) 2018-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -93,10 +93,6 @@ struct AubFillImage
}
CommandStreamFixture::setUp();
if ((device->getHardwareInfo().capabilityTable.supportsOcl21Features == false) && (channelOrder == CL_sRGBA || channelOrder == CL_sBGRA)) {
GTEST_SKIP();
}
}
void TearDown() override {
@@ -173,7 +169,7 @@ HWTEST_P(AubFillImage, WhenFillingThenExpectationsMet) {
auto retVal = CL_INVALID_VALUE;
cl_mem_flags flags = CL_MEM_READ_ONLY;
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
image.reset(Image::create(
context,
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),

View File

@@ -1081,7 +1081,7 @@ HWTEST2_F(AUBBindlessKernel, DISABLED_givenBindlessCopyImageKernelWhenEnqueuedTh
auto retVal = CL_INVALID_VALUE;
cl_mem_flags flags = CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR;
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, device->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
auto image = std::unique_ptr<Image>(Image::create(
contextCl,
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &contextCl->getDevice(0)->getDevice()),

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2024 Intel Corporation
* Copyright (C) 2018-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -117,7 +117,7 @@ HWTEST_P(AUBMapImage, WhenMappingAndUnmappingThenExpectationsAreMet) {
auto retVal = CL_INVALID_VALUE;
cl_mem_flags flags = CL_MEM_COPY_HOST_PTR;
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, pClDevice->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
srcImage.reset(Image::create(
context,
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),

View File

@@ -114,7 +114,7 @@ struct AUBReadImage
memset(dstMemoryUnaligned, 0xFF, numPixels * elementSize);
cl_mem_flags flags = CL_MEM_USE_HOST_PTR;
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
auto retVal = CL_INVALID_VALUE;
srcImage.reset(Image::create(
context,
@@ -237,7 +237,7 @@ struct AUBReadImage
}
cl_mem_flags flags = CL_MEM_USE_HOST_PTR | CL_MEM_READ_WRITE;
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, pClDevice->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
auto retVal = CL_INVALID_VALUE;
auto image = std::unique_ptr<Image>(Image::create(
context,

View File

@@ -69,7 +69,7 @@ HWTEST_P(VerifyMemoryImageHw, givenDifferentImagesWhenValidatingMemoryThenSucces
cl_mem_flags flags = CL_MEM_READ_ONLY;
auto surfaceFormat = Image::
getSurfaceFormatFromTable(flags, &imageFormat, pClDevice->getHardwareInfo().capabilityTable.supportsOcl21Features);
getSurfaceFormatFromTable(flags, &imageFormat);
auto retVal = CL_INVALID_VALUE;
std::unique_ptr<Image> image(Image::create(
context,

View File

@@ -109,7 +109,7 @@ struct AUBWriteImage
auto retVal = CL_INVALID_VALUE;
cl_mem_flags flags = 0;
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
dstImage.reset(Image::create(
context,
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
@@ -231,7 +231,7 @@ struct AUBWriteImage
auto srcMemoryUnaligned = ptrOffset(reinterpret_cast<uint8_t *>(srcMemoryAligned), 4); // ensure non cacheline-aligned (but aligned to 4) hostPtr to create non-zerocopy image
cl_mem_flags flags = CL_MEM_USE_HOST_PTR | CL_MEM_READ_WRITE;
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, pClDevice->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
auto retVal = CL_INVALID_VALUE;
auto image = std::unique_ptr<Image>(Image::create(
context,

View File

@@ -81,7 +81,7 @@ HWTEST_F(AUBCreateImageArray, Given1DImageArrayThenExpectationsMet) {
imageDesc.image_type = CL_MEM_OBJECT_IMAGE1D_ARRAY;
imageDesc.image_height = 1;
cl_mem_flags flags = CL_MEM_COPY_HOST_PTR;
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
auto imageDescriptor = Image::convertDescriptor(imageDesc);
auto imgInfo = MockGmm::initImgInfo(imageDescriptor, 0, &surfaceFormat->surfaceFormat);
imgInfo.linearStorage = productHelper.isLinearStoragePreferred(Image::isImage1d(imageDesc), false);
@@ -161,7 +161,7 @@ HWTEST_F(AUBCreateImageArray, Given2DImageArrayThenExpectationsMet) {
imageDesc.image_type = CL_MEM_OBJECT_IMAGE2D_ARRAY;
cl_mem_flags flags = CL_MEM_COPY_HOST_PTR;
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
auto imageDescriptor = Image::convertDescriptor(imageDesc);
auto imgInfo = MockGmm::initImgInfo(imageDescriptor, 0, &surfaceFormat->surfaceFormat);
imgInfo.linearStorage = productHelper.isLinearStoragePreferred(Image::isImage1d(imageDesc), false);
@@ -284,7 +284,7 @@ INSTANTIATE_TEST_SUITE_P(
testing::ValuesIn(copyHostPtrFlags));
HWTEST_P(CopyHostPtrTest, GivenImageWithDoubledRowPitchWhenCreatedWithCopyHostPtrFlagThenHasProperRowPitchSet) {
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
auto imageDescriptor = Image::convertDescriptor(imageDesc);
auto imgInfo = MockGmm::initImgInfo(imageDescriptor, 0, &surfaceFormat->surfaceFormat);
imgInfo.useLocalMemory = device->getMemoryManager()->isLocalMemorySupported(device->getRootDeviceIndex());
@@ -356,7 +356,7 @@ HWTEST_P(CopyHostPtrTest, GivenImageWithDoubledRowPitchWhenCreatedWithCopyHostPt
HWTEST_P(UseHostPtrTest, GivenImageWithRowPitchWhenCreatedWithUseHostPtrFlagThenExpectationsMet) {
imageDesc.image_width = 546;
imageDesc.image_height = 1;
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
auto imageDescriptor = Image::convertDescriptor(imageDesc);
auto imgInfo = MockGmm::initImgInfo(imageDescriptor, 0, &surfaceFormat->surfaceFormat);
MockGmm::queryImgParams(pDevice->getGmmHelper(), imgInfo, false);
@@ -474,7 +474,7 @@ HWTEST_F(AUBCreateImage, GivenImage3DCreatedWithDoubledSlicePitchWhenQueriedForD
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.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
image.reset(Image::create(context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
flags, 0, surfaceFormat, &imageDesc, hostPtr, retVal));

View File

@@ -966,7 +966,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.supportsOcl21Features);
const ClSurfaceFormatInfo *surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
auto allocation = context->getMemoryManager()->allocateGraphicsMemoryWithProperties(MockAllocationProperties{context->getDevice(0)->getRootDeviceIndex(), imgSize});
ASSERT_NE(allocation, nullptr);

View File

@@ -253,8 +253,7 @@ HWTEST_F(EnqueueThreadingImage, WhenEnqueuingCopyBufferToImageThenKernelHasOwner
imageDesc.image_width = 1024u;
cl_mem_flags flags = CL_MEM_WRITE_ONLY;
auto surfaceFormat = Image::getSurfaceFormatFromTable(
flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
std::unique_ptr<Image> dstImage(
Image::create(context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
@@ -280,8 +279,7 @@ HWTEST_F(EnqueueThreadingImage, WhenEnqueuingCopyImageThenKernelHasOwnership) {
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.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
std::unique_ptr<Image> srcImage(
Image::create(context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
@@ -313,8 +311,7 @@ HWTEST_F(EnqueueThreadingImage, WhenEnqueuingCopyImageToBufferThenKernelHasOwner
imageDesc.image_width = 1024u;
cl_mem_flags flags = CL_MEM_WRITE_ONLY;
auto surfaceFormat = Image::getSurfaceFormatFromTable(
flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
std::unique_ptr<Image> srcImage(
Image::create(context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
@@ -355,8 +352,7 @@ HWTEST_F(EnqueueThreadingImage, WhenEnqueuingFillImageThenKernelHasOwnership) {
imageDesc.image_width = 1024u;
cl_mem_flags flags = CL_MEM_WRITE_ONLY;
auto surfaceFormat = Image::getSurfaceFormatFromTable(
flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
std::unique_ptr<Image> image(
Image::create(context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
@@ -408,8 +404,7 @@ HWTEST_F(EnqueueThreadingImage, WhenEnqueuingReadImageThenKernelHasOwnership) {
imageDesc.image_width = 1024u;
cl_mem_flags flags = CL_MEM_WRITE_ONLY;
auto surfaceFormat = Image::getSurfaceFormatFromTable(
flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
std::unique_ptr<Image> image(Image::create(
context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
@@ -461,8 +456,7 @@ HWTEST_F(EnqueueThreadingImage, WhenEnqueuingWriteImageThenKernelHasOwnership) {
imageDesc.image_width = 1024u;
cl_mem_flags flags = CL_MEM_READ_ONLY;
auto surfaceFormat = Image::getSurfaceFormatFromTable(
flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
std::unique_ptr<Image> image(
Image::create(context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2023 Intel Corporation
* Copyright (C) 2018-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -114,7 +114,7 @@ struct MultipleMapImageTest : public ClDeviceFixture, public ::testing::Test {
VariableBackup<ImageCreateFunc> backup(&imageFactory[eRenderCoreFamily].createImageFunction);
imageFactory[eRenderCoreFamily].createImageFunction = MockImage<FamilyType>::createMockImage;
auto surfaceFormat = Image::getSurfaceFormatFromTable(Traits::flags, &Traits::imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(Traits::flags, &Traits::imageFormat);
cl_int retVal = CL_SUCCESS;
auto img = Image::create(

View File

@@ -796,7 +796,7 @@ HWTEST_F(PerformanceHintTest, givenCompressedImageWhenItsCreatedThenProperPerfor
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.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
auto image = std::unique_ptr<Image>(Image::create(
context.get(),
@@ -862,7 +862,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.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
auto image = std::unique_ptr<Image>(Image::create(
context.get(),

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2024 Intel Corporation
* Copyright (C) 2018-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -148,7 +148,7 @@ TEST_P(GetSupportedImageFormatsTest, WhenRetrievingImageFormatsSRGBThenListIsNon
}
}
if (isReadOnly && ((&castToObject<ClDevice>(devices[0])->getDevice())->getHardwareInfo().capabilityTable.supportsOcl21Features)) {
if (isReadOnly) {
EXPECT_TRUE(sRGBAFormatFound & sBGRAFormatFound);
} else {
EXPECT_FALSE(sRGBAFormatFound | sBGRAFormatFound);
@@ -158,7 +158,7 @@ TEST_P(GetSupportedImageFormatsTest, WhenRetrievingImageFormatsSRGBThenListIsNon
}
TEST(ImageFormats, WhenCheckingIsDepthFormatThenCorrectValueReturned) {
for (auto &format : SurfaceFormats::readOnly20()) {
for (auto &format : SurfaceFormats::readOnly()) {
EXPECT_FALSE(Image::isDepthFormat(format.oclImageFormat));
}
@@ -288,8 +288,7 @@ TEST_P(NV12ExtensionSupportedImageFormatsTest, givenNV12ExtensionWhenQueriedForI
nullptr,
&numImageFormats);
auto supportsOcl20Features = device->getHardwareInfo().capabilityTable.supportsOcl21Features;
size_t expectedNumReadOnlyFormats = (supportsOcl20Features) ? SurfaceFormats::readOnly20().size() : SurfaceFormats::readOnly12().size();
size_t expectedNumReadOnlyFormats = SurfaceFormats::readOnly().size();
if (Image::isImage2dOr2dArray(imageFormats) && imageFormatsFlags == CL_MEM_READ_ONLY) {
expectedNumReadOnlyFormats += SurfaceFormats::readOnlyDepth().size();

View File

@@ -712,7 +712,7 @@ TYPED_TEST_P(D3DTests, givenInvalidSubresourceWhenCreateTexture3dIsCalledThenFai
TYPED_TEST_P(D3DTests, givenPackedFormatWhenLookingForSurfaceFormatWithPackedNotSupportedThenReturnNull) {
EXPECT_GT(SurfaceFormats::packed().size(), 0u);
for (auto &format : SurfaceFormats::packed()) {
auto surfaceFormat = D3DSharing<TypeParam>::findSurfaceFormatInfo(format.surfaceFormat.gmmSurfaceFormat, CL_MEM_READ_ONLY, false /* supportsOcl20Features */, false /* packedSupported */);
auto surfaceFormat = D3DSharing<TypeParam>::findSurfaceFormatInfo(format.surfaceFormat.gmmSurfaceFormat, CL_MEM_READ_ONLY, false /* packedSupported */);
ASSERT_EQ(nullptr, surfaceFormat);
}
}
@@ -721,7 +721,7 @@ TYPED_TEST_P(D3DTests, givenPackedFormatWhenLookingForSurfaceFormatWithPackedSup
EXPECT_GT(SurfaceFormats::packed().size(), 0u);
uint32_t counter = 0;
for (auto &format : SurfaceFormats::packed()) {
auto surfaceFormat = D3DSharing<TypeParam>::findSurfaceFormatInfo(format.surfaceFormat.gmmSurfaceFormat, CL_MEM_READ_ONLY, false /* supportsOcl20Features */, true /* packedSupported */);
auto surfaceFormat = D3DSharing<TypeParam>::findSurfaceFormatInfo(format.surfaceFormat.gmmSurfaceFormat, CL_MEM_READ_ONLY, true /* packedSupported */);
ASSERT_NE(nullptr, surfaceFormat);
counter++;
EXPECT_EQ(&format, surfaceFormat);
@@ -730,14 +730,14 @@ TYPED_TEST_P(D3DTests, givenPackedFormatWhenLookingForSurfaceFormatWithPackedSup
}
TYPED_TEST_P(D3DTests, givenReadonlyFormatWhenLookingForSurfaceFormatThenReturnValidFormat) {
EXPECT_GT(SurfaceFormats::readOnly12().size(), 0u);
for (auto &format : SurfaceFormats::readOnly12()) {
EXPECT_GT(SurfaceFormats::readOnly().size(), 0u);
for (auto &format : SurfaceFormats::readOnly()) {
// only RGBA, BGRA, RG, R allowed for D3D
if (format.oclImageFormat.image_channel_order == CL_RGBA ||
format.oclImageFormat.image_channel_order == CL_BGRA ||
format.oclImageFormat.image_channel_order == CL_RG ||
format.oclImageFormat.image_channel_order == CL_R) {
auto surfaceFormat = D3DSharing<TypeParam>::findSurfaceFormatInfo(format.surfaceFormat.gmmSurfaceFormat, CL_MEM_READ_ONLY, false /* supportsOcl20Features */, true);
auto surfaceFormat = D3DSharing<TypeParam>::findSurfaceFormatInfo(format.surfaceFormat.gmmSurfaceFormat, CL_MEM_READ_ONLY, true);
ASSERT_NE(nullptr, surfaceFormat);
EXPECT_EQ(&format, surfaceFormat);
}
@@ -752,7 +752,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<TypeParam>::findSurfaceFormatInfo(format.surfaceFormat.gmmSurfaceFormat, CL_MEM_WRITE_ONLY, this->context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features, true);
auto surfaceFormat = D3DSharing<TypeParam>::findSurfaceFormatInfo(format.surfaceFormat.gmmSurfaceFormat, CL_MEM_WRITE_ONLY, true);
ASSERT_NE(nullptr, surfaceFormat);
EXPECT_EQ(&format, surfaceFormat);
}
@@ -767,7 +767,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<TypeParam>::findSurfaceFormatInfo(format.surfaceFormat.gmmSurfaceFormat, CL_MEM_READ_WRITE, this->context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features, true);
auto surfaceFormat = D3DSharing<TypeParam>::findSurfaceFormatInfo(format.surfaceFormat.gmmSurfaceFormat, CL_MEM_READ_WRITE, true);
ASSERT_NE(nullptr, surfaceFormat);
EXPECT_EQ(&format, surfaceFormat);
}

View File

@@ -86,32 +86,28 @@ struct DeviceGetCapsTest : public ::testing::Test {
EXPECT_STREQ("__opencl_c_images", (++openclCFeatureIterator)->name);
EXPECT_STREQ("__opencl_c_read_write_images", (++openclCFeatureIterator)->name);
}
if (hwInfo.capabilityTable.supportsOcl21Features) {
EXPECT_STREQ("__opencl_c_atomic_order_acq_rel", (++openclCFeatureIterator)->name);
EXPECT_STREQ("__opencl_c_atomic_order_seq_cst", (++openclCFeatureIterator)->name);
EXPECT_STREQ("__opencl_c_atomic_scope_all_devices", (++openclCFeatureIterator)->name);
EXPECT_STREQ("__opencl_c_atomic_scope_device", (++openclCFeatureIterator)->name);
EXPECT_STREQ("__opencl_c_generic_address_space", (++openclCFeatureIterator)->name);
EXPECT_STREQ("__opencl_c_program_scope_global_variables", (++openclCFeatureIterator)->name);
EXPECT_STREQ("__opencl_c_work_group_collective_functions", (++openclCFeatureIterator)->name);
EXPECT_STREQ("__opencl_c_subgroups", (++openclCFeatureIterator)->name);
EXPECT_STREQ("__opencl_c_ext_fp32_global_atomic_add", (++openclCFeatureIterator)->name);
EXPECT_STREQ("__opencl_c_ext_fp32_local_atomic_add", (++openclCFeatureIterator)->name);
EXPECT_STREQ("__opencl_c_ext_fp32_global_atomic_min_max", (++openclCFeatureIterator)->name);
EXPECT_STREQ("__opencl_c_ext_fp32_local_atomic_min_max", (++openclCFeatureIterator)->name);
EXPECT_STREQ("__opencl_c_ext_fp16_global_atomic_load_store", (++openclCFeatureIterator)->name);
EXPECT_STREQ("__opencl_c_ext_fp16_local_atomic_load_store", (++openclCFeatureIterator)->name);
EXPECT_STREQ("__opencl_c_ext_fp16_global_atomic_min_max", (++openclCFeatureIterator)->name);
EXPECT_STREQ("__opencl_c_ext_fp16_local_atomic_min_max", (++openclCFeatureIterator)->name);
}
EXPECT_STREQ("__opencl_c_atomic_order_acq_rel", (++openclCFeatureIterator)->name);
EXPECT_STREQ("__opencl_c_atomic_order_seq_cst", (++openclCFeatureIterator)->name);
EXPECT_STREQ("__opencl_c_atomic_scope_all_devices", (++openclCFeatureIterator)->name);
EXPECT_STREQ("__opencl_c_atomic_scope_device", (++openclCFeatureIterator)->name);
EXPECT_STREQ("__opencl_c_generic_address_space", (++openclCFeatureIterator)->name);
EXPECT_STREQ("__opencl_c_program_scope_global_variables", (++openclCFeatureIterator)->name);
EXPECT_STREQ("__opencl_c_work_group_collective_functions", (++openclCFeatureIterator)->name);
EXPECT_STREQ("__opencl_c_subgroups", (++openclCFeatureIterator)->name);
EXPECT_STREQ("__opencl_c_ext_fp32_global_atomic_add", (++openclCFeatureIterator)->name);
EXPECT_STREQ("__opencl_c_ext_fp32_local_atomic_add", (++openclCFeatureIterator)->name);
EXPECT_STREQ("__opencl_c_ext_fp32_global_atomic_min_max", (++openclCFeatureIterator)->name);
EXPECT_STREQ("__opencl_c_ext_fp32_local_atomic_min_max", (++openclCFeatureIterator)->name);
EXPECT_STREQ("__opencl_c_ext_fp16_global_atomic_load_store", (++openclCFeatureIterator)->name);
EXPECT_STREQ("__opencl_c_ext_fp16_local_atomic_load_store", (++openclCFeatureIterator)->name);
EXPECT_STREQ("__opencl_c_ext_fp16_global_atomic_min_max", (++openclCFeatureIterator)->name);
EXPECT_STREQ("__opencl_c_ext_fp16_local_atomic_min_max", (++openclCFeatureIterator)->name);
if (hwInfo.capabilityTable.ftrSupportsFP64) {
EXPECT_STREQ("__opencl_c_fp64", (++openclCFeatureIterator)->name);
if (hwInfo.capabilityTable.supportsOcl21Features) {
EXPECT_STREQ("__opencl_c_ext_fp64_global_atomic_add", (++openclCFeatureIterator)->name);
EXPECT_STREQ("__opencl_c_ext_fp64_local_atomic_add", (++openclCFeatureIterator)->name);
EXPECT_STREQ("__opencl_c_ext_fp64_global_atomic_min_max", (++openclCFeatureIterator)->name);
EXPECT_STREQ("__opencl_c_ext_fp64_local_atomic_min_max", (++openclCFeatureIterator)->name);
}
EXPECT_STREQ("__opencl_c_ext_fp64_global_atomic_add", (++openclCFeatureIterator)->name);
EXPECT_STREQ("__opencl_c_ext_fp64_local_atomic_add", (++openclCFeatureIterator)->name);
EXPECT_STREQ("__opencl_c_ext_fp64_global_atomic_min_max", (++openclCFeatureIterator)->name);
EXPECT_STREQ("__opencl_c_ext_fp64_local_atomic_min_max", (++openclCFeatureIterator)->name);
}
if (clDevice.getDevice().getCompilerProductHelper().isDotIntegerProductExtensionSupported()) {
EXPECT_STREQ("__opencl_c_integer_dot_product_input_4x8bit", (++openclCFeatureIterator)->name);
@@ -266,9 +262,6 @@ TEST_F(DeviceGetCapsTest, WhenCreatingDeviceThenCapsArePopulatedCorrectly) {
EXPECT_EQ(16384u, sharedCaps.image2DMaxWidth);
EXPECT_EQ(16384u, sharedCaps.image2DMaxHeight);
EXPECT_EQ(2048u, sharedCaps.imageMaxArraySize);
if (device->getHardwareInfo().capabilityTable.supportsOcl21Features == false && is64bit) {
EXPECT_TRUE(sharedCaps.force32BitAddresses);
}
}
HWTEST_F(DeviceGetCapsTest, givenDeviceWhenAskingForSubGroupSizesThenReturnCorrectValues) {
@@ -974,17 +967,12 @@ TEST_F(DeviceGetCapsTest, givenFp64SupportForcedWhenCheckingFp64SupportThenFp64I
bool expectedFp64Support = ((overrideDefaultFP64Settings == -1) ? isFp64SupportedByHw : overrideDefaultFP64Settings);
if (expectedFp64Support) {
const size_t expectedFp64FeaturesCount = hwInfo.capabilityTable.supportsOcl21Features ? 5u : 1u;
const size_t expectedFp64FeaturesCount = 5u;
EXPECT_NE(std::string::npos, extensionString.find(std::string("cl_khr_fp64")));
EXPECT_NE(0u, caps.doubleFpConfig);
if (hwInfo.capabilityTable.supportsOcl21Features) {
const cl_device_fp_atomic_capabilities_ext expectedFpCaps = static_cast<cl_device_fp_atomic_capabilities_ext>(CL_DEVICE_GLOBAL_FP_ATOMIC_LOAD_STORE_EXT | CL_DEVICE_GLOBAL_FP_ATOMIC_ADD_EXT | CL_DEVICE_GLOBAL_FP_ATOMIC_MIN_MAX_EXT |
CL_DEVICE_LOCAL_FP_ATOMIC_LOAD_STORE_EXT | CL_DEVICE_LOCAL_FP_ATOMIC_ADD_EXT | CL_DEVICE_LOCAL_FP_ATOMIC_MIN_MAX_EXT);
EXPECT_EQ(expectedFpCaps, caps.doubleFpAtomicCapabilities);
} else {
const cl_device_fp_atomic_capabilities_ext expectedFpCaps = static_cast<cl_device_fp_atomic_capabilities_ext>(CL_DEVICE_GLOBAL_FP_ATOMIC_LOAD_STORE_EXT | CL_DEVICE_LOCAL_FP_ATOMIC_LOAD_STORE_EXT);
EXPECT_EQ(expectedFpCaps, caps.doubleFpAtomicCapabilities);
}
const cl_device_fp_atomic_capabilities_ext expectedFpCaps = static_cast<cl_device_fp_atomic_capabilities_ext>(CL_DEVICE_GLOBAL_FP_ATOMIC_LOAD_STORE_EXT | CL_DEVICE_GLOBAL_FP_ATOMIC_ADD_EXT | CL_DEVICE_GLOBAL_FP_ATOMIC_MIN_MAX_EXT |
CL_DEVICE_LOCAL_FP_ATOMIC_LOAD_STORE_EXT | CL_DEVICE_LOCAL_FP_ATOMIC_ADD_EXT | CL_DEVICE_LOCAL_FP_ATOMIC_MIN_MAX_EXT);
EXPECT_EQ(expectedFpCaps, caps.doubleFpAtomicCapabilities);
EXPECT_EQ(expectedFp64FeaturesCount, fp64FeaturesCount);
EXPECT_NE(0u, caps.nativeVectorWidthDouble);
EXPECT_NE(0u, caps.preferredVectorWidthDouble);

View File

@@ -501,11 +501,7 @@ TEST(GetDeviceInfo, GivenMaxGlobalVariableSizeWhenGettingDeviceInfoThenCorrectVa
auto retVal = device->getDeviceInfo(CL_DEVICE_MAX_GLOBAL_VARIABLE_SIZE, sizeof(size_t), &value, &size);
EXPECT_EQ(CL_SUCCESS, retVal);
EXPECT_EQ(sizeof(size_t), size);
if (device->areOcl21FeaturesEnabled()) {
EXPECT_EQ(value, 65536u);
} else {
EXPECT_EQ(value, 0u);
}
EXPECT_EQ(value, 65536u);
}
TEST(GetDeviceInfo, GivenGlobalVariablePreferredTotalSizeWhenGettingDeviceInfoThenCorrectValueIsReturned) {
@@ -517,11 +513,7 @@ TEST(GetDeviceInfo, GivenGlobalVariablePreferredTotalSizeWhenGettingDeviceInfoTh
auto retVal = device->getDeviceInfo(CL_DEVICE_GLOBAL_VARIABLE_PREFERRED_TOTAL_SIZE, sizeof(size_t), &value, &size);
EXPECT_EQ(CL_SUCCESS, retVal);
EXPECT_EQ(sizeof(size_t), size);
if (device->areOcl21FeaturesEnabled()) {
EXPECT_EQ(value, static_cast<size_t>(device->getSharedDeviceInfo().maxMemAllocSize));
} else {
EXPECT_EQ(value, 0u);
}
EXPECT_EQ(value, static_cast<size_t>(device->getSharedDeviceInfo().maxMemAllocSize));
}
TEST(GetDeviceInfo, GivenPreferredInteropsWhenGettingDeviceInfoThenCorrectValueIsReturned) {
@@ -566,11 +558,8 @@ TEST(GetDeviceInfo, WhenQueryingAtomicMemoryCapabilitiesThenProperValueIsReturne
EXPECT_EQ(CL_SUCCESS, retVal);
EXPECT_EQ(sizeof(cl_device_atomic_capabilities), paramRetSize);
cl_device_atomic_capabilities expectedCapabilities = CL_DEVICE_ATOMIC_ORDER_RELAXED | CL_DEVICE_ATOMIC_SCOPE_WORK_GROUP;
if (device->areOcl21FeaturesSupported()) {
expectedCapabilities |= CL_DEVICE_ATOMIC_ORDER_ACQ_REL | CL_DEVICE_ATOMIC_ORDER_SEQ_CST |
CL_DEVICE_ATOMIC_SCOPE_ALL_DEVICES | CL_DEVICE_ATOMIC_SCOPE_DEVICE;
}
cl_device_atomic_capabilities expectedCapabilities = CL_DEVICE_ATOMIC_ORDER_RELAXED | CL_DEVICE_ATOMIC_SCOPE_WORK_GROUP | CL_DEVICE_ATOMIC_ORDER_ACQ_REL | CL_DEVICE_ATOMIC_ORDER_SEQ_CST |
CL_DEVICE_ATOMIC_SCOPE_ALL_DEVICES | CL_DEVICE_ATOMIC_SCOPE_DEVICE;
EXPECT_EQ(expectedCapabilities, atomicMemoryCapabilities);
}
@@ -585,11 +574,8 @@ TEST(GetDeviceInfo, WhenQueryingAtomicFenceCapabilitiesThenProperValueIsReturned
EXPECT_EQ(sizeof(cl_device_atomic_capabilities), paramRetSize);
cl_device_atomic_capabilities expectedCapabilities = CL_DEVICE_ATOMIC_ORDER_RELAXED | CL_DEVICE_ATOMIC_ORDER_ACQ_REL |
CL_DEVICE_ATOMIC_SCOPE_WORK_GROUP;
if (device->areOcl21FeaturesSupported()) {
expectedCapabilities |= CL_DEVICE_ATOMIC_ORDER_SEQ_CST | CL_DEVICE_ATOMIC_SCOPE_ALL_DEVICES |
CL_DEVICE_ATOMIC_SCOPE_DEVICE | CL_DEVICE_ATOMIC_SCOPE_WORK_ITEM;
}
CL_DEVICE_ATOMIC_SCOPE_WORK_GROUP | CL_DEVICE_ATOMIC_ORDER_SEQ_CST | CL_DEVICE_ATOMIC_SCOPE_ALL_DEVICES |
CL_DEVICE_ATOMIC_SCOPE_DEVICE | CL_DEVICE_ATOMIC_SCOPE_WORK_ITEM;
EXPECT_EQ(expectedCapabilities, atomicFenceCapabilities);
}
@@ -659,8 +645,7 @@ TEST(GetDeviceInfo, WhenQueryingWorkGroupCollectiveFunctionsSupportThenProperVal
EXPECT_EQ(CL_SUCCESS, retVal);
EXPECT_EQ(sizeof(cl_bool), paramRetSize);
cl_bool expectedWorkGroupCollectiveFunctionsSupport =
deviceFactory.rootDevices[0]->areOcl21FeaturesSupported() ? CL_TRUE : CL_FALSE;
cl_bool expectedWorkGroupCollectiveFunctionsSupport = CL_TRUE;
EXPECT_EQ(expectedWorkGroupCollectiveFunctionsSupport, workGroupCollectiveFunctionsSupport);
}
@@ -674,7 +659,7 @@ TEST(GetDeviceInfo, WhenQueryingGenericAddressSpaceSupportThenProperValueIsRetur
EXPECT_EQ(CL_SUCCESS, retVal);
EXPECT_EQ(sizeof(cl_bool), paramRetSize);
cl_bool expectedGenericAddressSpaceSupport = deviceFactory.rootDevices[0]->areOcl21FeaturesSupported() ? CL_TRUE : CL_FALSE;
cl_bool expectedGenericAddressSpaceSupport = CL_TRUE;
EXPECT_EQ(expectedGenericAddressSpaceSupport, genericAddressSpaceSupport);
}

View File

@@ -83,7 +83,7 @@ struct ImageHelperUlt {
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.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(Traits::flags, imgFormat);
auto image = Image::create(
context,
NEO::ClMemoryPropertiesHelper::createMemoryProperties(Traits::flags, 0, 0, &context->getDevice(0)->getDevice()),

View File

@@ -437,7 +437,7 @@ TEST_F(GmmLocalMemoryTests, givenUseLocalMemoryInImageInfoTrueWhenGmmIsCreatedTh
cl_image_format imageFormat = {CL_R, CL_UNSIGNED_INT8};
cl_mem_flags flags = CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR;
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, defaultHwInfo->capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
imgInfo.imgDesc = Image::convertDescriptor(desc);
imgInfo.surfaceFormat = &surfaceFormat->surfaceFormat;
@@ -463,7 +463,7 @@ TEST_F(GmmLocalMemoryTests, givenUseCompressionAndLocalMemoryInImageInfoTrueWhen
cl_image_format imageFormat = {CL_R, CL_UNSIGNED_INT8};
cl_mem_flags flags = CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR;
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, defaultHwInfo->capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
imgInfo.imgDesc = Image::convertDescriptor(desc);
imgInfo.surfaceFormat = &surfaceFormat->surfaceFormat;
@@ -490,7 +490,7 @@ TEST_F(GmmLocalMemoryTests, givenUseLocalMemoryInImageInfoFalseWhenGmmIsCreatedT
cl_image_format imageFormat = {CL_R, CL_UNSIGNED_INT8};
cl_mem_flags flags = CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR;
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, defaultHwInfo->capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
imgInfo.imgDesc = Image::convertDescriptor(desc);
imgInfo.surfaceFormat = &surfaceFormat->surfaceFormat;
@@ -510,7 +510,7 @@ TEST_F(MultiTileGmmTests, whenCreateGmmWithImageInfoThenEnableMultiTileArch) {
cl_image_format imageFormat = {CL_R, CL_UNSIGNED_INT8};
cl_mem_flags flags = CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR;
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, defaultHwInfo->capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
imgInfo.imgDesc = Image::convertDescriptor(desc);
imgInfo.surfaceFormat = &surfaceFormat->surfaceFormat;

View File

@@ -102,7 +102,7 @@ TEST_F(KernelImageArgTest, givenKernelWithImageFromBufferThenIncrementCounter) {
imgDesc.image_type = CL_MEM_OBJECT_IMAGE2D;
imgDesc.mem_object = buffer;
auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, pDevice);
auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imgFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imgFormat);
auto imgFromBuffer = Image::create(context.get(), memoryProperties, 0, 0, surfaceFormat, &imgDesc, nullptr, retVal);
imageObj = imgFromBuffer;
@@ -126,7 +126,7 @@ TEST_F(KernelImageArgTest, givenImageWithNumSamplesWhenSetArgIsCalledThenPatchNu
imgDesc.image_height = 5;
auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, pDevice);
auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imgFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imgFormat);
auto sampleImg = Image::create(context.get(), memoryProperties, 0, 0, surfaceFormat, &imgDesc, nullptr, retVal);
EXPECT_EQ(CL_SUCCESS, retVal);
@@ -148,8 +148,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.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imgFormat);
std::unique_ptr<Image> img(
Image::create(context.get(), ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
flags, 0, surfaceFormat, &imgDesc, nullptr, retVal));
@@ -198,8 +197,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.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imgFormat);
std::unique_ptr<Image> img(
Image::create(context.get(), ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
flags, 0, surfaceFormat, &imgDesc, nullptr, retVal));
@@ -221,8 +219,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.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imgFormat);
std::unique_ptr<Image> img(
Image::create(context.get(), ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
flags, 0, surfaceFormat, &imgDesc, nullptr, retVal));
@@ -240,8 +237,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.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imgFormat);
std::unique_ptr<Image> img(
Image::create(context.get(), ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
flags, 0, surfaceFormat, &imgDesc, nullptr, retVal));
@@ -261,7 +257,7 @@ HWTEST_F(KernelImageArgTest, givenImgWithMcsAllocWhenMakeResidentThenMakeMcsAllo
imgDesc.image_height = 5;
auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(0, 0, 0, pDevice);
auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imgFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imgFormat);
auto img = Image::create(context.get(), memoryProperties, 0, 0, surfaceFormat, &imgDesc, nullptr, retVal);
EXPECT_EQ(CL_SUCCESS, retVal);
auto mcsAlloc = context->getMemoryManager()->allocateGraphicsMemoryWithProperties(MockAllocationProperties{pDevice->getRootDeviceIndex(), MemoryConstants::pageSize});
@@ -289,8 +285,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.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imgFormat);
std::unique_ptr<Image> img(
Image::create(context.get(), ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
flags, 0, surfaceFormat, &imgDesc, nullptr, retVal));
@@ -329,8 +324,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.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imgFormat);
std::unique_ptr<Image> img(
Image::create(context.get(), ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
flags, 0, surfaceFormat, &imgDesc, nullptr, retVal));

View File

@@ -2486,8 +2486,7 @@ HWTEST_F(KernelResidencyTest, WhenMakingArgsResidentThenImageFromImageCheckIsCor
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.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
cl_image_desc imageDesc = {};
imageDesc.image_type = CL_MEM_OBJECT_IMAGE2D;
@@ -2505,8 +2504,7 @@ HWTEST_F(KernelResidencyTest, WhenMakingArgsResidentThenImageFromImageCheckIsCor
// create Y plane
imageFormat.image_channel_order = CL_R;
flags = CL_MEM_READ_ONLY;
surfaceFormat = Image::getSurfaceFormatFromTable(
flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
imageDesc.image_width = 0;
imageDesc.image_height = 0;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2024 Intel Corporation
* Copyright (C) 2018-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -32,7 +32,7 @@ class CreateImageFormatTest : public testing::TestWithParam<size_t> {
indexImageFormat = GetParam();
ArrayRef<const ClSurfaceFormatInfo>
surfaceFormatTable = SurfaceFormats::surfaceFormats(flags, defaultHwInfo->capabilityTable.supportsOcl21Features);
surfaceFormatTable = SurfaceFormats::surfaceFormats(flags);
ASSERT_GT(surfaceFormatTable.size(), indexImageFormat);
surfaceFormat = &surfaceFormatTable[indexImageFormat];
@@ -106,7 +106,7 @@ TEST_P(ReadOnlyFormatTest, GivenValidReadOnlyFormatWhenCreatingImageThenImageIsC
INSTANTIATE_TEST_SUITE_P(
CreateImage,
ReadOnlyFormatTest,
testing::Range(zero, SurfaceFormats::readOnly12().size()));
testing::Range(zero, SurfaceFormats::readOnly().size()));
typedef CreateImageFormatTest<CL_MEM_WRITE_ONLY> WriteOnlyFormatTest;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021-2023 Intel Corporation
* Copyright (C) 2021-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -70,7 +70,7 @@ TEST_F(ImageInLocalMemoryTest, givenImageWithoutHostPtrWhenLocalMemoryIsEnabledT
cl_int retVal = 0;
cl_mem_flags flags = CL_MEM_READ_WRITE;
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
std::unique_ptr<Image> image(Image::create(
context.get(), ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2024 Intel Corporation
* Copyright (C) 2018-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -74,7 +74,7 @@ typedef CreateImage1DTest CreateImage1DType;
HWTEST_P(CreateImage1DType, GivenValidTypeWhenCreatingImageThenImageParamsAreCorrect) {
cl_mem_flags flags = CL_MEM_READ_WRITE;
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, pClDevice->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
auto image = Image::create(
context,
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, pDevice),

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2024 Intel Corporation
* Copyright (C) 2018-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -60,8 +60,7 @@ class Image2dFromBufferTest : public ::testing::Test {
Image *createImage() {
cl_mem_flags flags = CL_MEM_READ_ONLY;
auto surfaceFormat = Image::getSurfaceFormatFromTable(
flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
return Image::create(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
flags, 0, surfaceFormat, &imageDesc, NULL, retVal);
}
@@ -93,8 +92,7 @@ TEST_F(Image2dFromBufferTest, WhenCreatingImage2dFromBufferThenImagePropertiesAr
TEST_F(Image2dFromBufferTest, givenBufferWhenCreateImage2dArrayFromBufferThenImageDescriptorIsInvalid) {
imageDesc.image_type = CL_MEM_OBJECT_IMAGE2D_ARRAY;
cl_mem_flags flags = CL_MEM_READ_ONLY;
auto surfaceFormat = Image::getSurfaceFormatFromTable(
flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
retVal = Image::validate(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
surfaceFormat, &imageDesc, NULL);
EXPECT_EQ(CL_INVALID_IMAGE_DESCRIPTOR, retVal);
@@ -110,8 +108,7 @@ TEST_F(Image2dFromBufferTest, givenInvalidRowPitchWhenCreateImage2dFromBufferThe
char ptr[10];
imageDesc.image_row_pitch = 255;
cl_mem_flags flags = CL_MEM_READ_ONLY;
auto surfaceFormat = Image::getSurfaceFormatFromTable(
flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
retVal = Image::validate(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
surfaceFormat, &imageDesc, ptr);
EXPECT_EQ(CL_INVALID_IMAGE_FORMAT_DESCRIPTOR, retVal);
@@ -141,8 +138,7 @@ TEST_F(Image2dFromBufferTest, GivenInvalidHostPtrAlignmentWhenCreatingImageThenI
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 = Image::getSurfaceFormatFromTable(
flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
retVal = Image::validate(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
surfaceFormat, &imageDesc, NULL);
EXPECT_EQ(CL_INVALID_IMAGE_FORMAT_DESCRIPTOR, retVal);
@@ -156,8 +152,7 @@ TEST_F(Image2dFromBufferTest, givenInvalidFlagsWhenValidateIsCalledThenReturnErr
cl_mem_flags flags[] = {CL_MEM_USE_HOST_PTR, CL_MEM_COPY_HOST_PTR};
for (auto flag : flags) {
auto surfaceFormat = Image::getSurfaceFormatFromTable(
flag, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flag, &imageFormat);
retVal = Image::validate(&context, ClMemoryPropertiesHelper::createMemoryProperties(flag, 0, 0, &context.getDevice(0)->getDevice()),
surfaceFormat, &imageDesc, reinterpret_cast<void *>(0x12345));
EXPECT_EQ(CL_INVALID_VALUE, retVal);
@@ -171,8 +166,7 @@ TEST_F(Image2dFromBufferTest, givenOneChannel8BitColorsNoRowPitchSpecifiedAndToo
imageFormat.image_channel_data_type = CL_UNORM_INT8;
imageFormat.image_channel_order = CL_R;
auto surfaceFormat = Image::getSurfaceFormatFromTable(
flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
retVal = Image::validate(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
surfaceFormat, &imageDesc, NULL);
EXPECT_EQ(CL_INVALID_IMAGE_FORMAT_DESCRIPTOR, retVal);
@@ -185,8 +179,7 @@ TEST_F(Image2dFromBufferTest, givenOneChannel16BitColorsNoRowPitchSpecifiedAndTo
imageFormat.image_channel_data_type = CL_UNORM_INT16;
imageFormat.image_channel_order = CL_R;
auto surfaceFormat = Image::getSurfaceFormatFromTable(
flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
retVal = Image::validate(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
surfaceFormat, &imageDesc, NULL);
EXPECT_EQ(CL_INVALID_IMAGE_FORMAT_DESCRIPTOR, retVal);
@@ -199,8 +192,7 @@ TEST_F(Image2dFromBufferTest, givenFourChannel8BitColorsNoRowPitchSpecifiedAndTo
imageFormat.image_channel_data_type = CL_UNORM_INT8;
imageFormat.image_channel_order = CL_RGBA;
const auto surfaceFormat = Image::getSurfaceFormatFromTable(
flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
const auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
retVal = Image::validate(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
surfaceFormat, &imageDesc, NULL);
EXPECT_EQ(CL_INVALID_IMAGE_FORMAT_DESCRIPTOR, retVal);
@@ -213,8 +205,7 @@ TEST_F(Image2dFromBufferTest, givenFourChannel16BitColorsNoRowPitchSpecifiedAndT
imageFormat.image_channel_data_type = CL_UNORM_INT16;
imageFormat.image_channel_order = CL_RGBA;
auto surfaceFormat = Image::getSurfaceFormatFromTable(
flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
retVal = Image::validate(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
surfaceFormat, &imageDesc, NULL);
EXPECT_EQ(CL_INVALID_IMAGE_FORMAT_DESCRIPTOR, retVal);
@@ -228,8 +219,7 @@ TEST_F(Image2dFromBufferTest, givenFourChannel8BitColorsAndNotTooLargeRowPitchSp
imageFormat.image_channel_data_type = CL_UNORM_INT8;
imageFormat.image_channel_order = CL_RGBA;
auto surfaceFormat = Image::getSurfaceFormatFromTable(
flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
retVal = Image::validate(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
surfaceFormat, &imageDesc, NULL);
EXPECT_EQ(CL_SUCCESS, retVal);
@@ -244,8 +234,7 @@ TEST_F(Image2dFromBufferTest, givenFourChannel8BitColorsAndTooLargeRowPitchSpeci
imageFormat.image_channel_data_type = CL_UNORM_INT8;
imageFormat.image_channel_order = CL_RGBA;
auto surfaceFormat = Image::getSurfaceFormatFromTable(
flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
retVal = Image::validate(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
surfaceFormat, &imageDesc, NULL);
EXPECT_EQ(CL_INVALID_IMAGE_FORMAT_DESCRIPTOR, retVal);
@@ -260,8 +249,7 @@ TEST_F(Image2dFromBufferTest, givenUnalignedImageWidthAndNoSpaceInBufferForAlign
imageFormat.image_channel_data_type = CL_UNORM_INT8;
imageFormat.image_channel_order = CL_R;
auto surfaceFormat = Image::getSurfaceFormatFromTable(
flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
retVal = Image::validate(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
surfaceFormat, &imageDesc, NULL);
EXPECT_EQ(CL_INVALID_IMAGE_FORMAT_DESCRIPTOR, retVal);

View File

@@ -55,8 +55,7 @@ class CreateImage2DTest : public ClDeviceFixture,
ClDeviceFixture::tearDown();
}
Image *createImageWithFlags(cl_mem_flags flags) {
auto surfaceFormat = Image::getSurfaceFormatFromTable(
flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
return Image::create(context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal);
}

View File

@@ -59,8 +59,7 @@ class CreateImage3DTest : public ClDeviceFixture,
HWTEST_F(CreateImage3DTest, WhenCreatingImageThenPropertiesAreSetCorrectly) {
cl_mem_flags flags = CL_MEM_READ_WRITE;
auto surfaceFormat = Image::getSurfaceFormatFromTable(
flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
auto image = Image::create(context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal);
@@ -89,7 +88,7 @@ HWTEST_F(CreateImage3DTest, WhenCreatingImageThenPropertiesAreSetCorrectly) {
HWTEST_F(CreateImage3DTest, GivenTiledOrForcedLinearWhenCreatingImageThenPropertiesAreSetCorrectly) {
bool defaultTiling = debugManager.flags.ForceLinearImages.get();
imageDesc.image_height = 1;
auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imageFormat);
auto imageDescriptor = Image::convertDescriptor(imageDesc);
auto imgInfo = MockGmm::initImgInfo(imageDescriptor, 0, &surfaceFormat->surfaceFormat);
MockGmm::queryImgParams(context->getDevice(0)->getGmmHelper(), imgInfo, false);
@@ -116,7 +115,7 @@ HWTEST_F(CreateImage3DTest, GivenTiledOrForcedLinearWhenCreatingImageThenPropert
debugManager.flags.ForceLinearImages.set(!defaultTiling);
// query again
surfaceFormat = Image::getSurfaceFormatFromTable(0, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
surfaceFormat = Image::getSurfaceFormatFromTable(0, &imageFormat);
MockGmm::queryImgParams(context->getDevice(0)->getGmmHelper(), imgInfo, false);
image = Image::create(

View File

@@ -71,7 +71,7 @@ typedef ImageArraySizeTest CreateImageArraySize;
HWTEST_P(CreateImageArraySize, GivenArrayTypeWhenCreatingImageThenImageCreatedWithCorrectParams) {
cl_mem_flags flags = CL_MEM_READ_WRITE;
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
auto image = Image::create(
context,
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
@@ -112,7 +112,7 @@ typedef ImageArraySizeTest CreateImageNonArraySize;
HWTEST_P(CreateImageNonArraySize, GivenNonArrayTypeWhenCreatingImageThenImageCreatedWithCorrectParams) {
cl_mem_flags flags = CL_MEM_READ_WRITE;
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
auto image = Image::create(
context,
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),

View File

@@ -63,8 +63,7 @@ class ImageFromSubBufferTest : public ClDeviceFixture, public ::testing::Test {
Image *createImage() {
cl_mem_flags flags = CL_MEM_READ_ONLY;
auto surfaceFormat = Image::getSurfaceFormatFromTable(
flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
return Image::create(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
flags, 0, surfaceFormat, &imageDesc, NULL, retVal);
}

View File

@@ -49,7 +49,7 @@ class ImageRedescribeTest : public testing::TestWithParam<std::tuple<size_t, uin
retVal = CL_INVALID_VALUE;
cl_mem_flags flags = CL_MEM_READ_WRITE;
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
image.reset(Image::create(
&context,
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
@@ -191,7 +191,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.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
auto bigImage = std::unique_ptr<Image>(Image::create(
&context,
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2024 Intel Corporation
* Copyright (C) 2018-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -17,8 +17,7 @@ using namespace NEO;
const cl_mem_flags flagsForTests[] = {CL_MEM_READ_ONLY, CL_MEM_WRITE_ONLY, CL_MEM_READ_WRITE};
const ArrayRef<const ClSurfaceFormatInfo> paramsForSnormTests[] = {
SurfaceFormats::readOnly12(),
SurfaceFormats::readOnly20(),
SurfaceFormats::readOnly(),
SurfaceFormats::writeOnly(),
SurfaceFormats::readWrite()};
@@ -40,12 +39,7 @@ TEST_P(SnormSurfaceFormatAccessFlagsTests, givenSnormFormatWhenGetSurfaceFormatF
cl_mem_flags flags = GetParam();
for (const auto &snormSurfaceFormat : referenceSnormSurfaceFormats) {
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, true /* supportsOcl20Features */);
auto format = Image::getSurfaceFormatFromTable(flags, &snormSurfaceFormat.oclImageFormat);
EXPECT_NE(nullptr, format);
EXPECT_TRUE(memcmp(&snormSurfaceFormat, format, sizeof(ClSurfaceFormatInfo)) == 0);
}

View File

@@ -66,8 +66,7 @@ class CreateImageTest : public ClDeviceFixture,
return createImageWithFlags(flags, context);
}
Image *createImageWithFlags(cl_mem_flags flags, Context *context) {
auto surfaceFormat = Image::getSurfaceFormatFromTable(
flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
return Image::create(context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal);
}
@@ -141,8 +140,7 @@ TEST(TestSliceAndRowPitch, Given1dImageWithZeroRowPitchAndZeroSlicePitchWhenGett
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.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
auto image = Image::create(
&context,
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
@@ -192,8 +190,7 @@ TEST(TestSliceAndRowPitch, Given1dImageWithNonZeroRowPitchAndZeroSlicePitchWhenG
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.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
auto image = Image::create(
&context,
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
@@ -243,8 +240,7 @@ TEST(TestSliceAndRowPitch, Given2dImageWithNonZeroRowPitchAndZeroSlicePitchWhenG
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.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
auto image = Image::create(
&context,
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
@@ -294,8 +290,7 @@ TEST(TestSliceAndRowPitch, Given1dArrayWithNonZeroRowPitchAndZeroSlicePitchWhenG
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.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
auto image = Image::create(
&context,
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
@@ -345,8 +340,7 @@ TEST(TestSliceAndRowPitch, Given2dArrayWithNonZeroRowPitchAndZeroSlicePitchWhenG
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.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
auto image = Image::create(
&context,
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
@@ -396,8 +390,7 @@ TEST(TestSliceAndRowPitch, Given2dArrayWithZeroRowPitchAndNonZeroSlicePitchWhenG
imageDesc.image_slice_pitch = (width + 1) * elementSize * height;
cl_mem_flags flags = CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR;
auto surfaceFormat = Image::getSurfaceFormatFromTable(
flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
auto image = Image::create(
&context,
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
@@ -447,8 +440,7 @@ TEST(TestSliceAndRowPitch, Given2dArrayWithNonZeroRowPitchAndNonZeroSlicePitchWh
imageDesc.image_slice_pitch = (width + 1) * elementSize * height;
cl_mem_flags flags = CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR;
auto surfaceFormat = Image::getSurfaceFormatFromTable(
flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
auto image = Image::create(
&context,
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
@@ -498,8 +490,7 @@ TEST(TestSliceAndRowPitch, Given2dArrayWithNonZeroRowPitchAndNonZeroSlicePitchGr
imageDesc.image_slice_pitch = (width + 1) * elementSize * (height + 1);
cl_mem_flags flags = CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR;
auto surfaceFormat = Image::getSurfaceFormatFromTable(
flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
auto image = Image::create(
&context,
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
@@ -557,8 +548,7 @@ TEST(TestCreateImageUseHostPtr, GivenDifferenHostPtrAlignmentsWhenCheckingMemory
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.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
for (int i = 0; i < 4; i++) {
auto image = Image::create(
&context,
@@ -595,8 +585,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.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
auto hostPtr = alignedMalloc(imageDesc.image_width * surfaceFormat->surfaceFormat.imageElementSizeInBytes,
MemoryConstants::cacheLineSize);
@@ -690,8 +679,7 @@ struct CreateImageHostPtr
}
Image *createImage(cl_int &retVal) {
auto surfaceFormat = Image::getSurfaceFormatFromTable(
flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
return Image::create(
context,
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context->getDevice(0)->getDevice()),
@@ -1102,7 +1090,7 @@ INSTANTIATE_TEST_SUITE_P(
TEST(ImageGetSurfaceFormatInfoTest, givenNullptrFormatWhenGetSurfaceFormatInfoIsCalledThenReturnsNullptr) {
MockContext context;
auto surfaceFormat = Image::getSurfaceFormatFromTable(0, nullptr, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(0, nullptr);
EXPECT_EQ(nullptr, surfaceFormat);
}
@@ -1111,7 +1099,7 @@ HWTEST_F(ImageCompressionTests, givenTiledImageWhenCreatingAllocationThenPreferC
imageDesc.image_width = 5;
imageDesc.image_height = 5;
MockContext context;
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
auto image = std::unique_ptr<Image>(Image::create(
mockContext.get(), ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
@@ -1132,7 +1120,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.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
auto image = std::unique_ptr<Image>(Image::create(
mockContext.get(), ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
@@ -1150,8 +1138,7 @@ HWTEST_F(ImageCompressionTests, givenTiledImageAndVariousFlagsWhenCreatingAlloca
auto newFlags = flags | CL_MEM_COMPRESSED_HINT_INTEL;
MockContext context;
auto surfaceFormat = Image::getSurfaceFormatFromTable(
newFlags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(newFlags, &imageFormat);
auto image = std::unique_ptr<Image>(Image::create(
mockContext.get(), ClMemoryPropertiesHelper::createMemoryProperties(newFlags, 0, 0, &context.getDevice(0)->getDevice()),
newFlags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
@@ -1167,8 +1154,7 @@ HWTEST_F(ImageCompressionTests, givenTiledImageAndVariousFlagsWhenCreatingAlloca
}
newFlags = flags | CL_MEM_UNCOMPRESSED_HINT_INTEL;
surfaceFormat = Image::getSurfaceFormatFromTable(
newFlags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
surfaceFormat = Image::getSurfaceFormatFromTable(newFlags, &imageFormat);
image = std::unique_ptr<Image>(Image::create(
mockContext.get(), ClMemoryPropertiesHelper::createMemoryProperties(newFlags, 0, 0, &context.getDevice(0)->getDevice()),
newFlags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
@@ -1184,8 +1170,7 @@ TEST_F(ImageCompressionTests, givenNonTiledImageAndVariousFlagsWhenCreatingAlloc
auto newFlags = flags | CL_MEM_COMPRESSED_HINT_INTEL;
MockContext context;
auto surfaceFormat = Image::getSurfaceFormatFromTable(
newFlags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(newFlags, &imageFormat);
auto image = std::unique_ptr<Image>(Image::create(
mockContext.get(), ClMemoryPropertiesHelper::createMemoryProperties(newFlags, 0, 0, &context.getDevice(0)->getDevice()),
newFlags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
@@ -1195,8 +1180,7 @@ TEST_F(ImageCompressionTests, givenNonTiledImageAndVariousFlagsWhenCreatingAlloc
EXPECT_FALSE(myMemoryManager->capturedPreferCompressed);
newFlags = flags | CL_MEM_UNCOMPRESSED_HINT_INTEL;
surfaceFormat = Image::getSurfaceFormatFromTable(
newFlags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
surfaceFormat = Image::getSurfaceFormatFromTable(newFlags, &imageFormat);
image = std::unique_ptr<Image>(Image::create(
mockContext.get(), ClMemoryPropertiesHelper::createMemoryProperties(newFlags, 0, 0, &context.getDevice(0)->getDevice()),
newFlags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
@@ -1426,8 +1410,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.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
auto image = std::unique_ptr<Image>(Image::create(
&context,
@@ -1470,8 +1453,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.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
memoryManager->returnAllocateNonSystemGraphicsMemoryInDevicePool = true;
std::unique_ptr<Image> image(
Image::create(&ctx, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
@@ -1861,8 +1843,7 @@ TEST(ImageTest, givenPropertiesWithClDeviceHandleListKHRWhenCreateImageThenCorre
ClMemoryPropertiesHelper::parseMemoryProperties(properties, memoryProperties, flags, flagsIntel, allocflags,
ClMemoryPropertiesHelper::ObjType::image, context);
auto surfaceFormat = Image::getSurfaceFormatFromTable(
flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
auto image = Image::create(
&context,
@@ -1918,8 +1899,7 @@ HWTEST2_F(MultiRootDeviceImageTest, givenHostPtrToCopyWhenImageIsCreatedWithMult
uint32_t data{};
auto surfaceFormat = Image::getSurfaceFormatFromTable(
flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
std::unique_ptr<Image> image(
Image::create(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
flags, 0, surfaceFormat, &imageDesc, &data, retVal));
@@ -1937,8 +1917,7 @@ HWTEST2_F(MultiRootDeviceImageTest, givenHostPtrToCopyWhenImageIsCreatedWithMult
uint32_t data{};
auto surfaceFormat = Image::getSurfaceFormatFromTable(
flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
std::unique_ptr<Image> image(
Image::create(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
flags, 0, surfaceFormat, &imageDesc, &data, retVal));

View File

@@ -100,8 +100,7 @@ HWTEST2_F(XeHPAndLaterImageTests, givenCompressionWhenAppendingImageFromBufferTh
auto buffer = castToObject<Buffer>(imageDesc.mem_object);
buffer->getGraphicsAllocation(0)->setGmm(gmm, 0);
auto surfaceFormat = Image::getSurfaceFormatFromTable(
CL_MEM_READ_WRITE, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(CL_MEM_READ_WRITE, &imageFormat);
auto image = std::unique_ptr<Image>(Image::create(
&context, ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()),
CL_MEM_READ_WRITE, 0, surfaceFormat, &imageDesc, NULL, retVal));
@@ -142,7 +141,7 @@ HWTEST2_F(XeHPAndLaterImageTests, givenImageFromBufferWhenSettingSurfaceStateThe
auto buffer = castToObject<Buffer>(imageDesc.mem_object);
buffer->getGraphicsAllocation(0)->setGmm(gmm, 0);
auto surfaceFormat = Image::getSurfaceFormatFromTable(CL_MEM_READ_WRITE, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(CL_MEM_READ_WRITE, &imageFormat);
auto image = std::unique_ptr<Image>(Image::create(&context, ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()),
CL_MEM_READ_WRITE, 0, surfaceFormat, &imageDesc, NULL, retVal));
auto imageHw = static_cast<ImageHw<FamilyType> *>(image.get());

View File

@@ -71,7 +71,7 @@ class CreateTiledImageTest : public ClDeviceFixture,
HWTEST_P(CreateTiledImageTest, GivenImageTypeWhenCheckingIsTiledThenTrueReturnedForTiledImage) {
MockContext context;
cl_mem_flags flags = CL_MEM_READ_WRITE;
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, pClDevice->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
auto image = Image::create(
&context,
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, pDevice),

View File

@@ -112,12 +112,12 @@ TEST(ImageDepthFormatTest, GivenDepthFormatsWhenGettingSurfaceFormatThenCorrectS
imgFormat.image_channel_order = CL_DEPTH;
imgFormat.image_channel_data_type = CL_FLOAT;
auto surfaceFormatInfo = Image::getSurfaceFormatFromTable(CL_MEM_READ_WRITE, &imgFormat, defaultHwInfo->capabilityTable.supportsOcl21Features);
auto surfaceFormatInfo = Image::getSurfaceFormatFromTable(CL_MEM_READ_WRITE, &imgFormat);
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.supportsOcl21Features);
surfaceFormatInfo = Image::getSurfaceFormatFromTable(CL_MEM_READ_WRITE, &imgFormat);
ASSERT_NE(surfaceFormatInfo, nullptr);
EXPECT_TRUE(surfaceFormatInfo->surfaceFormat.gmmSurfaceFormat == GMM_FORMAT_R16_UNORM_TYPE);
}
@@ -127,12 +127,12 @@ TEST(ImageDepthFormatTest, GivenWriteOnlyDepthFormatsWhenGettingSurfaceFormatThe
imgFormat.image_channel_order = CL_DEPTH;
imgFormat.image_channel_data_type = CL_FLOAT;
auto surfaceFormatInfo = Image::getSurfaceFormatFromTable(CL_MEM_WRITE_ONLY, &imgFormat, defaultHwInfo->capabilityTable.supportsOcl21Features);
auto surfaceFormatInfo = Image::getSurfaceFormatFromTable(CL_MEM_WRITE_ONLY, &imgFormat);
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.supportsOcl21Features);
surfaceFormatInfo = Image::getSurfaceFormatFromTable(CL_MEM_WRITE_ONLY, &imgFormat);
ASSERT_NE(surfaceFormatInfo, nullptr);
EXPECT_TRUE(surfaceFormatInfo->surfaceFormat.gmmSurfaceFormat == GMM_FORMAT_R16_UNORM_TYPE);
}
@@ -142,13 +142,13 @@ TEST(ImageDepthFormatTest, GivenDepthStencilFormatsWhenGettingSurfaceFormatThenC
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.supportsOcl21Features);
auto surfaceFormatInfo = Image::getSurfaceFormatFromTable(CL_MEM_READ_ONLY, &imgFormat);
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.supportsOcl21Features);
surfaceFormatInfo = Image::getSurfaceFormatFromTable(CL_MEM_READ_ONLY, &imgFormat);
ASSERT_NE(surfaceFormatInfo, nullptr);
EXPECT_TRUE(surfaceFormatInfo->surfaceFormat.gmmSurfaceFormat == GMM_FORMAT_R32G32_FLOAT_TYPE);
}

View File

@@ -628,10 +628,6 @@ HWTEST_F(UsmDestructionTests, givenSharedUsmAllocationWhenBlockingFreeIsCalledTh
MockDevice &mockDevice = *deviceFactory.pUltDeviceFactory->rootDevices[0];
MockContext mockContext(deviceFactory.rootDevices[0], false);
if (mockContext.getDevice(0u)->getHardwareInfo().capabilityTable.supportsOcl21Features == false) {
GTEST_SKIP();
}
auto mockCsr = new MyCsr<FamilyType>(*mockDevice.executionEnvironment, 1);
mockDevice.resetCommandStreamReceiver(mockCsr);
*mockCsr->getTagAddress() = 5u;
@@ -661,10 +657,6 @@ HWTEST_F(UsmDestructionTests, givenUsmAllocationWhenBlockingFreeIsCalledThenWait
MockDevice &mockDevice = *deviceFactory.pUltDeviceFactory->rootDevices[0];
MockContext mockContext(deviceFactory.rootDevices[0], false);
if (mockContext.getDevice(0u)->getHardwareInfo().capabilityTable.supportsOcl21Features == false) {
GTEST_SKIP();
}
auto mockCsr = new MyCsr<FamilyType>(*mockDevice.executionEnvironment, 1);
mockDevice.resetCommandStreamReceiver(mockCsr);
*mockCsr->getTagAddress() = 5u;

View File

@@ -76,15 +76,13 @@ class Nv12ImageTest : public testing::Test {
}
void validateImageWithFlags(cl_mem_flags flags) {
auto surfaceFormat = Image::getSurfaceFormatFromTable(
flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
retVal = Image::validate(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
surfaceFormat, &imageDesc, nullptr);
}
Image *createImageWithFlags(cl_mem_flags flags) {
auto surfaceFormat = Image::getSurfaceFormatFromTable(
flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
return Image::create(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal);
}
@@ -352,7 +350,7 @@ HWTEST_F(Nv12ImageTest, WhenCreatingParentImageThenPlanesAreWritten) {
// 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.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
std::unique_ptr<Image> imageNV12{Image::create(contextWithMockCmdQ,
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
flags, 0, surfaceFormat, &imageDesc, hostPtr, retVal)};

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2024 Intel Corporation
* Copyright (C) 2018-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -56,8 +56,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.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
retVal = Image::validate(
&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
surfaceFormat, &imageDesc, nullptr);
@@ -75,8 +74,7 @@ cl_channel_order packedYuvChannels[] = {CL_YUYV_INTEL, CL_UYVY_INTEL, CL_YVYU_IN
TEST_P(PackedYuvImageTest, GivenValidPackedYuvImageFormatAndDescriptorWhenCreatingImageThenIsPackYuvImageReturnsTrue) {
flags = CL_MEM_READ_ONLY;
auto surfaceFormat = Image::getSurfaceFormatFromTable(
flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
auto image = Image::create(
&context,
ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
@@ -138,15 +136,13 @@ class PackedYUVImageTest : public testing::Test {
}
void validateImageWithFlags(cl_mem_flags flags) {
auto surfaceFormat = Image::getSurfaceFormatFromTable(
flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
retVal = Image::validate(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
surfaceFormat, &imageDesc, nullptr);
}
Image *createImageWithFlags(cl_mem_flags flags) {
auto surfaceFormat = Image::getSurfaceFormatFromTable(
flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
return Image::create(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal);
}

View File

@@ -122,7 +122,7 @@ TEST(ClOsAgnosticMemoryManager, givenHostPointerNotRequiringCopyWhenAllocateGrap
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.supportsOcl21Features)->surfaceFormat;
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat)->surfaceFormat;
auto imgInfo = MockGmm::initImgInfo(imgDesc, 0, &surfaceFormat);
imgInfo.rowPitch = imgDesc.imageWidth * 4;
@@ -162,7 +162,7 @@ TEST(ClOsAgnosticMemoryManager, givenHostPointerRequiringCopyWhenAllocateGraphic
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.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
auto imgInfo = MockGmm::initImgInfo(imgDesc, 0, &surfaceFormat->surfaceFormat);
imgInfo.rowPitch = imgDesc.imageWidth * 4;
@@ -196,7 +196,7 @@ TEST(ClMemoryManagerTest, givenAllowedTilingWhenIsCopyRequiredIsCalledThenTrueIs
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.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
imgInfo.imgDesc = Image::convertDescriptor(imageDesc);
imgInfo.surfaceFormat = &surfaceFormat->surfaceFormat;
@@ -222,7 +222,7 @@ TEST(ClMemoryManagerTest, givenDifferentRowPitchWhenIsCopyRequiredIsCalledThenTr
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.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
imgInfo.imgDesc = Image::convertDescriptor(imageDesc);
imgInfo.surfaceFormat = &surfaceFormat->surfaceFormat;
@@ -243,7 +243,7 @@ TEST(ClMemoryManagerTest, givenDifferentSlicePitchAndTilingNotAllowedWhenIsCopyR
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.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
cl_image_desc imageDesc{};
imageDesc.image_type = CL_MEM_OBJECT_IMAGE1D;
@@ -269,7 +269,7 @@ TEST(ClMemoryManagerTest, givenNotCachelinAlignedPointerWhenIsCopyRequiredIsCall
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.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
cl_image_desc imageDesc{};
imageDesc.image_type = CL_MEM_OBJECT_IMAGE1D;
@@ -294,7 +294,7 @@ TEST(ClMemoryManagerTest, givenCachelineAlignedPointerAndProperDescriptorValuesW
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.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
cl_image_desc imageDesc{};
imageDesc.image_type = CL_MEM_OBJECT_IMAGE1D;
@@ -328,7 +328,7 @@ TEST(ClMemoryManagerTest, givenForcedLinearImages3DImageAndProperDescriptorValue
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.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
cl_image_desc imageDesc{};
imageDesc.image_type = CL_MEM_OBJECT_IMAGE3D;

View File

@@ -985,10 +985,6 @@ TEST(UnifiedSharedMemoryTransferCalls, givenHostUsmAllocationWhenPtrIsUsedForTra
MockContext mockContext(deviceFactory.rootDevices[0]);
cl_context clContext = &mockContext;
if (mockContext.getDevice(0u)->getHardwareInfo().capabilityTable.supportsOcl21Features == false) {
GTEST_SKIP();
}
auto status = CL_INVALID_PLATFORM;
cl_device_id clDevice = mockContext.getDevice(0u);

View File

@@ -42,10 +42,6 @@ std::unique_ptr<CommandStreamReceiver> MockClDevice::createCommandStreamReceiver
return device.createCommandStreamReceiver();
}
bool MockClDevice::areOcl21FeaturesSupported() const {
return device.getHardwareInfo().capabilityTable.supportsOcl21Features;
}
void MockClDevice::setPciUuid(std::array<uint8_t, ProductHelper::uuidSize> &id) {
memcpy_s(device.uuid.id.data(), ProductHelper::uuidSize, id.data(), ProductHelper::uuidSize);
device.uuid.isValid = true;

View File

@@ -81,8 +81,6 @@ class MockClDevice : public ClDevice {
std::unique_ptr<CommandStreamReceiver> createCommandStreamReceiver() const;
BuiltIns *getBuiltIns() const { return getDevice().getBuiltIns(); }
bool areOcl21FeaturesSupported() const;
MockDevice &device;
DeviceInfo &sharedDeviceInfo;
ExecutionEnvironment *&executionEnvironment;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2023 Intel Corporation
* Copyright (C) 2018-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -43,8 +43,7 @@ void MockGmmResourceInfo::setSurfaceFormat() {
surfaceFormatInfo = &tempSurface;
}
iterate(SurfaceFormats::readOnly12());
iterate(SurfaceFormats::readOnly20());
iterate(SurfaceFormats::readOnly());
iterate(SurfaceFormats::writeOnly());
iterate(SurfaceFormats::readWrite());

View File

@@ -321,7 +321,7 @@ HWTEST_TEMPLATED_F(ClDrmMemoryManagerTest, givenDrmMemoryManagerWhenTiledImageWi
auto retVal = CL_SUCCESS;
cl_mem_flags flags = CL_MEM_WRITE_ONLY;
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
std::unique_ptr<Image> dstImage(Image::create(
&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
@@ -370,7 +370,7 @@ HWTEST_TEMPLATED_F(ClDrmMemoryManagerTest, givenDrmMemoryManagerWhenTiledImageWi
auto retVal = CL_SUCCESS;
cl_mem_flags flags = CL_MEM_WRITE_ONLY;
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
std::unique_ptr<Image> dstImage(Image::create(
&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
@@ -412,7 +412,7 @@ HWTEST_TEMPLATED_F(ClDrmMemoryManagerTest, givenDrmMemoryManagerWhenTiledImageIs
InjectedFunction method = [&](size_t failureIndex) {
cl_mem_flags flags = CL_MEM_WRITE_ONLY;
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
std::unique_ptr<Image> dstImage(Image::create(
&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
@@ -483,7 +483,7 @@ HWTEST2_TEMPLATED_F(ClDrmMemoryManagerTest, givenDrmMemoryManagerWhenTiledImageI
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.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
std::unique_ptr<Image> dstImage(Image::create(
&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
flags, 0, surfaceFormat, &imageDesc, data, retVal));
@@ -530,7 +530,7 @@ HWTEST_TEMPLATED_F(ClDrmMemoryManagerTest, givenDrmMemoryManagerWhenMemoryAlloca
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.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
std::unique_ptr<Image> dstImage(Image::create(
&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
flags, 0, surfaceFormat, &imageDesc, data, retVal));
@@ -565,7 +565,7 @@ HWTEST_TEMPLATED_F(ClDrmMemoryManagerTest, givenDrmMemoryManagerWhenNonTiledImgW
this->mock->createParamsSize = 0;
cl_mem_flags flags = CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR;
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
std::unique_ptr<Image> dstImage(Image::create(
&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
flags, 0, surfaceFormat, &imageDesc, data, retVal));
@@ -614,7 +614,7 @@ HWTEST_TEMPLATED_F(ClDrmMemoryManagerTest, givenDrmMemoryManagerWhenNonTiledImgW
this->mock->createParamsSize = 0;
cl_mem_flags flags = CL_MEM_WRITE_ONLY;
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
std::unique_ptr<Image> dstImage(Image::create(
&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
flags, 0, surfaceFormat, &imageDesc, data, retVal));
@@ -662,7 +662,7 @@ HWTEST_TEMPLATED_F(ClDrmMemoryManagerTest, givenDrmMemoryManagerWhen1DarrayImage
this->mock->createParamsSize = 0;
cl_mem_flags flags = CL_MEM_WRITE_ONLY | CL_MEM_USE_HOST_PTR;
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
std::unique_ptr<Image> dstImage(Image::create(
&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
flags, 0, surfaceFormat, &imageDesc, data, retVal));
@@ -698,7 +698,7 @@ HWTEST_TEMPLATED_F(ClDrmMemoryManagerTest, givenHostPointerNotRequiringCopyWhenA
cl_mem_flags flags = CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR;
MockContext context(pClDevice);
auto surfaceFormat = &Image::getSurfaceFormatFromTable(flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features)->surfaceFormat;
auto surfaceFormat = &Image::getSurfaceFormatFromTable(flags, &imageFormat)->surfaceFormat;
auto imgInfo = MockGmm::initImgInfo(imgDesc, 0, surfaceFormat);
imgInfo.rowPitch = imgDesc.imageWidth * surfaceFormat->imageElementSizeInBytes;
@@ -747,7 +747,7 @@ HWTEST_TEMPLATED_F(ClDrmMemoryManagerTest, givenOsHandleWithNonTiledObjectWhenCr
imgInfo.imgDesc = Image::convertDescriptor(imgDesc);
MockContext context(pClDevice);
gmmSurfaceFormat = Image::getSurfaceFormatFromTable(flags, &gmmImgFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
gmmSurfaceFormat = Image::getSurfaceFormatFromTable(flags, &gmmImgFormat);
imgInfo.surfaceFormat = &gmmSurfaceFormat->surfaceFormat;
imgInfo.plane = GMM_PLANE_Y;
@@ -790,7 +790,7 @@ HWTEST_TEMPLATED_F(ClDrmMemoryManagerTest, givenOsHandleWithTileYObjectWhenCreat
imgInfo.imgDesc = Image::convertDescriptor(imgDesc);
MockContext context(pClDevice);
gmmSurfaceFormat = Image::getSurfaceFormatFromTable(flags, &gmmImgFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
gmmSurfaceFormat = Image::getSurfaceFormatFromTable(flags, &gmmImgFormat);
imgInfo.surfaceFormat = &gmmSurfaceFormat->surfaceFormat;
imgInfo.plane = GMM_PLANE_Y;
@@ -832,7 +832,7 @@ HWTEST_TEMPLATED_F(ClDrmMemoryManagerTest, givenDrmMemoryManagerWhenCreateFromSh
imgInfo.imgDesc = Image::convertDescriptor(imgDesc);
MockContext context(pClDevice);
gmmSurfaceFormat = Image::getSurfaceFormatFromTable(flags, &gmmImgFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
gmmSurfaceFormat = Image::getSurfaceFormatFromTable(flags, &gmmImgFormat);
imgInfo.surfaceFormat = &gmmSurfaceFormat->surfaceFormat;
imgInfo.plane = GMM_PLANE_Y;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2024 Intel Corporation
* Copyright (C) 2018-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -86,8 +86,7 @@ HWTEST_F(ClWddmMemoryManagerTest, givenWddmMemoryManagerWhenTiledImageWithMipCou
auto retVal = CL_SUCCESS;
cl_mem_flags flags = CL_MEM_WRITE_ONLY;
auto surfaceFormat = Image::getSurfaceFormatFromTable(
flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
std::unique_ptr<Image> dstImage(
Image::create(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
@@ -117,8 +116,7 @@ TEST_F(ClWddmMemoryManagerTest, givenWddmMemoryManagerWhenTiledImageWithMipCount
auto retVal = CL_SUCCESS;
cl_mem_flags flags = CL_MEM_WRITE_ONLY;
auto surfaceFormat = Image::getSurfaceFormatFromTable(
flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
std::unique_ptr<Image> dstImage(
Image::create(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
@@ -155,8 +153,7 @@ HWTEST_F(ClWddmMemoryManagerTest, givenWddmMemoryManagerWhenTiledImageIsBeingCre
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.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
std::unique_ptr<Image> dstImage(
Image::create(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
flags, 0, surfaceFormat, &imageDesc, data, retVal));
@@ -185,8 +182,7 @@ TEST_F(ClWddmMemoryManagerTest, givenWddmMemoryManagerWhenNonTiledImgWithMipCoun
auto retVal = CL_SUCCESS;
cl_mem_flags flags = CL_MEM_WRITE_ONLY;
auto surfaceFormat = Image::getSurfaceFormatFromTable(
flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
std::unique_ptr<Image> dstImage(
Image::create(&context, ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));

View File

@@ -271,19 +271,17 @@ TEST_F(PlatformTest, givenSupportingCl21WhenPlatformSupportsFp64ThenFillMatching
std::string compilerExtensions = convertEnabledExtensionsToCompilerInternalOptions(extensionsList.c_str(), features);
EXPECT_TRUE(hasSubstr(compilerExtensions, std::string(" -cl-ext=-all,+cl")));
if (hwInfo->capabilityTable.supportsOcl21Features) {
if (hwInfo->capabilityTable.supportsMediaBlock) {
EXPECT_TRUE(hasSubstr(compilerExtensions, std::string("cl_intel_spirv_media_block_io")));
} else {
EXPECT_FALSE(hasSubstr(compilerExtensions, std::string("cl_intel_spirv_media_block_io")));
}
EXPECT_TRUE(hasSubstr(compilerExtensions, std::string("cl_intel_spirv_subgroups")));
EXPECT_TRUE(hasSubstr(compilerExtensions, std::string("cl_khr_spirv_linkonce_odr")));
EXPECT_TRUE(hasSubstr(compilerExtensions, std::string("cl_khr_spirv_no_integer_wrap_decoration")));
EXPECT_TRUE(hasSubstr(compilerExtensions, std::string("cl_khr_spirv_queries")));
if (hwInfo->capabilityTable.supportsMediaBlock) {
EXPECT_TRUE(hasSubstr(compilerExtensions, std::string("cl_intel_spirv_media_block_io")));
} else {
EXPECT_FALSE(hasSubstr(compilerExtensions, std::string("cl_intel_spirv_media_block_io")));
}
EXPECT_TRUE(hasSubstr(compilerExtensions, std::string("cl_intel_spirv_subgroups")));
EXPECT_TRUE(hasSubstr(compilerExtensions, std::string("cl_khr_spirv_linkonce_odr")));
EXPECT_TRUE(hasSubstr(compilerExtensions, std::string("cl_khr_spirv_no_integer_wrap_decoration")));
EXPECT_TRUE(hasSubstr(compilerExtensions, std::string("cl_khr_spirv_queries")));
if (hwInfo->capabilityTable.ftrSupportsFP64) {
EXPECT_TRUE(hasSubstr(compilerExtensions, std::string("cl_khr_fp64")));
}
@@ -294,27 +292,6 @@ TEST_F(PlatformTest, givenSupportingCl21WhenPlatformSupportsFp64ThenFillMatching
EXPECT_TRUE(endsWith(compilerExtensions, std::string(" ")));
}
TEST_F(PlatformTest, givenNotSupportingCl21WhenPlatformNotSupportFp64ThenNotFillMatchingSubstringAndFillMandatoryTrailingSpace) {
HardwareInfo testHwInfo = *defaultHwInfo;
testHwInfo.capabilityTable.ftrSupportsFP64 = false;
testHwInfo.capabilityTable.clVersionSupport = 10;
testHwInfo.capabilityTable.supportsOcl21Features = false;
std::string extensionsList = compilerProductHelper->getDeviceExtensions(testHwInfo, releaseHelper.get());
OpenClCFeaturesContainer features;
getOpenclCFeaturesList(*defaultHwInfo, features, *compilerProductHelper.get(), releaseHelper.get());
if (testHwInfo.capabilityTable.supportsImages) {
EXPECT_TRUE(hasSubstr(extensionsList, std::string("cl_khr_3d_image_writes")));
}
std::string compilerExtensions = convertEnabledExtensionsToCompilerInternalOptions(extensionsList.c_str(), features);
EXPECT_TRUE(hasSubstr(compilerExtensions, std::string("-cl-ext=-all,+cl")));
EXPECT_FALSE(hasSubstr(compilerExtensions, std::string("cl_khr_fp64")));
EXPECT_TRUE(endsWith(compilerExtensions, std::string(" ")));
}
TEST_F(PlatformTest, givenFtrSupportAtomicsWhenCreateExtentionsListThenGetMatchingSubstrings) {
const HardwareInfo *hwInfo;
hwInfo = defaultHwInfo.get();
@@ -331,7 +308,6 @@ TEST_F(PlatformTest, givenSupportedMediaBlockAndClVersion21WhenCreateExtentionsL
HardwareInfo hwInfo = *defaultHwInfo;
hwInfo.capabilityTable.supportsMediaBlock = true;
hwInfo.capabilityTable.clVersionSupport = 21;
hwInfo.capabilityTable.supportsOcl21Features = true;
std::string extensionsList = compilerProductHelper->getDeviceExtensions(hwInfo, releaseHelper.get());
OpenClCFeaturesContainer features;
getOpenclCFeaturesList(*defaultHwInfo, features, *compilerProductHelper.get(), releaseHelper.get());

View File

@@ -238,7 +238,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.supportsOcl21Features);
auto format = Image::getSurfaceFormatFromTable(CL_MEM_READ_ONLY, &imageFormat);
ASSERT_NE(format, nullptr);
auto newHwFormat = 217u;

View File

@@ -523,13 +523,13 @@ TEST_F(VaSharingTests, givenValidPlanarSurfaceWithPlaneSetWhenApplyPlanarOptions
surfaceInfo.channelOrder = CL_RG;
surfaceInfo.channelType = CL_UNORM_INT8;
VASurface::applyPlanarOptions(surfaceInfo, 0, 0, true);
VASurface::applyPlanarOptions(surfaceInfo, 0, 0);
EXPECT_EQ(surfaceInfo.imgInfo.plane, GMM_PLANE_Y);
EXPECT_EQ(surfaceInfo.channelOrder, static_cast<cl_channel_order>(CL_R));
EXPECT_EQ(surfaceInfo.imgInfo.surfaceFormat->gmmSurfaceFormat, GMM_FORMAT_NV12);
VASurface::applyPlanarOptions(surfaceInfo, 1, 0, true);
VASurface::applyPlanarOptions(surfaceInfo, 1, 0);
EXPECT_EQ(surfaceInfo.imgInfo.plane, GMM_PLANE_U);
EXPECT_EQ(surfaceInfo.channelOrder, static_cast<cl_channel_order>(CL_RG));
@@ -541,7 +541,7 @@ TEST_F(VaSharingTests, givenValidPlanarSurfaceWithPlaneSetWhenApplyPlanarOptions
surfaceInfo.imageFourcc = VA_FOURCC_RGBP;
VASurface::applyPlanarOptions(surfaceInfo, 1, 0, true);
VASurface::applyPlanarOptions(surfaceInfo, 1, 0);
EXPECT_EQ(surfaceInfo.imgInfo.plane, GMM_PLANE_U);
EXPECT_EQ(surfaceInfo.channelOrder, static_cast<cl_channel_order>(CL_R));
@@ -549,7 +549,7 @@ TEST_F(VaSharingTests, givenValidPlanarSurfaceWithPlaneSetWhenApplyPlanarOptions
surfaceInfo.imageFourcc = VA_FOURCC_RGBP;
VASurface::applyPlanarOptions(surfaceInfo, 2, 0, true);
VASurface::applyPlanarOptions(surfaceInfo, 2, 0);
EXPECT_EQ(surfaceInfo.imgInfo.plane, GMM_PLANE_V);
EXPECT_EQ(surfaceInfo.channelOrder, static_cast<cl_channel_order>(CL_R));
@@ -559,7 +559,7 @@ TEST_F(VaSharingTests, givenValidPlanarSurfaceWithPlaneSetWhenApplyPlanarOptions
surfaceInfo.imageFourcc = VA_FOURCC_P010;
VASurface::applyPlanarOptions(surfaceInfo, 1, 0, true);
VASurface::applyPlanarOptions(surfaceInfo, 1, 0);
EXPECT_EQ(surfaceInfo.channelType, static_cast<cl_channel_type>(CL_UNORM_INT16));
EXPECT_EQ(surfaceInfo.imgInfo.surfaceFormat->gmmSurfaceFormat, GMM_FORMAT_P010);
@@ -568,7 +568,7 @@ TEST_F(VaSharingTests, givenValidPlanarSurfaceWithPlaneSetWhenApplyPlanarOptions
surfaceInfo.imageFourcc = VA_FOURCC_P016;
VASurface::applyPlanarOptions(surfaceInfo, 1, 0, true);
VASurface::applyPlanarOptions(surfaceInfo, 1, 0);
EXPECT_EQ(surfaceInfo.channelType, static_cast<cl_channel_type>(CL_UNORM_INT16));
EXPECT_EQ(surfaceInfo.imgInfo.surfaceFormat->gmmSurfaceFormat, GMM_FORMAT_P016);
@@ -579,9 +579,9 @@ TEST_F(VaSharingTests, givenValidPlanarSurfaceWithInvalidPlaneSetWhenApplyPlanar
surfaceInfo.imageFourcc = VA_FOURCC_P016;
EXPECT_THROW(VASurface::applyPlanarOptions(surfaceInfo, 2, 0, true), std::exception);
EXPECT_THROW(VASurface::applyPlanarOptions(surfaceInfo, 2, 0), std::exception);
EXPECT_THROW(VASurface::applyPlanarOptions(surfaceInfo, 3, 0, true), std::exception);
EXPECT_THROW(VASurface::applyPlanarOptions(surfaceInfo, 3, 0), std::exception);
}
TEST_F(VaSharingTests, givenValidSurfaceWithPlaneSetWhenApplyPlaneSettingsThenProperDataAreSet) {

View File

@@ -27,7 +27,7 @@ bool TestChecks::supportsImages(const Context *pContext) {
}
bool TestChecks::supportsOcl21(const std::unique_ptr<HardwareInfo> &pHardwareInfo) {
return (pHardwareInfo->capabilityTable.supportsOcl21Features && pHardwareInfo->capabilityTable.supportsIndependentForwardProgress);
return pHardwareInfo->capabilityTable.supportsIndependentForwardProgress;
}
bool TestChecks::supportsAuxResolves(const RootDeviceEnvironment &rootDeviceEnvironment) {

View File

@@ -39,7 +39,7 @@ XE_HPG_CORETEST_F(ImageCompressionTests, givenDifferentImageFormatsWhenCreatingI
{{CL_RGBA, CL_UNSIGNED_INT32}, true}};
for (const auto &format : imageFormats) {
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &format.imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &format.imageFormat);
auto image = std::unique_ptr<Image>(Image::create(
mockContext.get(), ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
@@ -62,8 +62,7 @@ XE_HPG_CORETEST_F(ImageCompressionTests, givenRedescribableFormatWhenCreatingAll
imageDesc.image_width = 5;
imageDesc.image_height = 5;
auto surfaceFormat = Image::getSurfaceFormatFromTable(
flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
auto image = std::unique_ptr<Image>(Image::create(
mockContext.get(), ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));
@@ -77,8 +76,7 @@ XE_HPG_CORETEST_F(ImageCompressionTests, givenRedescribableFormatWhenCreatingAll
}
imageFormat.image_channel_order = CL_RG;
surfaceFormat = Image::getSurfaceFormatFromTable(
flags, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
image = std::unique_ptr<Image>(Image::create(
mockContext.get(), ClMemoryPropertiesHelper::createMemoryProperties(flags, 0, 0, &context.getDevice(0)->getDevice()),
flags, 0, surfaceFormat, &imageDesc, nullptr, retVal));

View File

@@ -140,7 +140,7 @@ XE_HPG_CORETEST_F(CmdsProgrammingTestsXeHpgCore, givenDecompressInL3ForImage2dFr
auto gmmResourceInfo = buffer->getMultiGraphicsAllocation().getDefaultGraphicsAllocation()->getDefaultGmm()->gmmResourceInfo.get();
auto bufferCompressionFormat = context.getDevice(0)->getGmmClientContext()->getSurfaceStateCompressionFormat(gmmResourceInfo->getResourceFormat());
auto surfaceFormat = Image::getSurfaceFormatFromTable(CL_MEM_READ_WRITE, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(CL_MEM_READ_WRITE, &imageFormat);
auto image = std::unique_ptr<Image>(Image::create(&context, ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()),
CL_MEM_READ_WRITE, 0, surfaceFormat, &imageDesc, NULL, retVal));
auto imageHw = static_cast<ImageHw<FamilyType> *>(image.get());
@@ -213,7 +213,7 @@ XE_HPG_CORETEST_F(CmdsProgrammingTestsXeHpgCore, givenDecompressInL3ForImage2dFr
auto buffer = castToObject<Buffer>(imageDesc.mem_object);
buffer->getGraphicsAllocation(0)->setGmm(gmm, 0);
auto surfaceFormat = Image::getSurfaceFormatFromTable(CL_MEM_READ_WRITE, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(CL_MEM_READ_WRITE, &imageFormat);
auto image = std::unique_ptr<Image>(Image::create(&context, ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()),
CL_MEM_READ_WRITE, 0, surfaceFormat, &imageDesc, NULL, retVal));
auto imageHw = static_cast<ImageHw<FamilyType> *>(image.get());
@@ -258,7 +258,7 @@ XE_HPG_CORETEST_F(CmdsProgrammingTestsXeHpgCore, givenDecompressInL3ForImage2dFr
auto buffer = castToObject<Buffer>(imageDesc.mem_object);
buffer->getGraphicsAllocation(0)->setGmm(gmm, 0);
auto surfaceFormat = Image::getSurfaceFormatFromTable(CL_MEM_READ_WRITE, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(CL_MEM_READ_WRITE, &imageFormat);
auto image = std::unique_ptr<Image>(Image::create(&context, ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()),
CL_MEM_READ_WRITE, 0, surfaceFormat, &imageDesc, NULL, retVal));
auto imageHw = static_cast<ImageHw<FamilyType> *>(image.get());
@@ -304,7 +304,7 @@ XE_HPG_CORETEST_F(CmdsProgrammingTestsXeHpgCore, givenDecompressInL3ForImage2dFr
auto buffer = castToObject<Buffer>(imageDesc.mem_object);
buffer->getGraphicsAllocation(0)->setGmm(gmm, 0);
auto surfaceFormat = Image::getSurfaceFormatFromTable(CL_MEM_READ_WRITE, &imageFormat, context.getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
auto surfaceFormat = Image::getSurfaceFormatFromTable(CL_MEM_READ_WRITE, &imageFormat);
auto image = std::unique_ptr<Image>(Image::create(&context, ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context.getDevice(0)->getDevice()),
CL_MEM_READ_WRITE, 0, surfaceFormat, &imageDesc, NULL, retVal));
auto imageHw = static_cast<ImageHw<FamilyType> *>(image.get());

View File

@@ -36,55 +36,53 @@ void getOpenclCFeaturesList(const HardwareInfo &hwInfo, OpenClCFeaturesContainer
openclCFeatures.push_back(openClCFeature);
}
if (hwInfo.capabilityTable.supportsOcl21Features) {
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_atomic_order_acq_rel");
openclCFeatures.push_back(openClCFeature);
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_atomic_order_acq_rel");
openclCFeatures.push_back(openClCFeature);
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_atomic_order_seq_cst");
openclCFeatures.push_back(openClCFeature);
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_atomic_order_seq_cst");
openclCFeatures.push_back(openClCFeature);
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_atomic_scope_all_devices");
openclCFeatures.push_back(openClCFeature);
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_atomic_scope_all_devices");
openclCFeatures.push_back(openClCFeature);
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_atomic_scope_device");
openclCFeatures.push_back(openClCFeature);
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_atomic_scope_device");
openclCFeatures.push_back(openClCFeature);
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_generic_address_space");
openclCFeatures.push_back(openClCFeature);
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_generic_address_space");
openclCFeatures.push_back(openClCFeature);
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_program_scope_global_variables");
openclCFeatures.push_back(openClCFeature);
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_program_scope_global_variables");
openclCFeatures.push_back(openClCFeature);
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_work_group_collective_functions");
openclCFeatures.push_back(openClCFeature);
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_work_group_collective_functions");
openclCFeatures.push_back(openClCFeature);
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_subgroups");
openclCFeatures.push_back(openClCFeature);
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_subgroups");
openclCFeatures.push_back(openClCFeature);
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_ext_fp32_global_atomic_add");
openclCFeatures.push_back(openClCFeature);
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_ext_fp32_global_atomic_add");
openclCFeatures.push_back(openClCFeature);
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_ext_fp32_local_atomic_add");
openclCFeatures.push_back(openClCFeature);
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_ext_fp32_local_atomic_add");
openclCFeatures.push_back(openClCFeature);
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_ext_fp32_global_atomic_min_max");
openclCFeatures.push_back(openClCFeature);
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_ext_fp32_global_atomic_min_max");
openclCFeatures.push_back(openClCFeature);
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_ext_fp32_local_atomic_min_max");
openclCFeatures.push_back(openClCFeature);
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_ext_fp32_local_atomic_min_max");
openclCFeatures.push_back(openClCFeature);
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_ext_fp16_global_atomic_load_store");
openclCFeatures.push_back(openClCFeature);
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_ext_fp16_global_atomic_load_store");
openclCFeatures.push_back(openClCFeature);
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_ext_fp16_local_atomic_load_store");
openclCFeatures.push_back(openClCFeature);
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_ext_fp16_local_atomic_load_store");
openclCFeatures.push_back(openClCFeature);
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_ext_fp16_global_atomic_min_max");
openclCFeatures.push_back(openClCFeature);
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_ext_fp16_global_atomic_min_max");
openclCFeatures.push_back(openClCFeature);
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_ext_fp16_local_atomic_min_max");
openclCFeatures.push_back(openClCFeature);
}
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_ext_fp16_local_atomic_min_max");
openclCFeatures.push_back(openClCFeature);
auto forceFp64Support = debugManager.flags.OverrideDefaultFP64Settings.get();
if ((hwInfo.capabilityTable.ftrSupportsFP64 && (forceFp64Support == -1)) ||
@@ -92,19 +90,17 @@ void getOpenclCFeaturesList(const HardwareInfo &hwInfo, OpenClCFeaturesContainer
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_fp64");
openclCFeatures.push_back(openClCFeature);
if (hwInfo.capabilityTable.supportsOcl21Features) {
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_ext_fp64_global_atomic_add");
openclCFeatures.push_back(openClCFeature);
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_ext_fp64_global_atomic_add");
openclCFeatures.push_back(openClCFeature);
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_ext_fp64_local_atomic_add");
openclCFeatures.push_back(openClCFeature);
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_ext_fp64_local_atomic_add");
openclCFeatures.push_back(openClCFeature);
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_ext_fp64_global_atomic_min_max");
openclCFeatures.push_back(openClCFeature);
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_ext_fp64_global_atomic_min_max");
openclCFeatures.push_back(openClCFeature);
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_ext_fp64_local_atomic_min_max");
openclCFeatures.push_back(openClCFeature);
}
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_ext_fp64_local_atomic_min_max");
openclCFeatures.push_back(openClCFeature);
}
if (compilerProductHelper.isDotIntegerProductExtensionSupported()) {
strcpy_s(openClCFeature.name, CL_NAME_VERSION_MAX_NAME_SIZE, "__opencl_c_integer_dot_product_input_4x8bit");

View File

@@ -59,7 +59,6 @@ const RuntimeCapabilityTable ADLN::capabilityTable{
.instrumentationEnabled = true,
.supportCacheFlushAfterWalker = false,
.supportsImages = true,
.supportsOcl21Features = true,
.supportsOnDemandPageFaults = false,
.supportsIndependentForwardProgress = false,
.isIntegratedDevice = true,

View File

@@ -59,7 +59,6 @@ const RuntimeCapabilityTable ADLP::capabilityTable{
.instrumentationEnabled = true,
.supportCacheFlushAfterWalker = false,
.supportsImages = true,
.supportsOcl21Features = true,
.supportsOnDemandPageFaults = false,
.supportsIndependentForwardProgress = false,
.isIntegratedDevice = true,

View File

@@ -59,7 +59,6 @@ const RuntimeCapabilityTable ADLS::capabilityTable{
.instrumentationEnabled = true,
.supportCacheFlushAfterWalker = false,
.supportsImages = true,
.supportsOcl21Features = true,
.supportsOnDemandPageFaults = false,
.supportsIndependentForwardProgress = false,
.isIntegratedDevice = true,

View File

@@ -59,7 +59,6 @@ const RuntimeCapabilityTable DG1::capabilityTable{
.instrumentationEnabled = true,
.supportCacheFlushAfterWalker = true,
.supportsImages = true,
.supportsOcl21Features = true,
.supportsOnDemandPageFaults = false,
.supportsIndependentForwardProgress = false,
.isIntegratedDevice = false,

View File

@@ -59,7 +59,6 @@ const RuntimeCapabilityTable RKL::capabilityTable{
.instrumentationEnabled = true,
.supportCacheFlushAfterWalker = false,
.supportsImages = true,
.supportsOcl21Features = true,
.supportsOnDemandPageFaults = false,
.supportsIndependentForwardProgress = false,
.isIntegratedDevice = true,

View File

@@ -59,7 +59,6 @@ const RuntimeCapabilityTable TGLLP::capabilityTable{
.instrumentationEnabled = true,
.supportCacheFlushAfterWalker = false,
.supportsImages = true,
.supportsOcl21Features = true,
.supportsOnDemandPageFaults = false,
.supportsIndependentForwardProgress = false,
.isIntegratedDevice = true,

View File

@@ -46,7 +46,6 @@ struct RuntimeCapabilityTable {
bool instrumentationEnabled;
bool supportCacheFlushAfterWalker;
bool supportsImages;
bool supportsOcl21Features;
bool supportsOnDemandPageFaults;
bool supportsIndependentForwardProgress;
bool isIntegratedDevice;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Intel Corporation
* Copyright (C) 2024-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -14,7 +14,8 @@ namespace NEO {
bool HwInfoHelper::checkIfOcl21FeaturesEnabledOrEnforced(const HardwareInfo &hwInfo) {
bool enabledOrEnforced = hwInfo.capabilityTable.supportsOcl21Features;
bool enabledOrEnforced = true;
if (const auto enforcedOclVersion = debugManager.flags.ForceOCLVersion.get(); enforcedOclVersion != 0) {
enabledOrEnforced = (enforcedOclVersion == 21);
}

View File

@@ -62,7 +62,6 @@ const RuntimeCapabilityTable BMG::capabilityTable{
.instrumentationEnabled = true,
.supportCacheFlushAfterWalker = false,
.supportsImages = true,
.supportsOcl21Features = true,
.supportsOnDemandPageFaults = true,
.supportsIndependentForwardProgress = true,
.isIntegratedDevice = false,

View File

@@ -60,7 +60,6 @@ const RuntimeCapabilityTable LNL::capabilityTable{
.instrumentationEnabled = true,
.supportCacheFlushAfterWalker = false,
.supportsImages = true,
.supportsOcl21Features = true,
.supportsOnDemandPageFaults = true,
.supportsIndependentForwardProgress = true,
.isIntegratedDevice = true,

View File

@@ -61,7 +61,6 @@ const RuntimeCapabilityTable PTL::capabilityTable{
.instrumentationEnabled = true,
.supportCacheFlushAfterWalker = false,
.supportsImages = true,
.supportsOcl21Features = true,
.supportsOnDemandPageFaults = true,
.supportsIndependentForwardProgress = true,
.isIntegratedDevice = true,

View File

@@ -72,7 +72,6 @@ const RuntimeCapabilityTable PVC::capabilityTable{
.instrumentationEnabled = true,
.supportCacheFlushAfterWalker = false,
.supportsImages = false,
.supportsOcl21Features = true,
.supportsOnDemandPageFaults = false,
.supportsIndependentForwardProgress = true,
.isIntegratedDevice = false,

View File

@@ -57,7 +57,6 @@ const RuntimeCapabilityTable ARL::capabilityTable{
.instrumentationEnabled = true,
.supportCacheFlushAfterWalker = true,
.supportsImages = true,
.supportsOcl21Features = true,
.supportsOnDemandPageFaults = false,
.supportsIndependentForwardProgress = false,
.isIntegratedDevice = true,

View File

@@ -63,7 +63,6 @@ const RuntimeCapabilityTable DG2::capabilityTable{
.instrumentationEnabled = true,
.supportCacheFlushAfterWalker = true,
.supportsImages = true,
.supportsOcl21Features = true,
.supportsOnDemandPageFaults = false,
.supportsIndependentForwardProgress = false,
.isIntegratedDevice = false,

View File

@@ -59,7 +59,6 @@ const RuntimeCapabilityTable MTL::capabilityTable{
.instrumentationEnabled = true,
.supportCacheFlushAfterWalker = true,
.supportsImages = true,
.supportsOcl21Features = true,
.supportsOnDemandPageFaults = false,
.supportsIndependentForwardProgress = false,
.isIntegratedDevice = true,