refactor: Rename member variables to camelCase

Signed-off-by: Fabian Zwolinski <fabian.zwolinski@intel.com>
This commit is contained in:
Fabian Zwolinski
2023-04-26 10:13:07 +00:00
committed by Compute-Runtime-Automation
parent 5adc1816ff
commit c441e9e971
64 changed files with 1192 additions and 1192 deletions

View File

@@ -22,7 +22,7 @@ struct SamplerWithPropertiesTest : public ApiFixture<>,
}
void SetUp() override {
std::tie(NormalizdProperties, AddressingProperties, FilterProperties) = GetParam();
std::tie(normalizdProperties, addressingProperties, filterProperties) = GetParam();
ApiFixture::setUp();
}
@@ -30,9 +30,9 @@ struct SamplerWithPropertiesTest : public ApiFixture<>,
ApiFixture::tearDown();
}
cl_sampler_properties NormalizdProperties = 0;
cl_sampler_properties AddressingProperties = 0;
cl_sampler_properties FilterProperties = 0;
cl_sampler_properties normalizdProperties = 0;
cl_sampler_properties addressingProperties = 0;
cl_sampler_properties filterProperties = 0;
};
using ClCreateSamplerWithPropertiesTests = ApiTests;
@@ -124,19 +124,19 @@ TEST_P(ClCreateSamplerWithPropertiesTests2, GivenCorrectParametersWhenCreatingSa
0};
cl_queue_properties *pProp = &properties[0];
if (NormalizdProperties) {
if (normalizdProperties) {
*pProp++ = CL_SAMPLER_NORMALIZED_COORDS;
*pProp++ = (cl_queue_properties)NormalizdProperties;
*pProp++ = (cl_queue_properties)normalizdProperties;
}
if (AddressingProperties) {
if (addressingProperties) {
*pProp++ = CL_SAMPLER_ADDRESSING_MODE;
*pProp++ = (cl_queue_properties)AddressingProperties;
*pProp++ = (cl_queue_properties)addressingProperties;
}
if (FilterProperties) {
if (filterProperties) {
*pProp++ = CL_SAMPLER_FILTER_MODE;
*pProp++ = (cl_queue_properties)FilterProperties;
*pProp++ = (cl_queue_properties)filterProperties;
}
*pProp++ = 0;
@@ -161,11 +161,11 @@ TEST_P(ClCreateSamplerWithPropertiesTests2, GivenInvalidPropertiesWhenCreatingSa
0};
cl_queue_properties *pProp = &properties[0];
if (NormalizdProperties) {
if (normalizdProperties) {
*pProp++ = CL_SAMPLER_NORMALIZED_COORDS;
*pProp++ = (cl_queue_properties)NormalizdProperties;
*pProp++ = (cl_queue_properties)normalizdProperties;
*pProp++ = CL_SAMPLER_NORMALIZED_COORDS;
*pProp++ = (cl_queue_properties)NormalizdProperties;
*pProp++ = (cl_queue_properties)normalizdProperties;
*pProp++ = 0;
@@ -178,11 +178,11 @@ TEST_P(ClCreateSamplerWithPropertiesTests2, GivenInvalidPropertiesWhenCreatingSa
}
pProp = &properties[0];
if (AddressingProperties) {
if (addressingProperties) {
*pProp++ = CL_SAMPLER_ADDRESSING_MODE;
*pProp++ = (cl_queue_properties)AddressingProperties;
*pProp++ = (cl_queue_properties)addressingProperties;
*pProp++ = CL_SAMPLER_ADDRESSING_MODE;
*pProp++ = (cl_queue_properties)AddressingProperties;
*pProp++ = (cl_queue_properties)addressingProperties;
*pProp++ = 0;
@@ -195,11 +195,11 @@ TEST_P(ClCreateSamplerWithPropertiesTests2, GivenInvalidPropertiesWhenCreatingSa
}
pProp = &properties[0];
if (FilterProperties) {
if (filterProperties) {
*pProp++ = CL_SAMPLER_FILTER_MODE;
*pProp++ = (cl_queue_properties)FilterProperties;
*pProp++ = (cl_queue_properties)filterProperties;
*pProp++ = CL_SAMPLER_FILTER_MODE;
*pProp++ = (cl_queue_properties)FilterProperties;
*pProp++ = (cl_queue_properties)filterProperties;
*pProp++ = 0;
@@ -212,13 +212,13 @@ TEST_P(ClCreateSamplerWithPropertiesTests2, GivenInvalidPropertiesWhenCreatingSa
}
}
static cl_sampler_properties NormalizdProperties[] =
static cl_sampler_properties normalizdProperties[] =
{
CL_TRUE,
CL_FALSE,
};
static cl_sampler_properties AddressingProperties[] =
static cl_sampler_properties addressingProperties[] =
{
CL_ADDRESS_NONE,
CL_ADDRESS_CLAMP_TO_EDGE,
@@ -227,7 +227,7 @@ static cl_sampler_properties AddressingProperties[] =
CL_ADDRESS_MIRRORED_REPEAT,
};
static cl_sampler_properties FilterProperties[] =
static cl_sampler_properties filterProperties[] =
{
CL_FILTER_NEAREST,
CL_FILTER_LINEAR,
@@ -236,9 +236,9 @@ static cl_sampler_properties FilterProperties[] =
INSTANTIATE_TEST_CASE_P(api,
ClCreateSamplerWithPropertiesTests2,
::testing::Combine(
::testing::ValuesIn(NormalizdProperties),
::testing::ValuesIn(AddressingProperties),
::testing::ValuesIn(FilterProperties)));
::testing::ValuesIn(normalizdProperties),
::testing::ValuesIn(addressingProperties),
::testing::ValuesIn(filterProperties)));
TEST_F(ClCreateSamplerWithPropertiesTests, GivenMipMapDataWhenCreatingSamplerWithPropertiesThenSamplerIsCreatedAndCorrectlyPopulated) {
SamplerLodProperty minLodProperty;

View File

@@ -141,7 +141,7 @@ class EnqueueMapBufferFlagsTest : public ApiFixture<>,
protected:
void SetUp() override {
ApiFixture::setUp();
buffer_flags = GetParam();
bufferFlags = GetParam();
unsigned int bufferSize = 16;
pHostMem = new unsigned char[bufferSize];
@@ -149,7 +149,7 @@ class EnqueueMapBufferFlagsTest : public ApiFixture<>,
buffer = clCreateBuffer(
pContext,
buffer_flags,
bufferFlags,
bufferSize,
pHostMem,
&retVal);
@@ -165,7 +165,7 @@ class EnqueueMapBufferFlagsTest : public ApiFixture<>,
}
cl_int retVal = CL_SUCCESS;
cl_mem_flags buffer_flags = 0;
cl_mem_flags bufferFlags = 0;
unsigned char *pHostMem;
cl_mem buffer;
};

View File

@@ -274,7 +274,7 @@ class EnqueueReadBufferRectFlagsTest : public ApiFixture<>,
protected:
void SetUp() override {
ApiFixture::setUp();
buffer_flags = GetParam();
bufferFlags = GetParam();
unsigned int bufferSize = 16;
pHostMem = new unsigned char[bufferSize];
@@ -282,7 +282,7 @@ class EnqueueReadBufferRectFlagsTest : public ApiFixture<>,
buffer = clCreateBuffer(
pContext,
buffer_flags,
bufferFlags,
bufferSize,
pHostMem,
&retVal);
@@ -298,7 +298,7 @@ class EnqueueReadBufferRectFlagsTest : public ApiFixture<>,
}
cl_int retVal = CL_SUCCESS;
cl_mem_flags buffer_flags = 0;
cl_mem_flags bufferFlags = 0;
unsigned char *pHostMem;
cl_mem buffer;
};

View File

@@ -77,7 +77,7 @@ class EnqueueReadBufferFlagsTest : public ApiFixture<>,
protected:
void SetUp() override {
ApiFixture::setUp();
buffer_flags = GetParam();
bufferFlags = GetParam();
unsigned int bufferSize = 16;
pHostMem = new unsigned char[bufferSize];
@@ -85,7 +85,7 @@ class EnqueueReadBufferFlagsTest : public ApiFixture<>,
buffer = clCreateBuffer(
pContext,
buffer_flags,
bufferFlags,
bufferSize,
pHostMem,
&retVal);
@@ -101,7 +101,7 @@ class EnqueueReadBufferFlagsTest : public ApiFixture<>,
}
cl_int retVal = CL_SUCCESS;
cl_mem_flags buffer_flags = 0;
cl_mem_flags bufferFlags = 0;
unsigned char *pHostMem;
cl_mem buffer;
};

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2022 Intel Corporation
* Copyright (C) 2018-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -285,7 +285,7 @@ class ClEventProfilingWithPerfCountersTests : public DeviceInstrumentationFixtur
event = std::make_unique<Event>(commandQueue.get(), 0, 0, 0);
event->setStatus(CL_COMPLETE);
event->setProfilingEnabled(true);
commandQueue->getPerfCounters()->getApiReport(event->getHwPerfCounterNode(), 0, nullptr, &param_value_size, true);
commandQueue->getPerfCounters()->getApiReport(event->getHwPerfCounterNode(), 0, nullptr, &paramValueSize, true);
eventCl = static_cast<cl_event>(event.get());
}
@@ -297,19 +297,19 @@ class ClEventProfilingWithPerfCountersTests : public DeviceInstrumentationFixtur
std::unique_ptr<Context> context;
std::unique_ptr<CommandQueue> commandQueue;
std::unique_ptr<Event> event;
size_t param_value_size = 0;
size_t paramValueSize = 0;
cl_event eventCl = nullptr;
cl_ulong param_value = 0;
size_t param_value_size_ret = 0;
cl_ulong paramValue = 0;
size_t paramValueSizeRet = 0;
};
TEST_F(ClEventProfilingWithPerfCountersTests, GivenDisabledPerfCountersWhenGettingEventProfilingInfoThenInvalidValueErrorIsReturned) {
event->setPerfCountersEnabled(false);
cl_int retVal = clGetEventProfilingInfo(eventCl,
CL_PROFILING_COMMAND_PERFCOUNTERS_INTEL,
param_value_size,
&param_value,
&param_value_size_ret);
paramValueSize,
&paramValue,
&paramValueSizeRet);
EXPECT_EQ(CL_INVALID_VALUE, retVal);
}
@@ -317,9 +317,9 @@ TEST_F(ClEventProfilingWithPerfCountersTests, GivenEnabledPerfCountersWhenGettin
event->setPerfCountersEnabled(true);
cl_int retVal = clGetEventProfilingInfo(eventCl,
CL_PROFILING_COMMAND_PERFCOUNTERS_INTEL,
param_value_size,
&param_value,
&param_value_size_ret);
paramValueSize,
&paramValue,
&paramValueSizeRet);
EXPECT_EQ(CL_SUCCESS, retVal);
}
@@ -327,8 +327,8 @@ TEST_F(ClEventProfilingWithPerfCountersTests, GivenEnabledPerfCountersAndIncorre
event->setPerfCountersEnabled(true);
cl_int retVal = clGetEventProfilingInfo(eventCl,
CL_PROFILING_COMMAND_PERFCOUNTERS_INTEL,
param_value_size - 1,
&param_value,
&param_value_size_ret);
paramValueSize - 1,
&paramValue,
&paramValueSizeRet);
EXPECT_EQ(CL_PROFILING_INFO_NOT_AVAILABLE, retVal);
}

View File

