Remove duplicated fields from ClDeviceInfo

Related-To: NEO-3938

Change-Id: Ic13d69eaf2ba54794f82d78b058c960f27a6c29d
Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
This commit is contained in:
Filip Hazubski
2020-03-12 09:33:20 +01:00
committed by sys_ocldev
parent 196409f24c
commit 3b149b69a7
46 changed files with 371 additions and 430 deletions

View File

@ -276,7 +276,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, clCreateCommandQueueWithPropertiesApi, GivenNumberOf
EXPECT_EQ(retVal, CL_SUCCESS);
auto cmdq2 = clCreateCommandQueueWithProperties(pContext, devices[testedRootDeviceIndex], odq, &retVal);
if (pDevice->getDeviceInfo().maxOnDeviceQueues > 1) {
if (pDevice->getSharedDeviceInfo().maxOnDeviceQueues > 1) {
EXPECT_NE(nullptr, cmdq2);
EXPECT_EQ(retVal, CL_SUCCESS);
} else {

View File

@ -67,15 +67,17 @@ TEST_F(clCreateImageTest, GivenNullHostPtrWhenCreatingImageThenImageIsCreatedAnd
}
HWTEST_F(clCreateImageTest, GivenDeviceThatDoesntSupportImagesWhenCreatingTiledImageThenInvalidOperationErrorIsReturned) {
auto device = static_cast<MockClDevice *>(pContext->getDevice(0));
device->deviceInfo.imageSupport = CL_FALSE;
MockClDevice mockClDevice{MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0], 0)};
MockContext mockContext{&mockClDevice};
mockClDevice.sharedDeviceInfo.imageSupport = CL_FALSE;
cl_bool imageSupportInfo = CL_TRUE;
auto status = clGetDeviceInfo(devices[testedRootDeviceIndex], CL_DEVICE_IMAGE_SUPPORT, sizeof(imageSupportInfo), &imageSupportInfo, nullptr);
auto status = clGetDeviceInfo(&mockClDevice, CL_DEVICE_IMAGE_SUPPORT, sizeof(imageSupportInfo), &imageSupportInfo, nullptr);
EXPECT_EQ(CL_SUCCESS, status);
cl_bool expectedValue = CL_FALSE;
EXPECT_EQ(expectedValue, imageSupportInfo);
auto image = clCreateImage(
pContext,
&mockContext,
CL_MEM_READ_WRITE,
&imageFormat,
&imageDesc,
@ -94,10 +96,12 @@ HWTEST_F(clCreateImageTest, GivenDeviceThatDoesntSupportImagesWhenCreatingTiledI
}
HWTEST_F(clCreateImageTest, GivenDeviceThatDoesntSupportImagesWhenCreatingNonTiledImageThenCreate) {
auto device = static_cast<MockClDevice *>(pContext->getDevice(0));
device->deviceInfo.imageSupport = CL_FALSE;
MockClDevice mockClDevice{MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0], 0)};
MockContext mockContext{&mockClDevice};
mockClDevice.sharedDeviceInfo.imageSupport = CL_FALSE;
cl_bool imageSupportInfo = CL_TRUE;
auto status = clGetDeviceInfo(devices[testedRootDeviceIndex], CL_DEVICE_IMAGE_SUPPORT, sizeof(imageSupportInfo), &imageSupportInfo, nullptr);
auto status = clGetDeviceInfo(&mockClDevice, CL_DEVICE_IMAGE_SUPPORT, sizeof(imageSupportInfo), &imageSupportInfo, nullptr);
EXPECT_EQ(CL_SUCCESS, status);
cl_bool expectedValue = CL_FALSE;
EXPECT_EQ(expectedValue, imageSupportInfo);
@ -106,7 +110,7 @@ HWTEST_F(clCreateImageTest, GivenDeviceThatDoesntSupportImagesWhenCreatingNonTil
imageDesc.image_height = 1;
auto image = clCreateImage(
pContext,
&mockContext,
CL_MEM_READ_WRITE,
&imageFormat,
&imageDesc,

View File

@ -18,7 +18,7 @@ using namespace NEO;
typedef api_tests clGetSupportedImageFormatsTests;
TEST_F(clGetSupportedImageFormatsTests, GivenValidParamsWhenGettingSupportImageFormatsThenNumImageFormatsIsGreaterThanZero) {
if (!pContext->getDevice(0)->getDeviceInfo().imageSupport) {
if (!pContext->getDevice(0)->getSharedDeviceInfo().imageSupport) {
GTEST_SKIP();
}
cl_uint numImageFormats = 0;
@ -97,7 +97,7 @@ TEST(clGetSupportedImageFormatsTest, givenPlatformWithoutDevicesWhenClGetSupport
executionEnvironment->initializeMemoryManager();
executionEnvironment->prepareRootDeviceEnvironments(1);
auto device = std::make_unique<ClDevice>(*Device::create<RootDevice>(executionEnvironment, 0u), platform());
const ClDeviceInfo &devInfo = device->getDeviceInfo();
const DeviceInfo &devInfo = device->getSharedDeviceInfo();
if (!devInfo.imageSupport) {
GTEST_SKIP();
}

View File

@ -64,7 +64,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, clSetDefaultDeviceCommandQueueApiTest, GivenValidPar
0};
auto pDevice = castToObject<ClDevice>(devices[testedRootDeviceIndex]);
if (pDevice->getDeviceInfo().maxOnDeviceQueues > 1) {
if (pDevice->getSharedDeviceInfo().maxOnDeviceQueues > 1) {
auto newDeviceQueue = clCreateCommandQueueWithProperties(pContext, devices[testedRootDeviceIndex], properties, &retVal);
ASSERT_NE(nullptr, newDeviceQueue);
ASSERT_EQ(CL_SUCCESS, retVal);

View File

@ -100,7 +100,7 @@ TEST_F(clSetKernelArgSVMPointerTests, GivenLocalAddressAndNullArgValueWhenSettin
TEST_F(clSetKernelArgSVMPointerTests, GivenInvalidArgValueWhenSettingKernelArgThenInvalidArgValueErrorIsReturned) {
pClDevice->deviceInfo.sharedSystemMemCapabilities = 0u;
pClDevice->device.deviceInfo.sharedSystemAllocationsSupport = false;
pClDevice->sharedDeviceInfo.sharedSystemAllocationsSupport = false;
void *ptrHost = malloc(256);
EXPECT_NE(nullptr, ptrHost);
@ -182,7 +182,7 @@ TEST_F(clSetKernelArgSVMPointerTests, GivenSvmAndPointerWithOffsetWhenSettingKer
TEST_F(clSetKernelArgSVMPointerTests, GivenSvmAndPointerWithInvalidOffsetWhenSettingKernelArgThenInvalidArgValueErrorIsReturned) {
pClDevice->deviceInfo.sharedSystemMemCapabilities = 0u;
pClDevice->device.deviceInfo.sharedSystemAllocationsSupport = false;
pClDevice->sharedDeviceInfo.sharedSystemAllocationsSupport = false;
const ClDeviceInfo &devInfo = pClDevice->getDeviceInfo();
if (devInfo.svmCapabilities != 0) {
void *ptrSvm = clSVMAlloc(pContext, CL_MEM_READ_WRITE, 256, 4);

View File

@ -84,7 +84,7 @@ TEST(clUnifiedSharedMemoryTests, whenClDeviceMemAllocIntelIsCalledThenItAllocate
TEST(clUnifiedSharedMemoryTests, whenUnifiedSharedMemoryAllocationCallsAreCalledWithSizeGreaterThenMaxMemAllocSizeThenErrorIsReturned) {
MockContext mockContext;
cl_int retVal = CL_SUCCESS;
auto maxMemAllocSize = mockContext.getDevice(0u)->getDeviceInfo().maxMemAllocSize;
auto maxMemAllocSize = mockContext.getDevice(0u)->getSharedDeviceInfo().maxMemAllocSize;
size_t requestedSize = static_cast<size_t>(maxMemAllocSize) + 1u;
auto unfiedMemoryDeviceAllocation = clDeviceMemAllocINTEL(&mockContext, mockContext.getDevice(0u), nullptr, requestedSize, 0, &retVal);