Correct image format reporting for OCL 1.2

Change-Id: Ia2160248d1cda6c13219598f8962aa3372885b9a
Signed-off-by: Koska <andrzej.koska@intel.com>
Related-To: NEO-3981
This commit is contained in:
Koska
2020-01-10 09:48:09 +01:00
committed by sys_ocldev
parent 5f4f1eb55a
commit 004ea3946d
57 changed files with 257 additions and 202 deletions

View File

@@ -558,7 +558,7 @@ TEST_F(PerformanceHintTest, givenCompressedImageWhenItsCreatedThenProperPerforma
imageDesc.image_slice_pitch = 0;
cl_mem_flags flags = CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR;
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport);
auto image = std::unique_ptr<Image>(Image::create(
context.get(),
@@ -617,7 +617,7 @@ TEST_F(PerformanceHintTest, givenImageWithNoGmmWhenItsCreatedThenNoPerformanceHi
imageDesc.image_slice_pitch = 0;
cl_mem_flags flags = CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR;
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport);
auto image = std::unique_ptr<Image>(Image::create(
context.get(),
@@ -678,7 +678,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);
auto surfaceFormat = Image::getSurfaceFormatFromTable(flags, &imageFormat, context->getDevice(0)->getHardwareInfo().capabilityTable.clVersionSupport);
auto image = std::unique_ptr<Image>(Image::create(
context.get(),

View File

@@ -136,7 +136,7 @@ TEST_P(GetSupportedImageFormatsTest, retrieveImageFormatsSRGB) {
}
}
if (isReadOnly) {
if (isReadOnly && ((&castToObject<ClDevice>(devices[0])->getDevice())->getHardwareInfo().capabilityTable.clVersionSupport >= 20)) {
EXPECT_TRUE(sRGBAFormatFound & sBGRAFormatFound);
} else {
EXPECT_FALSE(sRGBAFormatFound | sBGRAFormatFound);
@@ -146,7 +146,7 @@ TEST_P(GetSupportedImageFormatsTest, retrieveImageFormatsSRGB) {
}
TEST(ImageFormats, isDepthFormat) {
for (auto &format : SurfaceFormats::readOnly()) {
for (auto &format : SurfaceFormats::readOnly20()) {
EXPECT_FALSE(Image::isDepthFormat(format.OCLImageFormat));
}
@@ -276,7 +276,9 @@ TEST_P(NV12ExtensionSupportedImageFormatsTest, givenNV12ExtensionWhenQueriedForI
nullptr,
&numImageFormats);
size_t expectedNumReadOnlyFormats = SurfaceFormats::readOnly().size();
unsigned int clVersionSupport = device.get()->getHardwareInfo().capabilityTable.clVersionSupport;
size_t expectedNumReadOnlyFormats = (clVersionSupport >= 20) ? SurfaceFormats::readOnly20().size() : SurfaceFormats::readOnly12().size();
if (Image::isImage2dOr2dArray(imageFormats) && imageFormatsFlags == CL_MEM_READ_ONLY) {
expectedNumReadOnlyFormats += SurfaceFormats::readOnlyDepth().size();
}