@@ -14,10 +14,10 @@ struct KernelSubGroupInfoKhrFixture : HelloWorldFixture<HelloWorldFixtureFactory
void setUp() {
ParentClass::setUp();
MaxSimdSize = static_cast<size_t>(pKernel->getKernelInfo().getMaxSimdSize());
ASSERT_GE(MaxSimdSize, 8u);
MaxWorkDim = static_cast<size_t>(pClDevice->getDeviceInfo().maxWorkItemDimensions);
ASSERT_EQ(MaxWorkDim, 3u);
maxSimdSize = static_cast<size_t>(pKernel->getKernelInfo().getMaxSimdSize());
ASSERT_GE(maxSimdSize, 8u);
maxWorkDim = static_cast<size_t>(pClDevice->getDeviceInfo().maxWorkItemDimensions);
ASSERT_EQ(maxWorkDim, 3u);
}
void tearDown() {
@@ -27,9 +27,9 @@ struct KernelSubGroupInfoKhrFixture : HelloWorldFixture<HelloWorldFixtureFactory
size_t inputValue[3];
size_t paramValue;
size_t paramValueSizeRet;
size_t MaxSimdSize;
size_t CalculatedWGS;
size_t MaxWorkDim;
size_t maxSimdSize;
size_t calculatedWGS;
size_t maxWorkDim;
};
namespace ULT {
@@ -86,7 +86,7 @@ TEST_P(KernelSubGroupInfoKhrReturnSizeTest, GivenLwsParameterWhenGettingMaxSubGr
EXPECT_EQ(retVal, CL_SUCCESS);
EXPECT_EQ(paramValueSizeRet, sizeof(size_t));
EXPECT_EQ(paramValue, MaxSimdSize);
EXPECT_EQ(paramValue, maxSimdSize);
}
typedef KernelSubGroupInfoKhrParamFixture<TestParam> KernelSubGroupInfoKhrReturnCountTest;
@@ -100,7 +100,7 @@ TEST_P(KernelSubGroupInfoKhrReturnCountTest, GivenLwsParameterWhenGettingSubGrou
inputValue[0] = GetParam().gwsX;
inputValue[1] = GetParam().gwsY;
inputValue[2] = GetParam().gwsZ;
CalculatedWGS = inputValue[0] * inputValue[1] * inputValue[2];
calculatedWGS = inputValue[0] * inputValue[1] * inputValue[2];
retVal = clGetKernelSubGroupInfoKHR(
pMultiDeviceKernel,
@@ -115,10 +115,10 @@ TEST_P(KernelSubGroupInfoKhrReturnCountTest, GivenLwsParameterWhenGettingSubGrou
EXPECT_EQ(retVal, CL_SUCCESS);
EXPECT_EQ(paramValueSizeRet, sizeof(size_t));
if (CalculatedWGS % MaxSimdSize == 0) {
EXPECT_EQ(paramValue, CalculatedWGS / MaxSimdSize);
if (calculatedWGS % maxSimdSize == 0) {
EXPECT_EQ(paramValue, calculatedWGS / maxSimdSize);
} else {
EXPECT_EQ(paramValue, (CalculatedWGS / MaxSimdSize) + 1);
EXPECT_EQ(paramValue, (calculatedWGS / maxSimdSize) + 1);
}
}
@@ -249,7 +249,7 @@ TEST_P(KernelSubGroupInfoKhrInputParamsTest, GivenInvalidInputWhenGettingKernelS
pMultiDeviceKernel,
pClDevice,
GetParam(),
(sizeof(size_t) * MaxWorkDim) - 1,
(sizeof(size_t) * maxWorkDim) - 1,
inputValue,
0,
nullptr,
@@ -257,12 +257,12 @@ TEST_P(KernelSubGroupInfoKhrInputParamsTest, GivenInvalidInputWhenGettingKernelS
EXPECT_EQ(retVal, CL_INVALID_VALUE);
// work dim > MaxWorkDim
// work dim > maxWorkDim
retVal = clGetKernelSubGroupInfoKHR(
pMultiDeviceKernel,
pClDevice,
GetParam(),
sizeof(size_t) * (MaxWorkDim + 1),
sizeof(size_t) * (maxWorkDim + 1),
inputValue,
0,
nullptr,
@@ -275,7 +275,7 @@ TEST_P(KernelSubGroupInfoKhrInputParamsTest, GivenInvalidInputWhenGettingKernelS
pMultiDeviceKernel,
pClDevice,
GetParam(),
sizeof(size_t) * (MaxWorkDim),
sizeof(size_t) * (maxWorkDim),
nullptr,
0,
nullptr,

View File

@@ -112,7 +112,7 @@ struct IntelAcceleratorGetInfoTest : IntelAcceleratorTestWithValidDescriptor {
}
protected:
size_t param_value_size_ret = 0;
size_t paramValueSizeRet = 0;
};
TEST_F(IntelAcceleratorTest, GivenNullAcceleratorWhenGettingAcceleratorInfoThenClInvalidAcceleratorIntelErrorIsReturned) {
@@ -154,10 +154,10 @@ TEST_F(IntelAcceleratorGetInfoTest, GivenClAcceleratorReferenceCountIntelWhenGet
CL_ACCELERATOR_REFERENCE_COUNT_INTEL,
sizeof(cl_uint),
nullptr,
&param_value_size_ret);
&paramValueSizeRet);
EXPECT_EQ(CL_SUCCESS, result);
EXPECT_EQ(sizeof(cl_uint), param_value_size_ret);
EXPECT_EQ(sizeof(cl_uint), paramValueSizeRet);
}
TEST_F(IntelAcceleratorGetInfoTest, GivenClAcceleratorReferenceCountIntelWhenGettingAcceleratorInfoThenParamValueIsOne) {
@@ -182,10 +182,10 @@ TEST_F(IntelAcceleratorGetInfoTest, GivenLongForDescriptorSizeWhenGettingAcceler
CL_ACCELERATOR_REFERENCE_COUNT_INTEL,
sizeof(cl_uint) + 1,
&paramValue,
&param_value_size_ret);
&paramValueSizeRet);
EXPECT_EQ(CL_SUCCESS, result);
EXPECT_EQ(sizeof(cl_uint), param_value_size_ret);
EXPECT_EQ(sizeof(cl_uint), paramValueSizeRet);
EXPECT_EQ(1u, paramValue);
}
@@ -197,7 +197,7 @@ TEST_F(IntelAcceleratorGetInfoTest, GivenShortForDescriptorSizeWhenGettingAccele
CL_ACCELERATOR_REFERENCE_COUNT_INTEL,
sizeof(cl_uint) - 1,
&paramValue,
&param_value_size_ret);
&paramValueSizeRet);
EXPECT_EQ(CL_INVALID_VALUE, result);
}
@@ -208,10 +208,10 @@ TEST_F(IntelAcceleratorGetInfoTest, GivenZeroForDescriptorSizeGivenLongForDescri
CL_ACCELERATOR_REFERENCE_COUNT_INTEL,
0,
nullptr,
&param_value_size_ret);
&paramValueSizeRet);
EXPECT_EQ(CL_SUCCESS, result);
EXPECT_EQ(sizeof(cl_uint), param_value_size_ret);
EXPECT_EQ(sizeof(cl_uint), paramValueSizeRet);
}
TEST_F(IntelAcceleratorGetInfoTest, GivenCallToRetainAcceleratorWhenGettingAcceleratorInfoThenParamValueIsTwo) {
@@ -225,7 +225,7 @@ TEST_F(IntelAcceleratorGetInfoTest, GivenCallToRetainAcceleratorWhenGettingAccel
CL_ACCELERATOR_REFERENCE_COUNT_INTEL,
sizeof(cl_uint),
&paramValue,
&param_value_size_ret);
&paramValueSizeRet);
EXPECT_EQ(CL_SUCCESS, result);
EXPECT_EQ(2u, paramValue);
@@ -239,7 +239,7 @@ TEST_F(IntelAcceleratorGetInfoTest, GivenCallToRetainAcceleratorWhenGettingAccel
CL_ACCELERATOR_REFERENCE_COUNT_INTEL,
sizeof(cl_uint),
&paramValue,
&param_value_size_ret);
&paramValueSizeRet);
EXPECT_EQ(CL_SUCCESS, result);
EXPECT_EQ(1u, paramValue);
@@ -251,10 +251,10 @@ TEST_F(IntelAcceleratorGetInfoTest, GivenNullPtrForParamValueWhenGettingAccelera
CL_ACCELERATOR_CONTEXT_INTEL,
sizeof(cl_context),
nullptr,
&param_value_size_ret);
&paramValueSizeRet);
EXPECT_EQ(CL_SUCCESS, result);
EXPECT_EQ(sizeof(cl_context), param_value_size_ret);
EXPECT_EQ(sizeof(cl_context), paramValueSizeRet);
}
TEST_F(IntelAcceleratorGetInfoTest, GivenLongForDescriptorSizeWhenGettingAcceleratorContextInfoThenCorrectValuesAreReturned) {
@@ -265,10 +265,10 @@ TEST_F(IntelAcceleratorGetInfoTest, GivenLongForDescriptorSizeWhenGettingAcceler
CL_ACCELERATOR_CONTEXT_INTEL,
sizeof(cl_context) + 1,
&paramValue,
&param_value_size_ret);
&paramValueSizeRet);
EXPECT_EQ(CL_SUCCESS, result);
EXPECT_EQ(sizeof(cl_context), param_value_size_ret);
EXPECT_EQ(sizeof(cl_context), paramValueSizeRet);
}
TEST_F(IntelAcceleratorGetInfoTest, GivenAcceleratorContextIntelWhenGettingAcceleratorInfoThenCorrectValuesAreReturned) {
@@ -279,10 +279,10 @@ TEST_F(IntelAcceleratorGetInfoTest, GivenAcceleratorContextIntelWhenGettingAccel
CL_ACCELERATOR_CONTEXT_INTEL,
sizeof(cl_context),
&paramValue,
&param_value_size_ret);
&paramValueSizeRet);
EXPECT_EQ(CL_SUCCESS, result);
EXPECT_EQ(sizeof(cl_context), param_value_size_ret);
EXPECT_EQ(sizeof(cl_context), paramValueSizeRet);
cl_context referenceContext = static_cast<cl_context>(pContext);
EXPECT_EQ(referenceContext, paramValue);
@@ -296,7 +296,7 @@ TEST_F(IntelAcceleratorGetInfoTest, GivenShortForDescriptorSizeWhenGettingAccele
CL_ACCELERATOR_CONTEXT_INTEL,
sizeof(cl_context) - 1,
&paramValue,
&param_value_size_ret);
&paramValueSizeRet);
EXPECT_EQ(CL_INVALID_VALUE, result);
}
@@ -307,9 +307,9 @@ TEST_F(IntelAcceleratorGetInfoTest, GivenZeroForDescriptorSizeGivenLongForDescri
CL_ACCELERATOR_CONTEXT_INTEL,
0,
nullptr,
&param_value_size_ret);
&paramValueSizeRet);
EXPECT_EQ(CL_SUCCESS, result);
EXPECT_EQ(sizeof(cl_context), param_value_size_ret);
EXPECT_EQ(sizeof(cl_context), paramValueSizeRet);
}
} // namespace ULT

View File

