Correct Read-Write Images support
Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
This commit is contained in:
parent
24a88d22aa
commit
d0033dadb3
|
@ -255,7 +255,7 @@ void ClDevice::initializeCaps() {
|
|||
deviceInfo.nativeVectorWidthFloat = 1;
|
||||
deviceInfo.nativeVectorWidthDouble = 1;
|
||||
deviceInfo.nativeVectorWidthHalf = 8;
|
||||
deviceInfo.maxReadWriteImageArgs = ocl21FeaturesEnabled ? 128 : 0;
|
||||
deviceInfo.maxReadWriteImageArgs = hwInfo.capabilityTable.supportsImages ? 128 : 0;
|
||||
deviceInfo.executionCapabilities = CL_EXEC_KERNEL;
|
||||
|
||||
//copy system info to prevent misaligned reads
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2017-2020 Intel Corporation
|
||||
* Copyright (C) 2017-2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
|
@ -315,13 +315,6 @@ cl_int Context::getSupportedImageFormats(
|
|||
cl_uint *numImageFormatsReturned) {
|
||||
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 packedYuvExtensionEnabled = device->getSpecializedDevice<ClDevice>()->getDeviceInfo().packedYuvExtension;
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2017-2020 Intel Corporation
|
||||
* Copyright (C) 2017-2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
|
@ -93,11 +93,7 @@ TEST(clGetSupportedImageFormatsTest, givenPlatformNotSupportingReadWriteImagesWh
|
|||
&numImageFormats);
|
||||
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
if (context->getDevice(0)->areOcl21FeaturesEnabled()) {
|
||||
EXPECT_GT(numImageFormats, 0u);
|
||||
} else {
|
||||
EXPECT_EQ(0u, numImageFormats);
|
||||
}
|
||||
EXPECT_GT(numImageFormats, 0u);
|
||||
}
|
||||
|
||||
TEST(clGetSupportedImageFormatsTest, givenPlatforNotSupportingImageAndNullPointerToNumFormatsWhenGettingSupportImageFormatsThenCLSuccessReturned) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2017-2020 Intel Corporation
|
||||
* Copyright (C) 2017-2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
|
@ -170,7 +170,7 @@ TEST_F(DeviceGetCapsTest, WhenCreatingDeviceThenCapsArePopulatedCorrectly) {
|
|||
|
||||
EXPECT_LE(128u, sharedCaps.maxReadImageArgs);
|
||||
EXPECT_LE(128u, sharedCaps.maxWriteImageArgs);
|
||||
if (device->areOcl21FeaturesEnabled()) {
|
||||
if (defaultHwInfo->capabilityTable.supportsImages) {
|
||||
EXPECT_EQ(128u, caps.maxReadWriteImageArgs);
|
||||
} else {
|
||||
EXPECT_EQ(0u, caps.maxReadWriteImageArgs);
|
||||
|
|
Loading…
Reference in New Issue