Correct Read-Write Images support

Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
This commit is contained in:
Filip Hazubski 2021-01-18 14:53:47 +00:00 committed by Compute-Runtime-Automation
parent 24a88d22aa
commit d0033dadb3
4 changed files with 6 additions and 17 deletions

View File

@ -255,7 +255,7 @@ void ClDevice::initializeCaps() {
deviceInfo.nativeVectorWidthFloat = 1; deviceInfo.nativeVectorWidthFloat = 1;
deviceInfo.nativeVectorWidthDouble = 1; deviceInfo.nativeVectorWidthDouble = 1;
deviceInfo.nativeVectorWidthHalf = 8; deviceInfo.nativeVectorWidthHalf = 8;
deviceInfo.maxReadWriteImageArgs = ocl21FeaturesEnabled ? 128 : 0; deviceInfo.maxReadWriteImageArgs = hwInfo.capabilityTable.supportsImages ? 128 : 0;
deviceInfo.executionCapabilities = CL_EXEC_KERNEL; deviceInfo.executionCapabilities = CL_EXEC_KERNEL;
//copy system info to prevent misaligned reads //copy system info to prevent misaligned reads

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2017-2020 Intel Corporation * Copyright (C) 2017-2021 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@ -315,13 +315,6 @@ cl_int Context::getSupportedImageFormats(
cl_uint *numImageFormatsReturned) { cl_uint *numImageFormatsReturned) {
size_t numImageFormats = 0; size_t numImageFormats = 0;
if (isValueSet(CL_MEM_KERNEL_READ_AND_WRITE, flags) && device->getSpecializedDevice<ClDevice>()->areOcl21FeaturesEnabled() == false) {
if (numImageFormatsReturned) {
*numImageFormatsReturned = static_cast<cl_uint>(numImageFormats);
}
return CL_SUCCESS;
}
const bool nv12ExtensionEnabled = device->getSpecializedDevice<ClDevice>()->getDeviceInfo().nv12Extension; const bool nv12ExtensionEnabled = device->getSpecializedDevice<ClDevice>()->getDeviceInfo().nv12Extension;
const bool packedYuvExtensionEnabled = device->getSpecializedDevice<ClDevice>()->getDeviceInfo().packedYuvExtension; const bool packedYuvExtensionEnabled = device->getSpecializedDevice<ClDevice>()->getDeviceInfo().packedYuvExtension;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2017-2020 Intel Corporation * Copyright (C) 2017-2021 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@ -93,11 +93,7 @@ TEST(clGetSupportedImageFormatsTest, givenPlatformNotSupportingReadWriteImagesWh
&numImageFormats); &numImageFormats);
EXPECT_EQ(CL_SUCCESS, retVal); EXPECT_EQ(CL_SUCCESS, retVal);
if (context->getDevice(0)->areOcl21FeaturesEnabled()) { EXPECT_GT(numImageFormats, 0u);
EXPECT_GT(numImageFormats, 0u);
} else {
EXPECT_EQ(0u, numImageFormats);
}
} }
TEST(clGetSupportedImageFormatsTest, givenPlatforNotSupportingImageAndNullPointerToNumFormatsWhenGettingSupportImageFormatsThenCLSuccessReturned) { TEST(clGetSupportedImageFormatsTest, givenPlatforNotSupportingImageAndNullPointerToNumFormatsWhenGettingSupportImageFormatsThenCLSuccessReturned) {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2017-2020 Intel Corporation * Copyright (C) 2017-2021 Intel Corporation
* *
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
* *
@ -170,7 +170,7 @@ TEST_F(DeviceGetCapsTest, WhenCreatingDeviceThenCapsArePopulatedCorrectly) {
EXPECT_LE(128u, sharedCaps.maxReadImageArgs); EXPECT_LE(128u, sharedCaps.maxReadImageArgs);
EXPECT_LE(128u, sharedCaps.maxWriteImageArgs); EXPECT_LE(128u, sharedCaps.maxWriteImageArgs);
if (device->areOcl21FeaturesEnabled()) { if (defaultHwInfo->capabilityTable.supportsImages) {
EXPECT_EQ(128u, caps.maxReadWriteImageArgs); EXPECT_EQ(128u, caps.maxReadWriteImageArgs);
} else { } else {
EXPECT_EQ(0u, caps.maxReadWriteImageArgs); EXPECT_EQ(0u, caps.maxReadWriteImageArgs);