@@ -207,8 +207,8 @@ TEST_F(IntelMotionEstimationTest, GivenValidAcceleratorWhenRetainingAndReleasing
struct IntelMotionEstimationGetInfoTest : public IntelMotionEstimationTest {
public:
IntelMotionEstimationGetInfoTest() : type_returned(static_cast<cl_accelerator_type_intel>(-1)),
param_value_size_ret(static_cast<size_t>(-1)) {}
IntelMotionEstimationGetInfoTest() : typeReturned(static_cast<cl_accelerator_type_intel>(-1)),
paramValueSizeRet(static_cast<size_t>(-1)) {}
void SetUp() override {
IntelMotionEstimationTest::SetUp();
@@ -238,8 +238,8 @@ struct IntelMotionEstimationGetInfoTest : public IntelMotionEstimationTest {
protected:
cl_motion_estimation_desc_intel descReturn;
cl_accelerator_type_intel type_returned;
size_t param_value_size_ret;
cl_accelerator_type_intel typeReturned;
size_t paramValueSizeRet;
};
TEST_F(IntelMotionEstimationGetInfoTest, GivenValidParamsWhenGettingAcceleratorInfoThenDescriptorContainsCorrectInformation) {
@@ -248,10 +248,10 @@ TEST_F(IntelMotionEstimationGetInfoTest, GivenValidParamsWhenGettingAcceleratorI
CL_ACCELERATOR_DESCRIPTOR_INTEL,
sizeof(cl_motion_estimation_desc_intel), // exact
&descReturn,
&param_value_size_ret);
&paramValueSizeRet);
EXPECT_EQ(CL_SUCCESS, result);
EXPECT_EQ(sizeof(cl_motion_estimation_desc_intel), param_value_size_ret);
EXPECT_EQ(sizeof(cl_motion_estimation_desc_intel), paramValueSizeRet);
EXPECT_EQ(static_cast<cl_uint>(CL_ME_MB_TYPE_16x16_INTEL), descReturn.mb_block_type);
EXPECT_EQ(static_cast<cl_uint>(CL_ME_SUBPIXEL_MODE_QPEL_INTEL), descReturn.subpixel_mode);
@@ -265,7 +265,7 @@ TEST_F(IntelMotionEstimationGetInfoTest, GivenTooShortDescriptorLengthWhenGettin
CL_ACCELERATOR_DESCRIPTOR_INTEL,
sizeof(cl_motion_estimation_desc_intel) - 1, // short
&descReturn,
&param_value_size_ret);
&paramValueSizeRet);
EXPECT_EQ(CL_INVALID_VALUE, result);
}
@@ -276,23 +276,23 @@ TEST_F(IntelMotionEstimationGetInfoTest, GivenDescriptorLengthZeroWhenGettingAcc
CL_ACCELERATOR_DESCRIPTOR_INTEL,
0,
&descReturn,
&param_value_size_ret);
&paramValueSizeRet);
EXPECT_EQ(CL_INVALID_VALUE, result);
}
TEST_F(IntelMotionEstimationGetInfoTest, GivenInvalidParametersWhenGettingAcceleratorInfoThenValueSizeRetIsNotUpdated) {
param_value_size_ret = 0x1234;
paramValueSizeRet = 0x1234;
result = clGetAcceleratorInfoINTEL(
accelerator,
CL_ACCELERATOR_DESCRIPTOR_INTEL,
0,
&descReturn,
&param_value_size_ret);
&paramValueSizeRet);
EXPECT_EQ(CL_INVALID_VALUE, result);
EXPECT_EQ(0x1234u, param_value_size_ret);
EXPECT_EQ(0x1234u, paramValueSizeRet);
}
TEST_F(IntelMotionEstimationGetInfoTest, GivenLongerDescriptorLengthWhenGettingAcceleratorInfoThenCorrectDescriptorLengthIsReturned) {
@@ -301,10 +301,10 @@ TEST_F(IntelMotionEstimationGetInfoTest, GivenLongerDescriptorLengthWhenGettingA
CL_ACCELERATOR_DESCRIPTOR_INTEL,
sizeof(cl_motion_estimation_desc_intel) + 1, // long
&descReturn,
&param_value_size_ret);
&paramValueSizeRet);
EXPECT_EQ(CL_SUCCESS, result);
EXPECT_EQ(sizeof(cl_motion_estimation_desc_intel), param_value_size_ret);
EXPECT_EQ(sizeof(cl_motion_estimation_desc_intel), paramValueSizeRet);
}
TEST_F(IntelMotionEstimationGetInfoTest, GivenDescriptorLengthZeroAndDescriptorNullWhenGettingAcceleratorInfoThenCorrectDescriptorLengthIsReturned) {
@@ -313,10 +313,10 @@ TEST_F(IntelMotionEstimationGetInfoTest, GivenDescriptorLengthZeroAndDescriptorN
CL_ACCELERATOR_DESCRIPTOR_INTEL,
0, // query required size w/nullptr return
nullptr,
&param_value_size_ret);
&paramValueSizeRet);
EXPECT_EQ(CL_SUCCESS, result);
EXPECT_EQ(sizeof(cl_motion_estimation_desc_intel), param_value_size_ret);
EXPECT_EQ(sizeof(cl_motion_estimation_desc_intel), paramValueSizeRet);
}
TEST_F(IntelMotionEstimationGetInfoTest, GivenAcceleratorTypeWhenGettingAcceleratorInfoThenAcceleratorTypeMotionEstimationIntelIsReturned) {
@@ -326,13 +326,13 @@ TEST_F(IntelMotionEstimationGetInfoTest, GivenAcceleratorTypeWhenGettingAccelera
accelerator,
CL_ACCELERATOR_TYPE_INTEL,
sizeof(cl_uint),
&type_returned,
&param_value_size_ret);
&typeReturned,
&paramValueSizeRet);
EXPECT_EQ(CL_SUCCESS, result);
EXPECT_EQ(sizeof(cl_accelerator_type_intel), param_value_size_ret);
EXPECT_EQ(sizeof(cl_accelerator_type_intel), paramValueSizeRet);
EXPECT_EQ(static_cast<cl_accelerator_type_intel>(CL_ACCELERATOR_TYPE_MOTION_ESTIMATION_INTEL), type_returned);
EXPECT_EQ(static_cast<cl_accelerator_type_intel>(CL_ACCELERATOR_TYPE_MOTION_ESTIMATION_INTEL), typeReturned);
}
TEST_F(IntelMotionEstimationGetInfoTest, GivenAcceleratorTypeIntelWhenGettingAcceleratorInfoThenClAcceleratorTypeMotionEstimationIntelIsReturned) {
@@ -340,13 +340,13 @@ TEST_F(IntelMotionEstimationGetInfoTest, GivenAcceleratorTypeIntelWhenGettingAcc
accelerator,
CL_ACCELERATOR_TYPE_INTEL,
sizeof(cl_uint), // exact
&type_returned,
&param_value_size_ret);
&typeReturned,
&paramValueSizeRet);
EXPECT_EQ(CL_SUCCESS, result);
EXPECT_EQ(sizeof(cl_accelerator_type_intel), param_value_size_ret);
EXPECT_EQ(sizeof(cl_accelerator_type_intel), paramValueSizeRet);
EXPECT_EQ(static_cast<cl_accelerator_type_intel>(CL_ACCELERATOR_TYPE_MOTION_ESTIMATION_INTEL), type_returned);
EXPECT_EQ(static_cast<cl_accelerator_type_intel>(CL_ACCELERATOR_TYPE_MOTION_ESTIMATION_INTEL), typeReturned);
}
TEST_F(IntelMotionEstimationGetInfoTest, GivenAcceleratorTypeIntelAndTooShortTypeLengthWhenGettingAcceleratorInfoThenClInvalidValueIsReturned) {
@@ -354,8 +354,8 @@ TEST_F(IntelMotionEstimationGetInfoTest, GivenAcceleratorTypeIntelAndTooShortTyp
accelerator,
CL_ACCELERATOR_TYPE_INTEL,
sizeof(cl_uint) - 1, // short
&type_returned,
&param_value_size_ret);
&typeReturned,
&paramValueSizeRet);
EXPECT_EQ(CL_INVALID_VALUE, result);
}
@@ -365,8 +365,8 @@ TEST_F(IntelMotionEstimationGetInfoTest, GivenAcceleratorTypeIntelAndTypeLengthZ
accelerator,
CL_ACCELERATOR_TYPE_INTEL,
0, // very short
&type_returned,
&param_value_size_ret);
&typeReturned,
&paramValueSizeRet);
EXPECT_EQ(CL_INVALID_VALUE, result);
}
@@ -376,11 +376,11 @@ TEST_F(IntelMotionEstimationGetInfoTest, GivenAcceleratorTypeIntelAndTooLongType
accelerator,
CL_ACCELERATOR_TYPE_INTEL,
sizeof(cl_uint) + 1, // long
&type_returned,
&param_value_size_ret);
&typeReturned,
&paramValueSizeRet);
EXPECT_EQ(CL_SUCCESS, result);
EXPECT_EQ(sizeof(cl_accelerator_type_intel), param_value_size_ret);
EXPECT_EQ(sizeof(cl_accelerator_type_intel), paramValueSizeRet);
}
TEST_F(IntelMotionEstimationGetInfoTest, GivenAcceleratorTypeIntelAndNullTypeWhenGettingAcceleratorInfoThenCorrectLengthIsReturned) {
@@ -389,10 +389,10 @@ TEST_F(IntelMotionEstimationGetInfoTest, GivenAcceleratorTypeIntelAndNullTypeWhe
CL_ACCELERATOR_TYPE_INTEL,
0,
nullptr,
&param_value_size_ret);
&paramValueSizeRet);
EXPECT_EQ(CL_SUCCESS, result);
EXPECT_EQ(sizeof(cl_accelerator_type_intel), param_value_size_ret);
EXPECT_EQ(sizeof(cl_accelerator_type_intel), paramValueSizeRet);
}
TEST_F(IntelMotionEstimationTest, GivenDescriptor8x8IntegerNone2x2WhenCreatingAcceleratorThenSuccessIsReturned) {

View File

@@ -1342,7 +1342,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, ProfilingCommandsTest, givenKernelWhenProfilingComma
ASSERT_NE(nullptr, storeReg);
uint64_t gpuAddress = storeReg->getMemoryAddress();
auto contextTimestampFieldOffset = offsetof(HwTimeStamps, ContextStartTS);
auto contextTimestampFieldOffset = offsetof(HwTimeStamps, contextStartTS);
uint64_t expectedAddress = hwTimeStamp1->getGpuAddress() + contextTimestampFieldOffset;
EXPECT_EQ(expectedAddress, gpuAddress);
@@ -1368,7 +1368,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, ProfilingCommandsTest, givenKernelWhenProfilingComma
ASSERT_NE(nullptr, pipeControl);
gpuAddress = NEO::UnitTestHelper<FamilyType>::getPipeControlPostSyncAddress(*pipeControl);
expectedAddress = hwTimeStamp1->getGpuAddress() + offsetof(HwTimeStamps, GlobalStartTS);
expectedAddress = hwTimeStamp1->getGpuAddress() + offsetof(HwTimeStamps, globalStartTS);
EXPECT_EQ(expectedAddress, gpuAddress);
itorPipeCtrl++;
@@ -1384,7 +1384,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, ProfilingCommandsTest, givenKernelWhenProfilingComma
ASSERT_NE(nullptr, pipeControl);
gpuAddress = NEO::UnitTestHelper<FamilyType>::getPipeControlPostSyncAddress(*pipeControl);
expectedAddress = hwTimeStamp2->getGpuAddress() + offsetof(HwTimeStamps, GlobalStartTS);
expectedAddress = hwTimeStamp2->getGpuAddress() + offsetof(HwTimeStamps, globalStartTS);
EXPECT_EQ(expectedAddress, gpuAddress);
}
@@ -1413,7 +1413,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, ProfilingCommandsTest, givenKernelWhenProfilingComma
ASSERT_NE(nullptr, storeReg);
uint64_t gpuAddress = storeReg->getMemoryAddress();
auto contextTimestampFieldOffset = offsetof(HwTimeStamps, ContextEndTS);
auto contextTimestampFieldOffset = offsetof(HwTimeStamps, contextEndTS);
uint64_t expectedAddress = hwTimeStamp1->getGpuAddress() + contextTimestampFieldOffset;
EXPECT_EQ(expectedAddress, gpuAddress);

View File

@@ -822,7 +822,7 @@ TEST_F(InternalsEventTest, givenDeviceTimestampBaseNotEnabledWhenCalculateStartT
MockEvent<Event> event(&cmdQ, CL_COMPLETE, 0, 0);
HwTimeStamps timestamp{};
timestamp.GlobalStartTS = 2;
timestamp.globalStartTS = 2;
event.queueTimeStamp.GPUTimeStamp = 1;
event.queueTimeStamp.CPUTimeinNS = 100;
TagNode<HwTimeStamps> timestampNode{};
@@ -835,7 +835,7 @@ TEST_F(InternalsEventTest, givenDeviceTimestampBaseNotEnabledWhenCalculateStartT
auto resolution = pClDevice->getDevice().getDeviceInfo().profilingTimerResolution;
auto &gfxCoreHelper = pClDevice->getGfxCoreHelper();
auto c0 = event.queueTimeStamp.CPUTimeinNS - gfxCoreHelper.getGpuTimeStampInNS(event.queueTimeStamp.GPUTimeStamp, resolution);
EXPECT_EQ(start, static_cast<uint64_t>(timestamp.GlobalStartTS * resolution) + c0);
EXPECT_EQ(start, static_cast<uint64_t>(timestamp.globalStartTS * resolution) + c0);
event.timeStampNode = nullptr;
}
@@ -862,7 +862,7 @@ TEST_F(InternalsEventTest, givenDeviceTimestampBaseEnabledWhenCalculateStartTime
MockEvent<Event> event(&cmdQ, CL_COMPLETE, 0, 0);
HwTimeStamps timestamp{};
timestamp.GlobalStartTS = 2;
timestamp.globalStartTS = 2;
event.queueTimeStamp.GPUTimeStamp = 1;
TagNode<HwTimeStamps> timestampNode{};
timestampNode.tagForCpuAccess = &timestamp;
@@ -872,7 +872,7 @@ TEST_F(InternalsEventTest, givenDeviceTimestampBaseEnabledWhenCalculateStartTime
event.getEventProfilingInfo(CL_PROFILING_COMMAND_START, sizeof(cl_ulong), &start, nullptr);
auto resolution = pClDevice->getDevice().getDeviceInfo().profilingTimerResolution;
EXPECT_EQ(start, static_cast<uint64_t>(timestamp.GlobalStartTS * resolution));
EXPECT_EQ(start, static_cast<uint64_t>(timestamp.globalStartTS * resolution));
event.timeStampNode = nullptr;
}
@@ -883,7 +883,7 @@ TEST_F(InternalsEventTest, givenDeviceTimestampBaseEnabledAndGlobalStartTSSmalle
MockEvent<Event> event(&cmdQ, CL_COMPLETE, 0, 0);
HwTimeStamps timestamp{};
timestamp.GlobalStartTS = 1;
timestamp.globalStartTS = 1;
event.queueTimeStamp.GPUTimeStamp = 2;
TagNode<HwTimeStamps> timestampNode{};
timestampNode.tagForCpuAccess = &timestamp;
@@ -894,7 +894,7 @@ TEST_F(InternalsEventTest, givenDeviceTimestampBaseEnabledAndGlobalStartTSSmalle
auto &gfxCoreHelper = pClDevice->getGfxCoreHelper();
auto resolution = pClDevice->getDevice().getDeviceInfo().profilingTimerResolution;
auto refStartTime = static_cast<uint64_t>(timestamp.GlobalStartTS * resolution + (1ULL << gfxCoreHelper.getGlobalTimeStampBits()) * resolution);
auto refStartTime = static_cast<uint64_t>(timestamp.globalStartTS * resolution + (1ULL << gfxCoreHelper.getGlobalTimeStampBits()) * resolution);
EXPECT_EQ(start, refStartTime);
event.timeStampNode = nullptr;
@@ -1369,12 +1369,12 @@ HWTEST_F(EventTest, WhenGettingHwTimeStampsThenValidPointerIsReturned) {
ASSERT_NE(nullptr, timeStamps);
// this should not cause any heap corruptions
ASSERT_EQ(0ULL, timeStamps->GlobalStartTS);
ASSERT_EQ(0ULL, timeStamps->ContextStartTS);
ASSERT_EQ(0ULL, timeStamps->GlobalEndTS);
ASSERT_EQ(0ULL, timeStamps->ContextEndTS);
ASSERT_EQ(0ULL, timeStamps->GlobalCompleteTS);
ASSERT_EQ(0ULL, timeStamps->ContextCompleteTS);
ASSERT_EQ(0ULL, timeStamps->globalStartTS);
ASSERT_EQ(0ULL, timeStamps->contextStartTS);
ASSERT_EQ(0ULL, timeStamps->globalEndTS);
ASSERT_EQ(0ULL, timeStamps->contextEndTS);
ASSERT_EQ(0ULL, timeStamps->globalCompleteTS);
ASSERT_EQ(0ULL, timeStamps->contextCompleteTS);
HwTimeStamps *timeStamps2 = static_cast<TagNode<HwTimeStamps> *>(event->getHwTimeStampNode())->tagForCpuAccess;
ASSERT_EQ(timeStamps, timeStamps2);

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2022 Intel Corporation
* Copyright (C) 2018-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -660,7 +660,7 @@ TEST(EventsTracker, givenEventsFromDifferentThreadsThenDumpingProperly) {
auto trackedEventsMock = std::shared_ptr<IFList<TrackedEvent, true, true>>{new IFList<TrackedEvent, true, true>};
return trackedEventsMock->detachNodes();
}
std::shared_ptr<IFList<TrackedEvent, true, true>> *TrackedEventsMock;
std::shared_ptr<IFList<TrackedEvent, true, true>> *trackedEventsMock;
};
auto evTrackerMockMT = std::shared_ptr<EventsTrackerMockMT>{new EventsTrackerMockMT()};

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2019-2022 Intel Corporation
* Copyright (C) 2019-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -137,12 +137,12 @@ GEN12LPTEST_F(ProfilingTestsGen12LP, givenRawTimestampsDebugModeWhenDataIsQuerie
cmdQ.device = device.get();
HwTimeStamps timestamp;
timestamp.GlobalStartTS = 10;
timestamp.ContextStartTS = 20;
timestamp.GlobalEndTS = 80;
timestamp.ContextEndTS = 56;
timestamp.GlobalCompleteTS = 0;
timestamp.ContextCompleteTS = 70;
timestamp.globalStartTS = 10;
timestamp.contextStartTS = 20;
timestamp.globalEndTS = 80;
timestamp.contextEndTS = 56;
timestamp.globalCompleteTS = 0;
timestamp.contextCompleteTS = 70;
MockTagNode<HwTimeStamps> timestampNode;
timestampNode.tagForCpuAccess = &timestamp;
@@ -168,9 +168,9 @@ GEN12LPTEST_F(ProfilingTestsGen12LP, givenRawTimestampsDebugModeWhenDataIsQuerie
clGetEventProfilingInfo(clEvent, CL_PROFILING_COMMAND_END, sizeof(cl_ulong), &end, nullptr);
clGetEventProfilingInfo(clEvent, CL_PROFILING_COMMAND_COMPLETE, sizeof(cl_ulong), &complete, nullptr);
EXPECT_EQ(timestamp.GlobalEndTS, complete);
EXPECT_EQ(timestamp.GlobalEndTS, end);
EXPECT_EQ(timestamp.GlobalStartTS, start);
EXPECT_EQ(timestamp.globalEndTS, complete);
EXPECT_EQ(timestamp.globalEndTS, end);
EXPECT_EQ(timestamp.globalStartTS, start);
EXPECT_EQ(event.submitTimeStamp.GPUTimeStamp, submited);
EXPECT_EQ(event.queueTimeStamp.GPUTimeStamp, queued);
event.timeStampNode = nullptr;

View File

@@ -638,9 +638,9 @@ TEST_P(GmmImgTest, WhenUpdatingImgInfoAndDescThenInformationIsCorrect) {
TEST_F(GmmImgTest, givenImgInfoWhenUpdatingOffsetsThenGmmIsCalledToGetOffsets) {
struct GmmGetOffsetOutput {
uint32_t Offset;
uint32_t XOffset;
uint32_t YOffset;
uint32_t offset;
uint32_t xOffset;
uint32_t yOffset;
};
struct MyMockGmmResourceInfo : MockGmmResourceInfo {
@@ -651,9 +651,9 @@ TEST_F(GmmImgTest, givenImgInfoWhenUpdatingOffsetsThenGmmIsCalledToGetOffsets) {
EXPECT_EQ(expectedArrayIndex, reqOffsetInfo.ArrayIndex);
EXPECT_EQ(expectedGmmPlane, reqOffsetInfo.Plane);
reqOffsetInfo.Render.Offset = gmmGetOffsetOutput.Offset;
reqOffsetInfo.Render.XOffset = gmmGetOffsetOutput.XOffset;
reqOffsetInfo.Render.YOffset = gmmGetOffsetOutput.YOffset;
reqOffsetInfo.Render.Offset = gmmGetOffsetOutput.offset;
reqOffsetInfo.Render.XOffset = gmmGetOffsetOutput.xOffset;
reqOffsetInfo.Render.YOffset = gmmGetOffsetOutput.yOffset;
return GMM_SUCCESS;
}
@@ -684,10 +684,10 @@ TEST_F(GmmImgTest, givenImgInfoWhenUpdatingOffsetsThenGmmIsCalledToGetOffsets) {
mockGmmResourceInfo->gmmGetOffsetOutput = {10, 111, 120};
mockGmmResourceInfo->gmmGetBitsPerPixelOutput = 24;
gmm->updateOffsetsInImgInfo(imgInfo, mockGmmResourceInfo->expectedArrayIndex);
EXPECT_EQ(mockGmmResourceInfo->gmmGetOffsetOutput.Offset, imgInfo.offset);
const auto expectedXOffset = mockGmmResourceInfo->gmmGetOffsetOutput.XOffset / (mockGmmResourceInfo->gmmGetBitsPerPixelOutput / 8);
EXPECT_EQ(mockGmmResourceInfo->gmmGetOffsetOutput.offset, imgInfo.offset);
const auto expectedXOffset = mockGmmResourceInfo->gmmGetOffsetOutput.xOffset / (mockGmmResourceInfo->gmmGetBitsPerPixelOutput / 8);
EXPECT_EQ(expectedXOffset, imgInfo.xOffset);
EXPECT_EQ(mockGmmResourceInfo->gmmGetOffsetOutput.YOffset, imgInfo.yOffset);
EXPECT_EQ(mockGmmResourceInfo->gmmGetOffsetOutput.yOffset, imgInfo.yOffset);
}
TEST_F(GmmTests, GivenPlaneWhenCopyingResourceBltThenResourceIsCopiedCorrectly) {

View File

@@ -36,26 +36,26 @@ class TestedMemoryManager : public OsAgnosticMemoryManager {
return nullptr;
};
GraphicsAllocation *allocateGraphicsMemoryWithHostPtr(const AllocationData &properties) override {
EXPECT_NE(0u, HPExpectedSize);
if (HPExpectedSize == properties.size) {
EXPECT_NE(0u, hpExpectedSize);
if (hpExpectedSize == properties.size) {
EXPECT_TRUE(properties.flags.forcePin);
HPAllocCount++;
hpAllocCount++;
}
return OsAgnosticMemoryManager::allocateGraphicsMemoryWithHostPtr(properties);
}
GraphicsAllocation *allocateGraphicsMemoryForNonSvmHostPtr(const AllocationData &properties) override {
EXPECT_NE(0u, HPExpectedSize);
if (HPExpectedSize == properties.size) {
EXPECT_NE(0u, hpExpectedSize);
if (hpExpectedSize == properties.size) {
EXPECT_TRUE(properties.flags.forcePin);
HPAllocCount++;
hpAllocCount++;
}
return OsAgnosticMemoryManager::allocateGraphicsMemoryForNonSvmHostPtr(properties);
}
size_t expectedSize = 0;
uint32_t allocCount = 0;
size_t HPExpectedSize = 0;
uint32_t HPAllocCount = 0;
size_t hpExpectedSize = 0;
uint32_t hpAllocCount = 0;
};
TEST(BufferTests, WhenBufferIsCreatedThenPinIsSet) {
@@ -69,7 +69,7 @@ TEST(BufferTests, WhenBufferIsCreatedThenPinIsSet) {
auto size = MemoryConstants::pageSize * 32;
auto retVal = CL_INVALID_OPERATION;
mm->expectedSize = size;
mm->HPExpectedSize = 0u;
mm->hpExpectedSize = 0u;
context.memoryManager = mm.get();
auto buffer = Buffer::create(
@@ -96,7 +96,7 @@ TEST(BufferTests, GivenHostPtrWhenBufferIsCreatedThenPinIsSet) {
auto retVal = CL_INVALID_OPERATION;
auto size = MemoryConstants::pageSize * 32;
mm->expectedSize = 0u;
mm->HPExpectedSize = size;
mm->hpExpectedSize = size;
context.memoryManager = mm.get();
// memory must be aligned to use zero-copy
@@ -109,7 +109,7 @@ TEST(BufferTests, GivenHostPtrWhenBufferIsCreatedThenPinIsSet) {
bff,
retVal);
EXPECT_EQ(CL_SUCCESS, retVal);
EXPECT_EQ(1u, mm->HPAllocCount);
EXPECT_EQ(1u, mm->hpAllocCount);
delete buffer;
alignedFree(bff);

View File

@@ -30,16 +30,16 @@ class ImageRedescribeTest : public testing::TestWithParam<std::tuple<size_t, uin
cl_image_format imageFormat;
cl_image_desc imageDesc;
std::tie(indexImageFormat, ImageType) = this->GetParam();
std::tie(indexImageFormat, imageType) = this->GetParam();
ArrayRef<const ClSurfaceFormatInfo> readWriteSurfaceFormats = SurfaceFormats::readWrite();
auto &surfaceFormatInfo = readWriteSurfaceFormats[indexImageFormat];
imageFormat = surfaceFormatInfo.OCLImageFormat;
auto imageHeight = ImageType == CL_MEM_OBJECT_IMAGE1D_ARRAY ? 0 : 32;
auto imageArrays = ImageType == CL_MEM_OBJECT_IMAGE1D_ARRAY || ImageType == CL_MEM_OBJECT_IMAGE2D_ARRAY ? 7 : 1;
auto imageHeight = imageType == CL_MEM_OBJECT_IMAGE1D_ARRAY ? 0 : 32;
auto imageArrays = imageType == CL_MEM_OBJECT_IMAGE1D_ARRAY || imageType == CL_MEM_OBJECT_IMAGE2D_ARRAY ? 7 : 1;
imageDesc.image_type = ImageType;
imageDesc.image_type = imageType;
imageDesc.image_width = 32;
imageDesc.image_height = imageHeight;
imageDesc.image_depth = 1;
@@ -70,7 +70,7 @@ class ImageRedescribeTest : public testing::TestWithParam<std::tuple<size_t, uin
MockContext context;
std::unique_ptr<Image> image;
size_t indexImageFormat = 0;
uint32_t ImageType;
uint32_t imageType;
};
TEST_P(ImageRedescribeTest, givenImageWhenItIsRedescribedThenItContainsProperFormatFlagsAddressAndSameElementSizeInBytes) {
@@ -159,11 +159,11 @@ TEST_P(ImageRedescribeTest, givenImageWithMaxSizesWhenItIsRedescribedThenNewImag
auto imageWidth = 1;
auto imageHeight = 1;
auto imageArrays = ImageType == CL_MEM_OBJECT_IMAGE1D_ARRAY || ImageType == CL_MEM_OBJECT_IMAGE2D_ARRAY ? 7 : 1;
auto imageArrays = imageType == CL_MEM_OBJECT_IMAGE1D_ARRAY || imageType == CL_MEM_OBJECT_IMAGE2D_ARRAY ? 7 : 1;
size_t maxImageWidth = 0;
size_t maxImageHeight = 0;
switch (ImageType) {
switch (imageType) {
case CL_MEM_OBJECT_IMAGE1D:
case CL_MEM_OBJECT_IMAGE1D_ARRAY:
imageWidth = 16384;
@@ -183,7 +183,7 @@ TEST_P(ImageRedescribeTest, givenImageWithMaxSizesWhenItIsRedescribedThenNewImag
break;
}
imageDesc.image_type = ImageType;
imageDesc.image_type = imageType;
imageDesc.image_width = imageWidth;
imageDesc.image_height = imageHeight;
imageDesc.image_depth = 1;

View File

@@ -29,26 +29,26 @@ class ZeroCopyBufferTest : public ClDeviceFixture,
void SetUp() override {
size_t sizeToAlloc;
size_t alignment;
host_ptr = nullptr;
std::tie(flags, sizeToAlloc, alignment, size, ShouldBeZeroCopy, MisalignPointer) = GetParam();
hostPtr = nullptr;
std::tie(flags, sizeToAlloc, alignment, size, shouldBeZeroCopy, misalignPointer) = GetParam();
if (sizeToAlloc > 0) {
host_ptr = (void *)alignedMalloc(sizeToAlloc, alignment);
hostPtr = (void *)alignedMalloc(sizeToAlloc, alignment);
}
ClDeviceFixture::setUp();
}
void TearDown() override {
ClDeviceFixture::tearDown();
alignedFree(host_ptr);
alignedFree(hostPtr);
}
cl_int retVal = CL_SUCCESS;
MockContext context;
cl_mem_flags flags = 0;
void *host_ptr;
bool ShouldBeZeroCopy;
void *hostPtr;
bool shouldBeZeroCopy;
cl_int size;
bool MisalignPointer;
bool misalignPointer;
};
static const int Multiplier = 1000;
@@ -57,7 +57,7 @@ static const int CacheLinedMisAlignedSize = CacheLinedAlignedSize - 1;
static const int PageAlignSize = MemoryConstants::preferredAlignment * Multiplier;
// clang-format off
//flags, size to alloc, alignment, size, ZeroCopy, MisalignPointer
//flags, size to alloc, alignment, size, ZeroCopy, misalignPointer
std::tuple<uint64_t , size_t, size_t, int, bool, bool> Inputs[] = {std::make_tuple((cl_mem_flags)CL_MEM_USE_HOST_PTR, CacheLinedMisAlignedSize, MemoryConstants::preferredAlignment, CacheLinedMisAlignedSize, false, true),
std::make_tuple((cl_mem_flags)CL_MEM_USE_HOST_PTR, CacheLinedAlignedSize, MemoryConstants::preferredAlignment, CacheLinedAlignedSize, false, true),
std::make_tuple((cl_mem_flags)CL_MEM_USE_HOST_PTR, CacheLinedAlignedSize, MemoryConstants::preferredAlignment, CacheLinedAlignedSize, true, false),
@@ -72,9 +72,9 @@ std::tuple<uint64_t , size_t, size_t, int, bool, bool> Inputs[] = {std::make_tup
TEST_P(ZeroCopyBufferTest, GivenCacheAlignedPointerWhenCreatingBufferThenZeroCopy) {
char *passedPtr = (char *)host_ptr;
char *passedPtr = (char *)hostPtr;
// misalign the pointer
if (MisalignPointer && passedPtr) {
if (misalignPointer && passedPtr) {
passedPtr += 1;
}
@@ -85,9 +85,9 @@ TEST_P(ZeroCopyBufferTest, GivenCacheAlignedPointerWhenCreatingBufferThenZeroCop
passedPtr,
retVal);
EXPECT_EQ(CL_SUCCESS, retVal);
EXPECT_EQ(ShouldBeZeroCopy, buffer->isMemObjZeroCopy()) << "Zero Copy not handled properly";
if (!ShouldBeZeroCopy && flags & CL_MEM_USE_HOST_PTR) {
EXPECT_NE(buffer->getCpuAddress(), host_ptr);
EXPECT_EQ(shouldBeZeroCopy, buffer->isMemObjZeroCopy()) << "Zero Copy not handled properly";
if (!shouldBeZeroCopy && flags & CL_MEM_USE_HOST_PTR) {
EXPECT_NE(buffer->getCpuAddress(), hostPtr);
}
EXPECT_NE(nullptr, buffer->getCpuAddress());

View File

@@ -86,32 +86,32 @@ class MockGlSharing {
MockGlSharing() {}
MockGlSharing(GLType glHDCType, GLContext glHGLRCHandle, GLContext glHGLRCHandleBkpCtx, GLDisplay glHDCHandle);
void uploadDataToBufferInfo() {
dllParam->loadBuffer(m_bufferInfoOutput);
dllParam->loadBuffer(bufferInfoOutput);
}
void uploadDataToBufferInfo(unsigned int sharedHandle, int bufferOffset, GMM_RESOURCE_INFO *gmmResInfo) {
m_bufferInfoOutput.globalShareHandle = sharedHandle;
m_bufferInfoOutput.bufferOffset = bufferOffset;
m_bufferInfoOutput.pGmmResInfo = gmmResInfo;
dllParam->loadBuffer(m_bufferInfoOutput);
bufferInfoOutput.globalShareHandle = sharedHandle;
bufferInfoOutput.bufferOffset = bufferOffset;
bufferInfoOutput.pGmmResInfo = gmmResInfo;
dllParam->loadBuffer(bufferInfoOutput);
}
void uploadDataToTextureInfo() {
dllParam->loadTexture(m_textureInfoOutput);
dllParam->loadTexture(textureInfoOutput);
}
void uploadDataToTextureInfo(unsigned int sharedHandle) {
m_textureInfoOutput.globalShareHandle = sharedHandle;
dllParam->loadTexture(m_textureInfoOutput);
textureInfoOutput.globalShareHandle = sharedHandle;
dllParam->loadTexture(textureInfoOutput);
}
void uploadTextureBufferOffsetToTextureInfo(int texBufOffset) {
m_textureInfoOutput.textureBufferOffset = texBufOffset;
dllParam->loadTexture(m_textureInfoOutput);
textureInfoOutput.textureBufferOffset = texBufOffset;
dllParam->loadTexture(textureInfoOutput);
}
std::unique_ptr<GlSharingFunctionsMock> sharingFunctions = std::make_unique<GlSharingFunctionsMock>();
std::unique_ptr<GlDllHelper> dllParam = std::make_unique<GlDllHelper>();
CL_GL_RESOURCE_INFO m_clGlResourceInfo = {0};
GL_CL_RESOURCE_INFO m_glClResourceInfo = {0};
CL_GL_BUFFER_INFO m_bufferInfoOutput = {0};
CL_GL_RESOURCE_INFO m_textureInfoOutput = {0};
CL_GL_RESOURCE_INFO clGlResourceInfo = {0};
GL_CL_RESOURCE_INFO glClResourceInfo = {0};
CL_GL_BUFFER_INFO bufferInfoOutput = {0};
CL_GL_RESOURCE_INFO textureInfoOutput = {0};
};
class MockGLSharingFunctions : public GLSharingFunctionsLinux {

View File

@@ -138,24 +138,24 @@ class MockGlSharing {
MockGlSharing() {}
MockGlSharing(GLType GLHDCType, GLContext GLHGLRCHandle, GLContext GLHGLRCHandleBkpCtx, GLDisplay GLHDCHandle);
void uploadDataToBufferInfo() {
dllParam->loadBuffer(m_bufferInfoOutput);
dllParam->loadBuffer(bufferInfoOutput);
}
void uploadDataToBufferInfo(unsigned int sharedHandle, int bufferOffset, GMM_RESOURCE_INFO *gmmResInfo) {
m_bufferInfoOutput.globalShareHandle = sharedHandle;
m_bufferInfoOutput.bufferOffset = bufferOffset;
m_bufferInfoOutput.pGmmResInfo = gmmResInfo;
dllParam->loadBuffer(m_bufferInfoOutput);
bufferInfoOutput.globalShareHandle = sharedHandle;
bufferInfoOutput.bufferOffset = bufferOffset;
bufferInfoOutput.pGmmResInfo = gmmResInfo;
dllParam->loadBuffer(bufferInfoOutput);
}
void uploadDataToTextureInfo() {
dllParam->loadTexture(m_textureInfoOutput);
dllParam->loadTexture(textureInfoOutput);
}
void uploadDataToTextureInfo(unsigned int sharedHandle) {
m_textureInfoOutput.globalShareHandle = sharedHandle;
dllParam->loadTexture(m_textureInfoOutput);
textureInfoOutput.globalShareHandle = sharedHandle;
dllParam->loadTexture(textureInfoOutput);
}
void uploadTextureBufferOffsetToTextureInfo(int texBufOffset) {
m_textureInfoOutput.textureBufferOffset = texBufOffset;
dllParam->loadTexture(m_textureInfoOutput);
textureInfoOutput.textureBufferOffset = texBufOffset;
dllParam->loadTexture(textureInfoOutput);
}
void overrideGetCurrentValues(GLContext ctx, GLDisplay display, bool forceMakeCurrentFail = false, int numberOfFails = 0) {
glMockReturnedValues.currentContext = ctx;
@@ -172,10 +172,10 @@ class MockGlSharing {
std::unique_ptr<GlSharingFunctionsMock> sharingFunctions = std::make_unique<GlSharingFunctionsMock>();
std::unique_ptr<GlDllHelper> dllParam = std::make_unique<GlDllHelper>();
CL_GL_RESOURCE_INFO m_clGlResourceInfo = {0};
GL_CL_RESOURCE_INFO m_glClResourceInfo = {0};
CL_GL_BUFFER_INFO m_bufferInfoOutput = {0};
CL_GL_RESOURCE_INFO m_textureInfoOutput = {0};
CL_GL_RESOURCE_INFO clGlResourceInfo = {0};
GL_CL_RESOURCE_INFO glClResourceInfo = {0};
CL_GL_BUFFER_INFO bufferInfoOutput = {0};
CL_GL_RESOURCE_INFO textureInfoOutput = {0};
GLMockReturnedValues glMockReturnedValues = {0};
};

View File

@@ -67,9 +67,9 @@ struct ClDrmMemoryManagerTest : public DrmMemoryManagerTest {
TEST_F(ClDrmMemoryManagerTest, Given32bitAllocatorWhenAskedForBufferAllocationThen32BitBufferIsReturned) {
DebugManagerStateRestore dbgRestorer;
mock->ioctl_expected.gemUserptr = 1;
mock->ioctl_expected.gemWait = 1;
mock->ioctl_expected.gemClose = 1;
mock->ioctlExpected.gemUserptr = 1;
mock->ioctlExpected.gemWait = 1;
mock->ioctlExpected.gemClose = 1;
DebugManager.flags.Force32bitAddressing.set(true);
MockContext context(pClDevice);
@@ -97,9 +97,9 @@ TEST_F(ClDrmMemoryManagerTest, Given32bitAllocatorWhenAskedForBufferAllocationTh
TEST_F(ClDrmMemoryManagerTest, Given32bitAllocatorWhenAskedForBufferCreatedFromHostPtrThen32BitBufferIsReturned) {
DebugManagerStateRestore dbgRestorer;
mock->ioctl_expected.gemUserptr = 1;
mock->ioctl_expected.gemWait = 1;
mock->ioctl_expected.gemClose = 1;
mock->ioctlExpected.gemUserptr = 1;
mock->ioctlExpected.gemWait = 1;
mock->ioctlExpected.gemClose = 1;
DebugManager.flags.Force32bitAddressing.set(true);
MockContext context(pClDevice);
@@ -155,11 +155,11 @@ TEST_F(ClDrmMemoryManagerTest, Given32bitAllocatorWhenAskedForBufferCreatedFrom6
DebugManagerStateRestore dbgRestorer;
{
if (is32bit) {
mock->ioctl_expected.total = -1;
mock->ioctlExpected.total = -1;
} else {
mock->ioctl_expected.gemUserptr = 1;
mock->ioctl_expected.gemWait = 1;
mock->ioctl_expected.gemClose = 1;
mock->ioctlExpected.gemUserptr = 1;
mock->ioctlExpected.gemWait = 1;
mock->ioctlExpected.gemClose = 1;
DebugManager.flags.Force32bitAddressing.set(true);
MockContext context(pClDevice);
@@ -206,7 +206,7 @@ TEST_F(ClDrmMemoryManagerTest, Given32bitAllocatorWhenAskedForBufferCreatedFrom6
TEST_F(ClDrmMemoryManagerTest, GivenSizeAbove2GBWhenUseHostPtrAndAllocHostPtrAreCreatedThenFirstSucceedsAndSecondFails) {
DebugManagerStateRestore dbgRestorer;
mock->ioctl_expected.total = -1;
mock->ioctlExpected.total = -1;
DebugManager.flags.Force32bitAddressing.set(true);
MockContext context(pClDevice);
memoryManager->setForce32BitAllocations(true);
@@ -247,7 +247,7 @@ TEST_F(ClDrmMemoryManagerTest, GivenSizeAbove2GBWhenUseHostPtrAndAllocHostPtrAre
TEST_F(ClDrmMemoryManagerTest, GivenSizeAbove2GBWhenAllocHostPtrAndUseHostPtrAreCreatedThenFirstSucceedsAndSecondFails) {
DebugManagerStateRestore dbgRestorer;
mock->ioctl_expected.total = -1;
mock->ioctlExpected.total = -1;
DebugManager.flags.Force32bitAddressing.set(true);
MockContext context(pClDevice);
memoryManager->setForce32BitAllocations(true);
@@ -287,7 +287,7 @@ TEST_F(ClDrmMemoryManagerTest, GivenSizeAbove2GBWhenAllocHostPtrAndUseHostPtrAre
}
TEST_F(ClDrmMemoryManagerTest, givenDrmBufferWhenItIsQueriedForInternalAllocationThenBoIsReturned) {
mock->ioctl_expected.total = -1;
mock->ioctlExpected.total = -1;
mock->outputFd = 1337;
MockContext context(pClDevice);
@@ -315,10 +315,10 @@ HWTEST_F(ClDrmMemoryManagerTest, givenDrmMemoryManagerWhenTiledImageWithMipCount
if (!defaultHwInfo->capabilityTable.supportsImages) {
GTEST_SKIP();
}
mock->ioctl_expected.gemCreate = 1;
mock->ioctl_expected.gemSetTiling = 1;
mock->ioctl_expected.gemWait = 1;
mock->ioctl_expected.gemClose = 1;
mock->ioctlExpected.gemCreate = 1;
mock->ioctlExpected.gemSetTiling = 1;
mock->ioctlExpected.gemWait = 1;
mock->ioctlExpected.gemClose = 1;
MockContext context(pClDevice);
@@ -363,10 +363,10 @@ HWTEST_F(ClDrmMemoryManagerTest, givenDrmMemoryManagerWhenTiledImageWithMipCount
if (!defaultHwInfo->capabilityTable.supportsImages) {
GTEST_SKIP();
}
mock->ioctl_expected.gemCreate = 1;
mock->ioctl_expected.gemSetTiling = 1;
mock->ioctl_expected.gemWait = 1;
mock->ioctl_expected.gemClose = 1;
mock->ioctlExpected.gemCreate = 1;
mock->ioctlExpected.gemSetTiling = 1;
mock->ioctlExpected.gemWait = 1;
mock->ioctlExpected.gemClose = 1;
MockContext context(pClDevice);
@@ -451,34 +451,34 @@ HWTEST_F(ClDrmMemoryManagerTest, givenDrmMemoryManagerWhenTiledImageIsBeingCreat
auto csr = static_cast<TestedDrmCommandStreamReceiver<DEFAULT_TEST_FAMILY_NAME> *>(device->getDefaultEngine().commandStreamReceiver);
csr->flushInternalCallBase = false;
mock->ioctl_expected.gemCreate = 1;
mock->ioctl_expected.gemSetTiling = 1;
mock->ioctl_expected.gemWait = 2;
mock->ioctl_expected.gemClose = 2;
mock->ioctl_expected.gemUserptr = 1;
mock->ioctl_expected.execbuffer2 = 0;
mock->ioctlExpected.gemCreate = 1;
mock->ioctlExpected.gemSetTiling = 1;
mock->ioctlExpected.gemWait = 2;
mock->ioctlExpected.gemClose = 2;
mock->ioctlExpected.gemUserptr = 1;
mock->ioctlExpected.execbuffer2 = 0;
// builtins kernels
mock->ioctl_expected.gemUserptr += 5;
mock->ioctlExpected.gemUserptr += 5;
// command buffers
mock->ioctl_expected.gemUserptr += 2;
mock->ioctlExpected.gemUserptr += 2;
additionalDestroyDeviceIoctls.gemClose += 2;
additionalDestroyDeviceIoctls.gemWait += 2;
// indirect heaps
mock->ioctl_expected.gemUserptr += 3;
mock->ioctlExpected.gemUserptr += 3;
additionalDestroyDeviceIoctls.gemClose += 3;
additionalDestroyDeviceIoctls.gemWait += 3;
if (device->getDefaultEngine().commandStreamReceiver->peekTimestampPacketWriteEnabled()) {
mock->ioctl_expected.gemUserptr++;
mock->ioctlExpected.gemUserptr++;
additionalDestroyDeviceIoctls.gemClose++;
additionalDestroyDeviceIoctls.gemWait++;
}
if (device->getDefaultEngine().commandStreamReceiver->getClearColorAllocation() != nullptr) {
mock->ioctl_expected.gemUserptr++;
mock->ioctlExpected.gemUserptr++;
additionalDestroyDeviceIoctls.gemClose++;
additionalDestroyDeviceIoctls.gemWait++;
}
@@ -530,9 +530,9 @@ HWTEST_F(ClDrmMemoryManagerTest, givenDrmMemoryManagerWhenTiledImageIsBeingCreat
}
TEST_F(ClDrmMemoryManagerTest, givenDrmMemoryManagerWhenMemoryAllocatedForImageThenUnmapSizeCorrectlySetWhenLimitedRangeAllocationUsedOrNotUsed) {
mock->ioctl_expected.gemUserptr = 2;
mock->ioctl_expected.gemWait = 2;
mock->ioctl_expected.gemClose = 2;
mock->ioctlExpected.gemUserptr = 2;
mock->ioctlExpected.gemWait = 2;
mock->ioctlExpected.gemClose = 2;
MockContext context(pClDevice);
@@ -563,9 +563,9 @@ TEST_F(ClDrmMemoryManagerTest, givenDrmMemoryManagerWhenMemoryAllocatedForImageT
}
TEST_F(ClDrmMemoryManagerTest, givenDrmMemoryManagerWhenNonTiledImgWithMipCountZeroisBeingCreatedThenAllocateGraphicsMemoryIsUsed) {
mock->ioctl_expected.gemUserptr = 2;
mock->ioctl_expected.gemWait = 2;
mock->ioctl_expected.gemClose = 2;
mock->ioctlExpected.gemUserptr = 2;
mock->ioctlExpected.gemWait = 2;
mock->ioctlExpected.gemClose = 2;
MockContext context(pClDevice);
@@ -610,9 +610,9 @@ TEST_F(ClDrmMemoryManagerTest, givenDrmMemoryManagerWhenNonTiledImgWithMipCountZ
}
TEST_F(ClDrmMemoryManagerTest, givenDrmMemoryManagerWhenNonTiledImgWithMipCountNonZeroisBeingCreatedThenAllocateGraphicsMemoryIsUsed) {
mock->ioctl_expected.gemUserptr = 1;
mock->ioctl_expected.gemWait = 1;
mock->ioctl_expected.gemClose = 1;
mock->ioctlExpected.gemUserptr = 1;
mock->ioctlExpected.gemWait = 1;
mock->ioctlExpected.gemClose = 1;
MockContext context(pClDevice);
@@ -660,9 +660,9 @@ TEST_F(ClDrmMemoryManagerTest, givenDrmMemoryManagerWhenNonTiledImgWithMipCountN
}
TEST_F(ClDrmMemoryManagerTest, givenDrmMemoryManagerWhen1DarrayImageIsBeingCreatedFromHostPtrThenTilingIsNotCalled) {
mock->ioctl_expected.gemUserptr = 2;
mock->ioctl_expected.gemWait = 2;
mock->ioctl_expected.gemClose = 2;
mock->ioctlExpected.gemUserptr = 2;
mock->ioctlExpected.gemWait = 2;
mock->ioctlExpected.gemClose = 2;
MockContext context(pClDevice);
@@ -703,9 +703,9 @@ TEST_F(ClDrmMemoryManagerTest, givenDrmMemoryManagerWhen1DarrayImageIsBeingCreat
}
TEST_F(ClDrmMemoryManagerTest, givenHostPointerNotRequiringCopyWhenAllocateGraphicsMemoryForImageIsCalledThenGraphicsAllocationIsReturned) {
mock->ioctl_expected.gemUserptr = 1;
mock->ioctl_expected.gemWait = 1;
mock->ioctl_expected.gemClose = 1;
mock->ioctlExpected.gemUserptr = 1;
mock->ioctlExpected.gemWait = 1;
mock->ioctlExpected.gemClose = 1;
ImageDescriptor imgDesc = {};
imgDesc.imageType = ImageType::Image1D;
@@ -744,10 +744,10 @@ TEST_F(ClDrmMemoryManagerTest, givenHostPointerNotRequiringCopyWhenAllocateGraph
}
TEST_F(ClDrmMemoryManagerTest, givenOsHandleWithNonTiledObjectWhenCreateFromSharedHandleIsCalledThenNonTiledGmmIsCreatedAndSetInAllocation) {
mock->ioctl_expected.primeFdToHandle = 1;
mock->ioctl_expected.gemWait = 1;
mock->ioctl_expected.gemClose = 1;
mock->ioctl_expected.gemGetTiling = 1;
mock->ioctlExpected.primeFdToHandle = 1;
mock->ioctlExpected.gemWait = 1;
mock->ioctlExpected.gemClose = 1;
mock->ioctlExpected.gemGetTiling = 1;
auto ioctlHelper = this->mock->getIoctlHelper();
mock->getTilingModeOut = ioctlHelper->getDrmParamValue(DrmParam::TilingNone);
@@ -787,10 +787,10 @@ TEST_F(ClDrmMemoryManagerTest, givenOsHandleWithNonTiledObjectWhenCreateFromShar
}
TEST_F(ClDrmMemoryManagerTest, givenOsHandleWithTileYObjectWhenCreateFromSharedHandleIsCalledThenTileYGmmIsCreatedAndSetInAllocation) {
mock->ioctl_expected.primeFdToHandle = 1;
mock->ioctl_expected.gemWait = 1;
mock->ioctl_expected.gemClose = 1;
mock->ioctl_expected.gemGetTiling = 1;
mock->ioctlExpected.primeFdToHandle = 1;
mock->ioctlExpected.gemWait = 1;
mock->ioctlExpected.gemClose = 1;
mock->ioctlExpected.gemGetTiling = 1;
auto ioctlHelper = this->mock->getIoctlHelper();
mock->getTilingModeOut = ioctlHelper->getDrmParamValue(DrmParam::TilingY);
@@ -829,12 +829,12 @@ TEST_F(ClDrmMemoryManagerTest, givenOsHandleWithTileYObjectWhenCreateFromSharedH
}
TEST_F(ClDrmMemoryManagerTest, givenDrmMemoryManagerWhenCreateFromSharedHandleFailsToCallGetTilingThenNonLinearStorageIsAssumed) {
mock->ioctl_expected.primeFdToHandle = 1;
mock->ioctl_expected.gemGetTiling = 1;
mock->ioctl_expected.gemWait = 1;
mock->ioctl_expected.gemClose = 1;
this->ioctlResExt = {mock->ioctl_cnt.total + 1, -1};
mock->ioctl_res_ext = &ioctlResExt;
mock->ioctlExpected.primeFdToHandle = 1;
mock->ioctlExpected.gemGetTiling = 1;
mock->ioctlExpected.gemWait = 1;
mock->ioctlExpected.gemClose = 1;
this->ioctlResExt = {mock->ioctlCnt.total + 1, -1};
mock->ioctlResExt = &ioctlResExt;
osHandle handle = 1u;
uint32_t boHandle = 2u;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2022 Intel Corporation
* Copyright (C) 2020-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -20,7 +20,7 @@ namespace NEO {
using DrmVaSharingTest = Test<DrmMemoryManagerFixture>;
TEST_F(DrmVaSharingTest, givenDrmMemoryManagerWhenSharedVaSurfaceIsImportedWithDrmPrimeFdToHandleThenDrmPrimeFdCanBeClosed) {
mock->ioctl_expected.total = -1;
mock->ioctlExpected.total = -1;
device->incRefInternal();
MockClDevice clDevice{device};
MockContext context(&clDevice);

View File

@@ -549,12 +549,12 @@ HWCMDTEST_F(IGFX_GEN8_CORE, EventProfilingTest, givenEventWhenCompleteIsZeroThen
cmdQ.device = device.get();
HwTimeStamps timestamp;
timestamp.GlobalStartTS = 10;
timestamp.ContextStartTS = 20;
timestamp.GlobalEndTS = 80;
timestamp.ContextEndTS = 56;
timestamp.GlobalCompleteTS = 0;
timestamp.ContextCompleteTS = 0;
timestamp.globalStartTS = 10;
timestamp.contextStartTS = 20;
timestamp.globalEndTS = 80;
timestamp.contextEndTS = 56;
timestamp.globalCompleteTS = 0;
timestamp.contextCompleteTS = 0;
MockTagNode<HwTimeStamps> timestampNode;
timestampNode.tagForCpuAccess = &timestamp;
@@ -565,7 +565,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, EventProfilingTest, givenEventWhenCompleteIsZeroThen
event.timeStampNode = &timestampNode;
event.calcProfilingData();
EXPECT_EQ(timestamp.ContextEndTS, timestamp.ContextCompleteTS);
EXPECT_EQ(timestamp.contextEndTS, timestamp.contextCompleteTS);
cmdQ.device = nullptr;
event.timeStampNode = nullptr;
}
@@ -586,12 +586,12 @@ HWCMDTEST_F(IGFX_GEN8_CORE, EventProfilingTests, givenRawTimestampsDebugModeWhen
cmdQ.device = device.get();
HwTimeStamps timestamp;
timestamp.GlobalStartTS = 10;
timestamp.ContextStartTS = 20;
timestamp.GlobalEndTS = 80;
timestamp.ContextEndTS = 56;
timestamp.GlobalCompleteTS = 0;
timestamp.ContextCompleteTS = 70;
timestamp.globalStartTS = 10;
timestamp.contextStartTS = 20;
timestamp.globalEndTS = 80;
timestamp.contextEndTS = 56;
timestamp.globalCompleteTS = 0;
timestamp.contextCompleteTS = 70;
MockTagNode<HwTimeStamps> timestampNode;
timestampNode.tagForCpuAccess = &timestamp;
@@ -617,9 +617,9 @@ HWCMDTEST_F(IGFX_GEN8_CORE, EventProfilingTests, givenRawTimestampsDebugModeWhen
clGetEventProfilingInfo(clEvent, CL_PROFILING_COMMAND_END, sizeof(cl_ulong), &end, nullptr);
clGetEventProfilingInfo(clEvent, CL_PROFILING_COMMAND_COMPLETE, sizeof(cl_ulong), &complete, nullptr);
EXPECT_EQ(timestamp.ContextCompleteTS, complete);
EXPECT_EQ(timestamp.ContextEndTS, end);
EXPECT_EQ(timestamp.ContextStartTS, start);
EXPECT_EQ(timestamp.contextCompleteTS, complete);
EXPECT_EQ(timestamp.contextEndTS, end);
EXPECT_EQ(timestamp.contextStartTS, start);
EXPECT_EQ(event.submitTimeStamp.GPUTimeStamp, submited);
EXPECT_EQ(event.queueTimeStamp.GPUTimeStamp, queued);
event.timeStampNode = nullptr;
@@ -638,12 +638,12 @@ HWCMDTEST_F(IGFX_GEN8_CORE, EventProfilingTest, givenRawTimestampsDebugModeWhenS
cmdQ.device = device.get();
HwTimeStamps timestamp;
timestamp.GlobalStartTS = 0;
timestamp.ContextStartTS = 20;
timestamp.GlobalEndTS = 80;
timestamp.ContextEndTS = 56;
timestamp.GlobalCompleteTS = 0;
timestamp.ContextCompleteTS = 70;
timestamp.globalStartTS = 0;
timestamp.contextStartTS = 20;
timestamp.globalEndTS = 80;
timestamp.contextEndTS = 56;
timestamp.globalCompleteTS = 0;
timestamp.contextCompleteTS = 70;
MockTagNode<HwTimeStamps> timestampNode;
timestampNode.tagForCpuAccess = &timestamp;
@@ -1001,10 +1001,10 @@ HWCMDTEST_F(IGFX_GEN8_CORE, ProfilingWithPerfCountersTests, GivenCommandQueueWit
auto &cmdList = parse.cmdList;
parse.parseCommands<FamilyType>(*pCmdQ);
auto itor = expectStoreRegister<FamilyType>(cmdList, cmdList.begin(), timeStampGpuAddress + offsetof(HwTimeStamps, ContextStartTS), GP_THREAD_TIME_REG_ADDRESS_OFFSET_LOW);
auto itor = expectStoreRegister<FamilyType>(cmdList, cmdList.begin(), timeStampGpuAddress + offsetof(HwTimeStamps, contextStartTS), GP_THREAD_TIME_REG_ADDRESS_OFFSET_LOW);
// after WALKER:
itor = expectStoreRegister<FamilyType>(cmdList, itor, timeStampGpuAddress + offsetof(HwTimeStamps, ContextEndTS), GP_THREAD_TIME_REG_ADDRESS_OFFSET_LOW);
itor = expectStoreRegister<FamilyType>(cmdList, itor, timeStampGpuAddress + offsetof(HwTimeStamps, contextEndTS), GP_THREAD_TIME_REG_ADDRESS_OFFSET_LOW);
EXPECT_TRUE(pEvent->calcProfilingData());
@@ -1207,9 +1207,9 @@ TEST_F(ProfilingTimestampPacketsTest, givenTimestampsPacketContainerWithOneEleme
addTimestampNode(10, 11, 12, 13);
HwTimeStamps hwTimestamps;
hwTimestamps.ContextStartTS = 100;
hwTimestamps.ContextEndTS = 110;
hwTimestamps.GlobalStartTS = 120;
hwTimestamps.contextStartTS = 100;
hwTimestamps.contextEndTS = 110;
hwTimestamps.globalStartTS = 120;
MockTagNode<HwTimeStamps> hwTimestampsNode;
hwTimestampsNode.tagForCpuAccess = &hwTimestamps;

View File

@@ -69,7 +69,7 @@ class CreateFromGlTexture : public ::testing::Test {
tempMM.forceAllocationSize = imgInfo.size;
tempMM.forceGmm = gmm.get();
if (glSharing->m_textureInfoOutput.globalShareHandleMCS != 0) {
if (glSharing->textureInfoOutput.globalShareHandleMCS != 0) {
ImageDescriptor mcsImgDesc = {};
mcsImgDesc.imageHeight = 128;
mcsImgDesc.imageRowPitch = 256;
@@ -125,15 +125,15 @@ TEST_P(CreateFromGlTextureTestsWithParams, givenAllTextureSpecificParamsWhenCrea
if (target == GL_TEXTURE_BUFFER) {
// size and width for texture buffer are queried from textureInfo - not from gmm
glSharing->m_textureInfoOutput.textureBufferWidth = 64;
glSharing->m_textureInfoOutput.textureBufferSize = 1024;
glSharing->textureInfoOutput.textureBufferWidth = 64;
glSharing->textureInfoOutput.textureBufferSize = 1024;
glSharing->uploadDataToTextureInfo();
}
if (target == GL_TEXTURE_2D_MULTISAMPLE || target == GL_TEXTURE_2D_MULTISAMPLE_ARRAY) {
imgDesc.numSamples = 16;
glSharing->m_textureInfoOutput.numberOfSamples = 16;
glSharing->m_textureInfoOutput.globalShareHandleMCS = CreateFromGlTexture::mcsHandle;
glSharing->textureInfoOutput.numberOfSamples = 16;
glSharing->textureInfoOutput.globalShareHandleMCS = CreateFromGlTexture::mcsHandle;
glSharing->uploadDataToTextureInfo();
}

View File

@@ -47,8 +47,8 @@ class GlSharingTests : public ::testing::Test {
mockGlSharingFunctions = mockGlSharing->sharingFunctions.release();
context.setSharingFunctions(mockGlSharingFunctions);
mockGlSharing->m_bufferInfoOutput.globalShareHandle = bufferId;
mockGlSharing->m_bufferInfoOutput.bufferSize = 4096u;
mockGlSharing->bufferInfoOutput.globalShareHandle = bufferId;
mockGlSharing->bufferInfoOutput.bufferSize = 4096u;
mockGlSharing->uploadDataToBufferInfo();
}

View File

@@ -174,10 +174,10 @@ TEST_F(GlSharingTextureTests, givenMockGlWhenGlTextureIsCreatedFromIncorrectForm
TEST_F(GlSharingTextureTests, givenGmmResourceAsInputWhenTextureIsCreatedThenItHasGmmSet) {
cl_int retVal = CL_INVALID_VALUE;
glSharing->m_textureInfoOutput.globalShareHandle = textureId;
glSharing->m_textureInfoOutput.pGmmResInfo = this->tempMM->forceGmm->gmmResourceInfo->peekGmmResourceInfo();
glSharing->textureInfoOutput.globalShareHandle = textureId;
glSharing->textureInfoOutput.pGmmResInfo = this->tempMM->forceGmm->gmmResourceInfo->peekGmmResourceInfo();
this->tempMM->useForcedGmm = false;
glSharing->m_textureInfoOutput.pGmmResInfo = this->tempMM->forceGmm->gmmResourceInfo->peekGmmResourceInfo();
glSharing->textureInfoOutput.pGmmResInfo = this->tempMM->forceGmm->gmmResourceInfo->peekGmmResourceInfo();
glSharing->uploadDataToTextureInfo();

View File

@@ -65,7 +65,7 @@ class CreateFromGlTexture : public ::testing::Test {
tempMM.forceAllocationSize = imgInfo.size;
tempMM.forceGmm = gmm.get();
if (glSharing->m_textureInfoOutput.globalShareHandleMCS != 0) {
if (glSharing->textureInfoOutput.globalShareHandleMCS != 0) {
ImageDescriptor mcsImgDesc = {};
mcsImgDesc.imageHeight = 128;
mcsImgDesc.imageRowPitch = 256;
@@ -121,15 +121,15 @@ TEST_P(CreateFromGlTextureTestsWithParams, givenAllTextureSpecificParamsWhenCrea
if (target == GL_TEXTURE_BUFFER) {
// size and width for texture buffer are queried from textureInfo - not from gmm
glSharing->m_textureInfoOutput.textureBufferWidth = 64;
glSharing->m_textureInfoOutput.textureBufferSize = 1024;
glSharing->textureInfoOutput.textureBufferWidth = 64;
glSharing->textureInfoOutput.textureBufferSize = 1024;
glSharing->uploadDataToTextureInfo();
}
if (target == GL_TEXTURE_2D_MULTISAMPLE || target == GL_TEXTURE_2D_MULTISAMPLE_ARRAY) {
imgDesc.numSamples = 16;
glSharing->m_textureInfoOutput.numberOfSamples = 16;
glSharing->m_textureInfoOutput.globalShareHandleMCS = CreateFromGlTexture::mcsHandle;
glSharing->textureInfoOutput.numberOfSamples = 16;
glSharing->textureInfoOutput.globalShareHandleMCS = CreateFromGlTexture::mcsHandle;
glSharing->uploadDataToTextureInfo();
}

View File

@@ -48,8 +48,8 @@ class glSharingTests : public ::testing::Test {
mockGlSharingFunctions = mockGlSharing->sharingFunctions.release();
context.setSharingFunctions(mockGlSharingFunctions);
mockGlSharing->m_bufferInfoOutput.globalShareHandle = bufferId;
mockGlSharing->m_bufferInfoOutput.bufferSize = 4096u;
mockGlSharing->bufferInfoOutput.globalShareHandle = bufferId;
mockGlSharing->bufferInfoOutput.bufferSize = 4096u;
mockGlSharing->uploadDataToBufferInfo();
}
@@ -62,8 +62,8 @@ class glSharingTests : public ::testing::Test {
TEST_F(glSharingTests, givenGlMockWhenItIsCreatedThenNonZeroObjectIsReturned) {
EXPECT_NE(nullptr, &mockGlSharing);
EXPECT_NE(nullptr, &mockGlSharing->m_clGlResourceInfo);
EXPECT_NE(nullptr, &mockGlSharing->m_glClResourceInfo);
EXPECT_NE(nullptr, &mockGlSharing->clGlResourceInfo);
EXPECT_NE(nullptr, &mockGlSharing->glClResourceInfo);
}
TEST_F(glSharingTests, givenGLSharingFunctionsWhenAskedForIdThenClGlSharingIdIsReturned) {
@@ -256,7 +256,7 @@ TEST_F(glSharingTests, givenClGLBufferWhenItIsCreatedAndGmmIsAvailableThenItIsUs
auto rootDeviceIndex = context.getDevice(0)->getRootDeviceIndex();
auto gmm = new Gmm(context.getDevice(0)->getGmmHelper(), ptr, 4096u, 0, GMM_RESOURCE_USAGE_OCL_BUFFER, false, {}, true);
mockGlSharing->m_bufferInfoOutput.pGmmResInfo = gmm->gmmResourceInfo->peekGmmResourceInfo();
mockGlSharing->bufferInfoOutput.pGmmResInfo = gmm->gmmResourceInfo->peekGmmResourceInfo();
mockGlSharing->uploadDataToBufferInfo();
auto retVal = CL_SUCCESS;
@@ -314,14 +314,14 @@ TEST_F(glSharingTests, givenClGLBufferWhenItIsAcquiredWithDifferentOffsetThenGra
auto graphicsAddress = memObject->getGraphicsAllocation(rootDeviceIndex)->getGpuAddress();
mockGlSharing->m_bufferInfoOutput.bufferOffset = 50u;
mockGlSharing->bufferInfoOutput.bufferOffset = 50u;
mockGlSharing->uploadDataToBufferInfo();
memObject->peekSharingHandler()->acquire(memObject, rootDeviceIndex);
auto offsetedGraphicsAddress = memObject->getGraphicsAllocation(rootDeviceIndex)->getGpuAddress();
EXPECT_EQ(offsetedGraphicsAddress, graphicsAddress + mockGlSharing->m_bufferInfoOutput.bufferOffset);
EXPECT_EQ(offsetedGraphicsAddress, graphicsAddress + mockGlSharing->bufferInfoOutput.bufferOffset);
retVal = clReleaseMemObject(glBuffer);
EXPECT_EQ(CL_SUCCESS, retVal);
@@ -609,7 +609,7 @@ HWTEST_F(glSharingTests, givenCommandQueueWhenReleaseGlObjectIsCalledThenFinishI
}
TEST_F(glSharingTests, givenMockGLWhenFunctionsAreCalledThenCallsAreReceived) {
auto ptrToStruct = &mockGlSharing->m_clGlResourceInfo;
auto ptrToStruct = &mockGlSharing->clGlResourceInfo;
auto glDisplay = (GLDisplay)1;
auto glContext = (GLContext)1;
mockGlSharing->overrideGetCurrentValues(glContext, glDisplay);

View File

@@ -192,10 +192,10 @@ TEST_F(GlSharingTextureTests, givenMockGlWhenRenderBufferTextureIsCreatedThenMem
TEST_F(GlSharingTextureTests, givenGmmResourceAsInputWhenTextureIsCreatedThenItHasGmmSet) {
cl_int retVal = CL_INVALID_VALUE;
glSharing->m_textureInfoOutput.globalShareHandle = textureId;
glSharing->m_textureInfoOutput.pGmmResInfo = this->tempMM->forceGmm->gmmResourceInfo->peekGmmResourceInfo();
glSharing->textureInfoOutput.globalShareHandle = textureId;
glSharing->textureInfoOutput.pGmmResInfo = this->tempMM->forceGmm->gmmResourceInfo->peekGmmResourceInfo();
this->tempMM->useForcedGmm = false;
glSharing->m_textureInfoOutput.pGmmResInfo = this->tempMM->forceGmm->gmmResourceInfo->peekGmmResourceInfo();
glSharing->textureInfoOutput.pGmmResInfo = this->tempMM->forceGmm->gmmResourceInfo->peekGmmResourceInfo();
glSharing->uploadDataToTextureInfo();
@@ -220,8 +220,8 @@ TEST_F(GlSharingTextureTests, givenDifferentHwFormatWhenSurfaceFormatInfoIsSetTh
EXPECT_TRUE(format->surfaceFormat.GenxSurfaceFormat != newHwFormat);
glSharing->m_textureInfoOutput.glHWFormat = newHwFormat;
glSharing->m_textureInfoOutput.glInternalFormat = GL_DEPTH32F_STENCIL8;
glSharing->textureInfoOutput.glHWFormat = newHwFormat;
glSharing->textureInfoOutput.glInternalFormat = GL_DEPTH32F_STENCIL8;
glSharing->uploadDataToTextureInfo();
@@ -234,8 +234,8 @@ TEST_F(GlSharingTextureTests, givenDifferentHwFormatWhenSurfaceFormatInfoIsSetTh
TEST_F(GlSharingTextureTests, givenGLRGB10FormatWhenSharedGlTextureIsCreatedThenItHasCorrectGenxSurfaceFormatAssigned) {
cl_int retVal = CL_INVALID_VALUE;
glSharing->m_textureInfoOutput.glInternalFormat = GL_RGB10;
glSharing->m_textureInfoOutput.glHWFormat = GFX3DSTATE_SURFACEFORMAT_R16G16B16X16_UNORM;
glSharing->textureInfoOutput.glInternalFormat = GL_RGB10;
glSharing->textureInfoOutput.glHWFormat = GFX3DSTATE_SURFACEFORMAT_R16G16B16X16_UNORM;
glSharing->uploadDataToTextureInfo();
std::unique_ptr<Image> glTexture(GlTexture::createSharedGlTexture(clContext.get(), CL_MEM_READ_ONLY, GL_TEXTURE_2D, 0, textureId, &retVal));
@@ -479,7 +479,7 @@ TEST_F(GlSharingTextureTests, givenSharedRenderBufferWhenItIsAcquireCountIsDecre
TEST_F(GlSharingTextureTests, givenMultisampleTextureWithMoreThanOneSampleWhenAskedForNumSamplesThenReturnCorrectValue) {
GLsizei expectedNumSamples = 2;
glSharing->m_textureInfoOutput.numberOfSamples = expectedNumSamples;
glSharing->textureInfoOutput.numberOfSamples = expectedNumSamples;
glSharing->uploadDataToTextureInfo();
std::unique_ptr<Image> image(GlTexture::createSharedGlTexture(clContext.get(), CL_MEM_READ_WRITE, GL_TEXTURE_2D_MULTISAMPLE, 0, textureId, nullptr));
@@ -493,7 +493,7 @@ TEST_F(GlSharingTextureTests, givenMultisampleTextureWithMoreThanOneSampleWhenAs
}
TEST_F(GlSharingTextureTests, givenTextureWithOneSampleWhenAskedForNumSamplesThenReturnZero) {
glSharing->m_textureInfoOutput.numberOfSamples = 1;
glSharing->textureInfoOutput.numberOfSamples = 1;
glSharing->uploadDataToTextureInfo();
std::unique_ptr<Image> image(GlTexture::createSharedGlTexture(clContext.get(), CL_MEM_READ_WRITE, GL_TEXTURE_2D_MULTISAMPLE, 0, textureId, nullptr));
@@ -507,7 +507,7 @@ TEST_F(GlSharingTextureTests, givenTextureWithOneSampleWhenAskedForNumSamplesThe
}
TEST_F(GlSharingTextureTests, givenTextureWithZeroSamplesWhenAskedForNumSamplesThenReturnZero) {
glSharing->m_textureInfoOutput.numberOfSamples = 0;
glSharing->textureInfoOutput.numberOfSamples = 0;
glSharing->uploadDataToTextureInfo();
std::unique_ptr<Image> image(GlTexture::createSharedGlTexture(clContext.get(), CL_MEM_READ_WRITE, GL_TEXTURE_2D_MULTISAMPLE, 0, textureId, nullptr));