refactor: correct variable naming
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
parent
824cdfa585
commit
c3d3a4db1f
|
@ -27,8 +27,8 @@ static DestroyableZeUniquePtr<T> zeUniquePtr(T *object) {
|
|||
return DestroyableZeUniquePtr<T>{object};
|
||||
}
|
||||
|
||||
template <class _Ty, class... _Types>
|
||||
inline DestroyableZeUniquePtr<_Ty> makeZeUniquePtr(_Types &&...args) {
|
||||
return (DestroyableZeUniquePtr<_Ty>(new _Ty(std::forward<_Types>(args)...)));
|
||||
template <class Type, class... Types>
|
||||
inline DestroyableZeUniquePtr<Type> makeZeUniquePtr(Types &&...args) {
|
||||
return (DestroyableZeUniquePtr<Type>(new Type(std::forward<Types>(args)...)));
|
||||
}
|
||||
} // namespace NEO
|
||||
|
|
|
@ -19,10 +19,9 @@ namespace NEO {
|
|||
|
||||
namespace ClDeviceInfoTable {
|
||||
|
||||
template <cl_device_info clDeviceInfoParam, typename _Type, _Type ClDeviceInfo::*val>
|
||||
template <cl_device_info clDeviceInfoParam, typename Type, Type ClDeviceInfo::*val>
|
||||
struct ClMapBase {
|
||||
enum { param = clDeviceInfoParam };
|
||||
typedef _Type Type;
|
||||
enum { size = sizeof(Type) };
|
||||
|
||||
static const Type &getValue(const NEO::ClDevice &clDevice) {
|
||||
|
@ -30,10 +29,9 @@ struct ClMapBase {
|
|||
}
|
||||
};
|
||||
|
||||
template <cl_device_info clDeviceInfoParam, typename _Type, _Type DeviceInfo::*val>
|
||||
template <cl_device_info clDeviceInfoParam, typename Type, Type DeviceInfo::*val>
|
||||
struct MapBase {
|
||||
enum { param = clDeviceInfoParam };
|
||||
typedef _Type Type;
|
||||
enum { size = sizeof(Type) };
|
||||
|
||||
static const Type &getValue(const NEO::ClDevice &clDevice) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2018-2022 Intel Corporation
|
||||
* Copyright (C) 2018-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
|
@ -127,8 +127,8 @@ inline void getQueueInfo(cl_command_queue commandQueue,
|
|||
}
|
||||
}
|
||||
|
||||
template <typename returnType>
|
||||
returnType getCmdQueueProperties(const cl_queue_properties *properties,
|
||||
template <typename ReturnType>
|
||||
ReturnType getCmdQueueProperties(const cl_queue_properties *properties,
|
||||
cl_queue_properties propertyName = CL_QUEUE_PROPERTIES,
|
||||
bool *foundValue = nullptr) {
|
||||
if (properties != nullptr) {
|
||||
|
@ -137,7 +137,7 @@ returnType getCmdQueueProperties(const cl_queue_properties *properties,
|
|||
if (foundValue) {
|
||||
*foundValue = true;
|
||||
}
|
||||
return static_cast<returnType>(*(properties + 1));
|
||||
return static_cast<ReturnType>(*(properties + 1));
|
||||
}
|
||||
properties += 2;
|
||||
}
|
||||
|
|
|
@ -190,14 +190,14 @@ TEST_P(EnqueueMapReadBufferTests, GivenInvalidFlagsWhenMappingBufferForReadingTh
|
|||
clReleaseEvent(eventReturned);
|
||||
}
|
||||
|
||||
static cl_mem_flags NoReadAccessFlags[] = {
|
||||
static cl_mem_flags noReadAccessFlags[] = {
|
||||
CL_MEM_USE_HOST_PTR | CL_MEM_HOST_WRITE_ONLY,
|
||||
CL_MEM_USE_HOST_PTR | CL_MEM_HOST_NO_ACCESS};
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
EnqueueMapBufferFlagsTests_Create,
|
||||
EnqueueMapReadBufferTests,
|
||||
testing::ValuesIn(NoReadAccessFlags));
|
||||
testing::ValuesIn(noReadAccessFlags));
|
||||
|
||||
typedef EnqueueMapBufferFlagsTest EnqueueMapWriteBufferTests;
|
||||
|
||||
|
@ -219,11 +219,11 @@ TEST_P(EnqueueMapWriteBufferTests, GivenInvalidFlagsWhenMappingBufferForWritingT
|
|||
clReleaseEvent(eventReturned);
|
||||
}
|
||||
|
||||
static cl_mem_flags NoWriteAccessFlags[] = {
|
||||
static cl_mem_flags noWriteAccessFlags[] = {
|
||||
CL_MEM_USE_HOST_PTR | CL_MEM_HOST_READ_ONLY,
|
||||
CL_MEM_USE_HOST_PTR | CL_MEM_HOST_NO_ACCESS};
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
EnqueueMapBufferFlagsTests_Create,
|
||||
EnqueueMapWriteBufferTests,
|
||||
testing::ValuesIn(NoWriteAccessFlags));
|
||||
testing::ValuesIn(noWriteAccessFlags));
|
||||
|
|
|
@ -330,12 +330,12 @@ TEST_P(EnqueueReadReadBufferRectTests, GivenNoReadFlagsWhenReadingRectangularReg
|
|||
clReleaseEvent(eventReturned);
|
||||
}
|
||||
|
||||
static cl_mem_flags read_buffer_rect_flags[] = {
|
||||
static cl_mem_flags readBufferRectFlags[] = {
|
||||
CL_MEM_USE_HOST_PTR | CL_MEM_HOST_WRITE_ONLY,
|
||||
CL_MEM_USE_HOST_PTR | CL_MEM_HOST_NO_ACCESS};
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
EnqueueReadBufferRectFlagsTests_Create,
|
||||
EnqueueReadReadBufferRectTests,
|
||||
testing::ValuesIn(read_buffer_rect_flags));
|
||||
testing::ValuesIn(readBufferRectFlags));
|
||||
} // namespace ULT
|
||||
|
|
|
@ -125,14 +125,14 @@ TEST_P(EnqueueReadReadBufferTests, GivenNoReadFlagsWhenReadingBufferThenInvalidO
|
|||
clReleaseEvent(eventReturned);
|
||||
}
|
||||
|
||||
static cl_mem_flags read_buffer_flags[] = {
|
||||
static cl_mem_flags readBufferFlags[] = {
|
||||
CL_MEM_USE_HOST_PTR | CL_MEM_HOST_WRITE_ONLY,
|
||||
CL_MEM_USE_HOST_PTR | CL_MEM_HOST_NO_ACCESS};
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
EnqueueReadBufferFlagsTests_Create,
|
||||
EnqueueReadReadBufferTests,
|
||||
testing::ValuesIn(read_buffer_flags));
|
||||
testing::ValuesIn(readBufferFlags));
|
||||
} // namespace ULT
|
||||
|
||||
class EnqueueReadBufferTest : public ApiTests {
|
||||
|
|
|
@ -32,7 +32,7 @@ class EventFixture : public ApiFixture<>, public T {
|
|||
|
||||
typedef EventFixture<::testing::Test> clEventProfilingTests;
|
||||
|
||||
cl_int ProfilingInfo[] = {
|
||||
cl_int profilingInfo[] = {
|
||||
CL_PROFILING_COMMAND_QUEUED,
|
||||
CL_PROFILING_COMMAND_SUBMIT,
|
||||
CL_PROFILING_COMMAND_START,
|
||||
|
@ -88,7 +88,7 @@ TEST_F(clEventProfilingTests, GivenInvalidParamValueSizeWhenGettingEventProfilin
|
|||
cl_event event = (cl_event)pEvent;
|
||||
pEvent->setProfilingEnabled(true);
|
||||
retVal = clGetEventProfilingInfo(event,
|
||||
ProfilingInfo[0],
|
||||
profilingInfo[0],
|
||||
paramValueSize - 1,
|
||||
¶mValue,
|
||||
¶mValueSizeRet);
|
||||
|
@ -106,7 +106,7 @@ TEST_F(clEventProfilingTests, GivenValidParametersWhenGettingEventProfilingInfoT
|
|||
|
||||
cl_event event = (cl_event)pEvent;
|
||||
pEvent->setProfilingEnabled(true);
|
||||
for (auto infoId : ::ProfilingInfo) {
|
||||
for (auto infoId : ::profilingInfo) {
|
||||
cl_int retVal = clGetEventProfilingInfo(event,
|
||||
infoId,
|
||||
paramValueSize,
|
||||
|
@ -128,7 +128,7 @@ TEST_F(clEventProfilingTests, GivenNullParamValueSizeRetWhenGettingEventProfilin
|
|||
pEvent->setProfilingEnabled(true);
|
||||
|
||||
cl_int retVal = clGetEventProfilingInfo(event,
|
||||
ProfilingInfo[0],
|
||||
profilingInfo[0],
|
||||
paramValueSize,
|
||||
¶mValue,
|
||||
nullptr);
|
||||
|
@ -188,7 +188,7 @@ TEST_F(clEventProfilingTests, GivenUserEventWhenGettingEventProfilingInfoThenPro
|
|||
size_t paramValueSizeRet;
|
||||
|
||||
cl_event event = (cl_event)ue;
|
||||
for (auto infoId : ::ProfilingInfo) {
|
||||
for (auto infoId : ::profilingInfo) {
|
||||
cl_int retVal = clGetEventProfilingInfo(event,
|
||||
infoId,
|
||||
paramValueSize,
|
||||
|
|
|
@ -52,7 +52,7 @@ struct TestParam {
|
|||
size_t gwsX;
|
||||
size_t gwsY;
|
||||
size_t gwsZ;
|
||||
} KernelSubGroupInfoKhrWGS[] = {
|
||||
} kernelSubGroupInfoKhrWGS[] = {
|
||||
{0, 0, 0},
|
||||
{1, 1, 1},
|
||||
{1, 5, 1},
|
||||
|
@ -68,7 +68,7 @@ typedef KernelSubGroupInfoKhrParamFixture<TestParam> KernelSubGroupInfoKhrReturn
|
|||
|
||||
INSTANTIATE_TEST_CASE_P(wgs,
|
||||
KernelSubGroupInfoKhrReturnSizeTest,
|
||||
::testing::ValuesIn(KernelSubGroupInfoKhrWGS));
|
||||
::testing::ValuesIn(kernelSubGroupInfoKhrWGS));
|
||||
|
||||
TEST_P(KernelSubGroupInfoKhrReturnSizeTest, GivenLwsParameterWhenGettingMaxSubGroupSizeThenCorrectValueIsReturned) {
|
||||
paramValueSizeRet = 0;
|
||||
|
@ -93,7 +93,7 @@ typedef KernelSubGroupInfoKhrParamFixture<TestParam> KernelSubGroupInfoKhrReturn
|
|||
|
||||
INSTANTIATE_TEST_CASE_P(wgs,
|
||||
KernelSubGroupInfoKhrReturnCountTest,
|
||||
::testing::ValuesIn(KernelSubGroupInfoKhrWGS));
|
||||
::testing::ValuesIn(kernelSubGroupInfoKhrWGS));
|
||||
|
||||
TEST_P(KernelSubGroupInfoKhrReturnCountTest, GivenLwsParameterWhenGettingSubGroupCountThenCorrectValueIsReturned) {
|
||||
paramValueSizeRet = 0;
|
||||
|
@ -220,7 +220,7 @@ TEST_F(KernelSubGroupInfoKhrTest, GivenInvalidParamNameWhenGettingKernelSubGroup
|
|||
EXPECT_EQ(retVal, CL_INVALID_VALUE);
|
||||
}
|
||||
|
||||
uint32_t /*cl_kernel_sub_group_info_khr*/ KernelSubGroupInfoKhrInputParams[] = {
|
||||
uint32_t /*cl_kernel_sub_group_info_khr*/ kernelSubGroupInfoKhrInputParams[] = {
|
||||
CL_KERNEL_MAX_SUB_GROUP_SIZE_FOR_NDRANGE_KHR,
|
||||
CL_KERNEL_SUB_GROUP_COUNT_FOR_NDRANGE_KHR};
|
||||
|
||||
|
@ -228,7 +228,7 @@ typedef KernelSubGroupInfoKhrParamFixture<uint32_t /*cl_kernel_sub_group_info_kh
|
|||
|
||||
INSTANTIATE_TEST_CASE_P(KernelSubGroupInfoKhrInputParams,
|
||||
KernelSubGroupInfoKhrInputParamsTest,
|
||||
::testing::ValuesIn(KernelSubGroupInfoKhrInputParams));
|
||||
::testing::ValuesIn(kernelSubGroupInfoKhrInputParams));
|
||||
|
||||
TEST_P(KernelSubGroupInfoKhrInputParamsTest, GivenInvalidInputWhenGettingKernelSubGroupInfoThenInvalidValueErrorIsReturned) {
|
||||
// work dim == 0
|
||||
|
|
|
@ -67,13 +67,13 @@ struct KernelSubGroupInfoParamFixture : KernelSubGroupInfoFixture,
|
|||
}
|
||||
};
|
||||
|
||||
static size_t WorkDimensions[] = {1, 2, 3};
|
||||
static size_t workDimensions[] = {1, 2, 3};
|
||||
|
||||
static struct WorkSizeParam {
|
||||
size_t x;
|
||||
size_t y;
|
||||
size_t z;
|
||||
} KernelSubGroupInfoWGS[] = {
|
||||
} kernelSubGroupInfoWGS[] = {
|
||||
{0, 0, 0},
|
||||
{1, 1, 1},
|
||||
{1, 5, 1},
|
||||
|
@ -90,8 +90,8 @@ typedef KernelSubGroupInfoParamFixture<std::tuple<WorkSizeParam, size_t>> Kernel
|
|||
INSTANTIATE_TEST_CASE_P(wgs,
|
||||
KernelSubGroupInfoReturnSizeTest,
|
||||
::testing::Combine(
|
||||
::testing::ValuesIn(KernelSubGroupInfoWGS),
|
||||
::testing::ValuesIn(WorkDimensions)));
|
||||
::testing::ValuesIn(kernelSubGroupInfoWGS),
|
||||
::testing::ValuesIn(workDimensions)));
|
||||
|
||||
TEST_P(KernelSubGroupInfoReturnSizeTest, GivenWorkGroupSizeWhenGettingMaxSubGroupSizeThenReturnIsCalculatedCorrectly) {
|
||||
REQUIRE_OCL_21_OR_SKIP(defaultHwInfo);
|
||||
|
@ -132,8 +132,8 @@ typedef KernelSubGroupInfoParamFixture<std::tuple<WorkSizeParam, size_t>> Kernel
|
|||
INSTANTIATE_TEST_CASE_P(wgs,
|
||||
KernelSubGroupInfoReturnCountTest,
|
||||
::testing::Combine(
|
||||
::testing::ValuesIn(KernelSubGroupInfoWGS),
|
||||
::testing::ValuesIn(WorkDimensions)));
|
||||
::testing::ValuesIn(kernelSubGroupInfoWGS),
|
||||
::testing::ValuesIn(workDimensions)));
|
||||
|
||||
TEST_P(KernelSubGroupInfoReturnCountTest, GivenWorkGroupSizeWhenGettingSubGroupCountThenReturnIsCalculatedCorrectly) {
|
||||
REQUIRE_OCL_21_OR_SKIP(defaultHwInfo);
|
||||
|
@ -181,15 +181,15 @@ TEST_P(KernelSubGroupInfoReturnCountTest, GivenWorkGroupSizeWhenGettingSubGroupC
|
|||
}
|
||||
}
|
||||
|
||||
static size_t SubGroupsNumbers[] = {0, 1, 10, 12, 21, 33, 67, 99};
|
||||
static size_t subGroupsNumbers[] = {0, 1, 10, 12, 21, 33, 67, 99};
|
||||
|
||||
typedef KernelSubGroupInfoParamFixture<std::tuple<size_t, size_t>> KernelSubGroupInfoReturnLocalSizeTest;
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(sgn,
|
||||
KernelSubGroupInfoReturnLocalSizeTest,
|
||||
::testing::Combine(
|
||||
::testing::ValuesIn(SubGroupsNumbers),
|
||||
::testing::ValuesIn(WorkDimensions)));
|
||||
::testing::ValuesIn(subGroupsNumbers),
|
||||
::testing::ValuesIn(workDimensions)));
|
||||
|
||||
TEST_P(KernelSubGroupInfoReturnLocalSizeTest, GivenWorkGroupSizeWhenGettingLocalSizeThenReturnIsCalculatedCorrectly) {
|
||||
REQUIRE_OCL_21_OR_SKIP(defaultHwInfo);
|
||||
|
@ -372,7 +372,7 @@ TEST_F(KernelSubGroupInfoTest, GivenInvalidParamNameWhenGettingSubGroupInfoThenI
|
|||
EXPECT_EQ(CL_INVALID_VALUE, retVal);
|
||||
}
|
||||
|
||||
uint32_t /*cl_kernel_sub_group_info*/ KernelSubGroupInfoInputParams[] = {
|
||||
uint32_t /*cl_kernel_sub_group_info*/ kernelSubGroupInfoInputParams[] = {
|
||||
CL_KERNEL_MAX_SUB_GROUP_SIZE_FOR_NDRANGE,
|
||||
CL_KERNEL_SUB_GROUP_COUNT_FOR_NDRANGE,
|
||||
CL_KERNEL_LOCAL_SIZE_FOR_SUB_GROUP_COUNT,
|
||||
|
@ -384,7 +384,7 @@ typedef KernelSubGroupInfoParamFixture<uint32_t /*cl_kernel_sub_group_info*/> Ke
|
|||
|
||||
INSTANTIATE_TEST_CASE_P(KernelSubGroupInfoInputParams,
|
||||
KernelSubGroupInfoInputParamsTest,
|
||||
::testing::ValuesIn(KernelSubGroupInfoInputParams));
|
||||
::testing::ValuesIn(kernelSubGroupInfoInputParams));
|
||||
|
||||
TEST_P(KernelSubGroupInfoInputParamsTest, GivenOpenClVersionLowerThan21WhenGettingKenrelSubGroupInfoThenInvalidOperationErrorIsReturned) {
|
||||
bool requireOpenCL21 = (GetParam() == CL_KERNEL_LOCAL_SIZE_FOR_SUB_GROUP_COUNT) ||
|
||||
|
|
|
@ -93,7 +93,7 @@ TEST_P(ClSVMAllocValidFlagsTests, GivenSvmSupportWhenAllocatingSvmThenSvmIsAlloc
|
|||
}
|
||||
};
|
||||
|
||||
static cl_mem_flags SVMAllocValidFlags[] = {
|
||||
static cl_mem_flags svmAllocValidFlags[] = {
|
||||
0,
|
||||
CL_MEM_READ_WRITE,
|
||||
CL_MEM_WRITE_ONLY,
|
||||
|
@ -110,14 +110,14 @@ static cl_mem_flags SVMAllocValidFlags[] = {
|
|||
INSTANTIATE_TEST_CASE_P(
|
||||
SVMAllocCheckFlags,
|
||||
ClSVMAllocValidFlagsTests,
|
||||
testing::ValuesIn(SVMAllocValidFlags));
|
||||
testing::ValuesIn(svmAllocValidFlags));
|
||||
|
||||
using ClSVMAllocFtrFlagsTests = ClSvmAllocTemplateTests;
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
SVMAllocCheckFlagsFtrFlags,
|
||||
ClSVMAllocFtrFlagsTests,
|
||||
testing::ValuesIn(SVMAllocValidFlags));
|
||||
testing::ValuesIn(svmAllocValidFlags));
|
||||
|
||||
TEST_P(ClSVMAllocFtrFlagsTests, GivenCorrectFlagsWhenAllocatingSvmThenSvmIsAllocated) {
|
||||
HardwareInfo *pHwInfo = pDevice->getExecutionEnvironment()->rootDeviceEnvironments[testedRootDeviceIndex]->getMutableHardwareInfo();
|
||||
|
@ -161,7 +161,7 @@ TEST_P(ClSVMAllocInvalidFlagsTests, GivenInvalidFlagsWhenAllocatingSvmThenSvmIsN
|
|||
EXPECT_EQ(nullptr, svmPtr);
|
||||
};
|
||||
|
||||
cl_mem_flags SVMAllocInvalidFlags[] = {
|
||||
cl_mem_flags svmAllocInvalidFlags[] = {
|
||||
CL_MEM_READ_WRITE | CL_MEM_WRITE_ONLY,
|
||||
CL_MEM_WRITE_ONLY | CL_MEM_READ_ONLY,
|
||||
CL_MEM_SVM_ATOMICS,
|
||||
|
@ -170,7 +170,7 @@ cl_mem_flags SVMAllocInvalidFlags[] = {
|
|||
INSTANTIATE_TEST_CASE_P(
|
||||
SVMAllocCheckFlags,
|
||||
ClSVMAllocInvalidFlagsTests,
|
||||
testing::ValuesIn(SVMAllocInvalidFlags));
|
||||
testing::ValuesIn(svmAllocInvalidFlags));
|
||||
|
||||
TEST_F(ClSVMAllocTests, GivenNullContextWhenAllocatingSvmThenSvmIsNotAllocated) {
|
||||
cl_mem_flags flags = CL_MEM_READ_WRITE;
|
||||
|
|
|
@ -89,9 +89,9 @@ HWTEST2_F(ResourceBarrierAubTest, givenAllocationsWhenEnqueueResourceBarrierCall
|
|||
std::string err;
|
||||
auto cmdBuffOk = expectCmdBuff<FamilyType>(l3FlushCmdStream, sizeUsed,
|
||||
std::vector<MatchCmd *>{
|
||||
new MatchAnyCmd(AnyNumber),
|
||||
new MatchAnyCmd(anyNumber),
|
||||
new MatchHwCmd<FamilyType, L3_CONTROL>(1),
|
||||
new MatchAnyCmd(AnyNumber),
|
||||
new MatchAnyCmd(anyNumber),
|
||||
},
|
||||
&err);
|
||||
EXPECT_TRUE(cmdBuffOk) << err;
|
||||
|
|
|
@ -117,7 +117,7 @@ HWTEST2_F(RangeBasedFlushTest, givenNoDcFlushInPipeControlWhenL3ControlFlushesCa
|
|||
std::string err;
|
||||
|
||||
std::vector<MatchCmd *> expectedCommands{
|
||||
new MatchAnyCmd(AnyNumber),
|
||||
new MatchAnyCmd(anyNumber),
|
||||
new MatchHwCmd<FamilyType, PIPE_CONTROL>(1, Expects{EXPECT_MEMBER(PIPE_CONTROL, getCommandStreamerStallEnable, true), EXPECT_MEMBER(PIPE_CONTROL, getDcFlushEnable, false)}),
|
||||
new MatchHwCmd<FamilyType, L3_CONTROL>(1, Expects{EXPECT_MEMBER(L3_CONTROL, getPostSyncOperation, L3_CONTROL::POST_SYNC_OPERATION::POST_SYNC_OPERATION_NO_WRITE)}),
|
||||
};
|
||||
|
@ -128,7 +128,7 @@ HWTEST2_F(RangeBasedFlushTest, givenNoDcFlushInPipeControlWhenL3ControlFlushesCa
|
|||
}
|
||||
}
|
||||
expectedCommands.push_back(new MatchHwCmd<FamilyType, PIPE_CONTROL>(1, Expects{EXPECT_MEMBER(PIPE_CONTROL, getDcFlushEnable, false)}));
|
||||
expectedCommands.push_back(new MatchAnyCmd(AnyNumber));
|
||||
expectedCommands.push_back(new MatchAnyCmd(anyNumber));
|
||||
expectedCommands.push_back(new MatchHwCmd<FamilyType, PIPE_CONTROL>(0));
|
||||
|
||||
auto cmdBuffOk = expectCmdBuff<FamilyType>(l3FlushCmdStream, 0, std::move(expectedCommands), &err);
|
||||
|
@ -213,11 +213,11 @@ HWTEST2_F(RangeBasedFlushTest, givenL3ControlWhenPostSyncIsSetThenExpectPostSync
|
|||
std::string err;
|
||||
auto cmdBuffOk = expectCmdBuff<FamilyType>(l3FlushCmdStream, 0,
|
||||
std::vector<MatchCmd *>{
|
||||
new MatchAnyCmd(AnyNumber),
|
||||
new MatchAnyCmd(anyNumber),
|
||||
new MatchHwCmd<FamilyType, PIPE_CONTROL>(1, Expects{EXPECT_MEMBER(PIPE_CONTROL, getCommandStreamerStallEnable, true), EXPECT_MEMBER(PIPE_CONTROL, getDcFlushEnable, false)}),
|
||||
new MatchHwCmd<FamilyType, L3_CONTROL>(1, Expects{EXPECT_MEMBER(L3_CONTROL, getPostSyncOperation, L3_CONTROL::POST_SYNC_OPERATION::POST_SYNC_OPERATION_WRITE_IMMEDIATE_DATA)}),
|
||||
new MatchHwCmd<FamilyType, PIPE_CONTROL>(1, Expects{EXPECT_MEMBER(PIPE_CONTROL, getDcFlushEnable, false)}), // epilogue
|
||||
new MatchAnyCmd(AnyNumber),
|
||||
new MatchAnyCmd(anyNumber),
|
||||
new MatchHwCmd<FamilyType, PIPE_CONTROL>(0),
|
||||
},
|
||||
&err);
|
||||
|
|
|
@ -117,8 +117,8 @@ struct BlitEnqueueTests : public ::testing::Test {
|
|||
template <typename FamilyType>
|
||||
void tearDownT() {}
|
||||
|
||||
template <size_t N>
|
||||
void setMockKernelArgs(std::array<Buffer *, N> buffers) {
|
||||
template <size_t n>
|
||||
void setMockKernelArgs(std::array<Buffer *, n> buffers) {
|
||||
for (uint32_t i = 0; i < buffers.size(); i++) {
|
||||
mockKernel->kernelInfo.addArgBuffer(i, 0);
|
||||
}
|
||||
|
@ -132,8 +132,8 @@ struct BlitEnqueueTests : public ::testing::Test {
|
|||
}
|
||||
}
|
||||
|
||||
template <size_t N>
|
||||
void setMockKernelArgs(std::array<GraphicsAllocation *, N> allocs) {
|
||||
template <size_t n>
|
||||
void setMockKernelArgs(std::array<GraphicsAllocation *, n> allocs) {
|
||||
for (uint32_t i = 0; i < allocs.size(); i++) {
|
||||
mockKernel->kernelInfo.addArgBuffer(i, 0);
|
||||
}
|
||||
|
|
|
@ -550,11 +550,11 @@ HWTEST_F(TimestampPacketTests, givenTimestampPacketWriteEnabledWhenEnqueueingThe
|
|||
|
||||
EXPECT_EQ(expectedQueueSemaphoresCount, queueSemaphores.size());
|
||||
ASSERT_GE(queueSemaphores.size(), 5u);
|
||||
verifySemaphore(genCmdCast<MI_SEMAPHORE_WAIT *>(*(queueSemaphores[0])), timestamp3.getNode(0), 0);
|
||||
verifySemaphore(genCmdCast<MI_SEMAPHORE_WAIT *>(*(queueSemaphores[1])), timestamp5.getNode(0), 0);
|
||||
verifySemaphore(genCmdCast<MI_SEMAPHORE_WAIT *>(*(queueSemaphores[2])), timestamp4.getNode(0), 0);
|
||||
verifySemaphore(genCmdCast<MI_SEMAPHORE_WAIT *>(*(queueSemaphores[3])), timestamp6.getNode(0), 0);
|
||||
verifySemaphore(genCmdCast<MI_SEMAPHORE_WAIT *>(*(queueSemaphores[4])), timestamp6.getNode(1), 0);
|
||||
verifySemaphore<FamilyType>(genCmdCast<MI_SEMAPHORE_WAIT *>(*(queueSemaphores[0])), timestamp3.getNode(0), 0);
|
||||
verifySemaphore<FamilyType>(genCmdCast<MI_SEMAPHORE_WAIT *>(*(queueSemaphores[1])), timestamp5.getNode(0), 0);
|
||||
verifySemaphore<FamilyType>(genCmdCast<MI_SEMAPHORE_WAIT *>(*(queueSemaphores[2])), timestamp4.getNode(0), 0);
|
||||
verifySemaphore<FamilyType>(genCmdCast<MI_SEMAPHORE_WAIT *>(*(queueSemaphores[3])), timestamp6.getNode(0), 0);
|
||||
verifySemaphore<FamilyType>(genCmdCast<MI_SEMAPHORE_WAIT *>(*(queueSemaphores[4])), timestamp6.getNode(1), 0);
|
||||
}
|
||||
|
||||
HWTEST_F(TimestampPacketTests, givenTimestampPacketWriteEnabledWhenEnqueueingThenTrackOwnershipUntilQueueIsCompleted) {
|
||||
|
@ -1239,11 +1239,11 @@ HWTEST_F(TimestampPacketTests, givenTimestampPacketWriteEnabledOnDifferentCSRsFr
|
|||
}
|
||||
EXPECT_EQ(expectedQueueSemaphoresCount, queueSemaphores.size());
|
||||
ASSERT_GE(queueSemaphores.size(), 5u);
|
||||
verifySemaphore(genCmdCast<MI_SEMAPHORE_WAIT *>(*(queueSemaphores[0])), timestamp3.getNode(0), 0);
|
||||
verifySemaphore(genCmdCast<MI_SEMAPHORE_WAIT *>(*(queueSemaphores[1])), timestamp5.getNode(0), 0);
|
||||
verifySemaphore(genCmdCast<MI_SEMAPHORE_WAIT *>(*(queueSemaphores[2])), timestamp4.getNode(0), 0);
|
||||
verifySemaphore(genCmdCast<MI_SEMAPHORE_WAIT *>(*(queueSemaphores[3])), timestamp6.getNode(0), 0);
|
||||
verifySemaphore(genCmdCast<MI_SEMAPHORE_WAIT *>(*(queueSemaphores[4])), timestamp6.getNode(1), 0);
|
||||
verifySemaphore<FamilyType>(genCmdCast<MI_SEMAPHORE_WAIT *>(*(queueSemaphores[0])), timestamp3.getNode(0), 0);
|
||||
verifySemaphore<FamilyType>(genCmdCast<MI_SEMAPHORE_WAIT *>(*(queueSemaphores[1])), timestamp5.getNode(0), 0);
|
||||
verifySemaphore<FamilyType>(genCmdCast<MI_SEMAPHORE_WAIT *>(*(queueSemaphores[2])), timestamp4.getNode(0), 0);
|
||||
verifySemaphore<FamilyType>(genCmdCast<MI_SEMAPHORE_WAIT *>(*(queueSemaphores[3])), timestamp6.getNode(0), 0);
|
||||
verifySemaphore<FamilyType>(genCmdCast<MI_SEMAPHORE_WAIT *>(*(queueSemaphores[4])), timestamp6.getNode(1), 0);
|
||||
}
|
||||
|
||||
HWTEST_F(TimestampPacketTests, givenTimestampPacketWriteEnabledWhenEnqueueingBlockedThenProgramSemaphoresOnQueueStreamOnFlush) {
|
||||
|
@ -1292,8 +1292,8 @@ HWTEST_F(TimestampPacketTests, givenTimestampPacketWriteEnabledWhenEnqueueingBlo
|
|||
}
|
||||
EXPECT_EQ(expectedQueueSemaphoresCount, queueSemaphores.size());
|
||||
ASSERT_GE(queueSemaphores.size(), 2u);
|
||||
verifySemaphore(genCmdCast<MI_SEMAPHORE_WAIT *>(*(queueSemaphores[0])), timestamp0.getNode(0), 0);
|
||||
verifySemaphore(genCmdCast<MI_SEMAPHORE_WAIT *>(*(queueSemaphores[1])), timestamp1.getNode(0), 0);
|
||||
verifySemaphore<FamilyType>(genCmdCast<MI_SEMAPHORE_WAIT *>(*(queueSemaphores[0])), timestamp0.getNode(0), 0);
|
||||
verifySemaphore<FamilyType>(genCmdCast<MI_SEMAPHORE_WAIT *>(*(queueSemaphores[1])), timestamp1.getNode(0), 0);
|
||||
|
||||
auto csrSemaphores = findAll<MI_SEMAPHORE_WAIT *>(hwParserCsr.cmdList.begin(), hwParserCsr.cmdList.end());
|
||||
EXPECT_EQ(0u, csrSemaphores.size());
|
||||
|
@ -1351,8 +1351,8 @@ HWTEST_F(TimestampPacketTests, givenTimestampPacketWriteEnabledOnDifferentCSRsFr
|
|||
}
|
||||
EXPECT_EQ(expectedQueueSemaphoresCount, queueSemaphores.size());
|
||||
ASSERT_GE(queueSemaphores.size(), 2u);
|
||||
verifySemaphore(genCmdCast<MI_SEMAPHORE_WAIT *>(*(queueSemaphores[0])), timestamp0.getNode(0), 0);
|
||||
verifySemaphore(genCmdCast<MI_SEMAPHORE_WAIT *>(*(queueSemaphores[1])), timestamp1.getNode(0), 0);
|
||||
verifySemaphore<FamilyType>(genCmdCast<MI_SEMAPHORE_WAIT *>(*(queueSemaphores[0])), timestamp0.getNode(0), 0);
|
||||
verifySemaphore<FamilyType>(genCmdCast<MI_SEMAPHORE_WAIT *>(*(queueSemaphores[1])), timestamp1.getNode(0), 0);
|
||||
|
||||
auto csrSemaphores = findAll<MI_SEMAPHORE_WAIT *>(hwParserCsr.cmdList.begin(), hwParserCsr.cmdList.end());
|
||||
EXPECT_EQ(0u, csrSemaphores.size());
|
||||
|
@ -1418,11 +1418,11 @@ HWTEST_F(TimestampPacketTests, givenTimestampPacketWriteEnabledWhenDispatchingTh
|
|||
if (semaphoreCmd) {
|
||||
semaphoresFound++;
|
||||
if (semaphoresFound == 1) {
|
||||
verifySemaphore(semaphoreCmd, timestamp3.getNode(0), 0);
|
||||
verifySemaphore<FamilyType>(semaphoreCmd, timestamp3.getNode(0), 0);
|
||||
} else if (semaphoresFound == 2) {
|
||||
verifySemaphore(semaphoreCmd, timestamp5.getNode(0), 0);
|
||||
verifySemaphore<FamilyType>(semaphoreCmd, timestamp5.getNode(0), 0);
|
||||
} else if (semaphoresFound == 3) {
|
||||
verifySemaphore(semaphoreCmd, timestamp5.getNode(1), 0);
|
||||
verifySemaphore<FamilyType>(semaphoreCmd, timestamp5.getNode(1), 0);
|
||||
}
|
||||
}
|
||||
if (genCmdCast<WALKER *>(*it)) {
|
||||
|
@ -1492,11 +1492,11 @@ HWTEST_F(TimestampPacketTests, givenTimestampPacketWriteEnabledOnDifferentCSRsFr
|
|||
if (semaphoreCmd) {
|
||||
semaphoresFound++;
|
||||
if (semaphoresFound == 1) {
|
||||
verifySemaphore(semaphoreCmd, timestamp3.getNode(0), 0);
|
||||
verifySemaphore<FamilyType>(semaphoreCmd, timestamp3.getNode(0), 0);
|
||||
} else if (semaphoresFound == 2) {
|
||||
verifySemaphore(semaphoreCmd, timestamp5.getNode(0), 0);
|
||||
verifySemaphore<FamilyType>(semaphoreCmd, timestamp5.getNode(0), 0);
|
||||
} else if (semaphoresFound == 3) {
|
||||
verifySemaphore(semaphoreCmd, timestamp5.getNode(1), 0);
|
||||
verifySemaphore<FamilyType>(semaphoreCmd, timestamp5.getNode(1), 0);
|
||||
}
|
||||
}
|
||||
if (genCmdCast<WALKER *>(*it)) {
|
||||
|
@ -1754,9 +1754,9 @@ HWTEST_F(TimestampPacketTests, givenAlreadyAssignedNodeWhenEnqueueingThenKeepDep
|
|||
hwParser.parseCommands<FamilyType>(*cmdQ.commandStream, 0);
|
||||
|
||||
auto it = hwParser.cmdList.begin();
|
||||
verifySemaphore(genCmdCast<MI_SEMAPHORE_WAIT *>(*it), firstTag0, 0);
|
||||
verifySemaphore<FamilyType>(genCmdCast<MI_SEMAPHORE_WAIT *>(*it), firstTag0, 0);
|
||||
|
||||
verifySemaphore(genCmdCast<MI_SEMAPHORE_WAIT *>(*++it), firstTag1, 0);
|
||||
verifySemaphore<FamilyType>(genCmdCast<MI_SEMAPHORE_WAIT *>(*++it), firstTag1, 0);
|
||||
it++;
|
||||
|
||||
while (it != hwParser.cmdList.end()) {
|
||||
|
|
|
@ -618,8 +618,8 @@ HWTEST_F(TimestampPacketTests, givenBlockedEnqueueWithoutKernelWhenSubmittingThe
|
|||
}
|
||||
EXPECT_EQ(expectedQueueSemaphoresCount, queueSemaphores.size());
|
||||
ASSERT_GE(queueSemaphores.size(), 2u);
|
||||
verifySemaphore(genCmdCast<MI_SEMAPHORE_WAIT *>(*(queueSemaphores[0])), node0.getNode(0), 0);
|
||||
verifySemaphore(genCmdCast<MI_SEMAPHORE_WAIT *>(*(queueSemaphores[1])), node1.getNode(0), 0);
|
||||
verifySemaphore<FamilyType>(genCmdCast<MI_SEMAPHORE_WAIT *>(*(queueSemaphores[0])), node0.getNode(0), 0);
|
||||
verifySemaphore<FamilyType>(genCmdCast<MI_SEMAPHORE_WAIT *>(*(queueSemaphores[1])), node1.getNode(0), 0);
|
||||
|
||||
auto csrSemaphores = findAll<MI_SEMAPHORE_WAIT *>(hwParserCsr.cmdList.begin(), hwParserCsr.cmdList.end());
|
||||
EXPECT_EQ(0u, csrSemaphores.size());
|
||||
|
@ -672,8 +672,8 @@ HWTEST_F(TimestampPacketTests, givenWaitlistAndOutputEventWhenEnqueueingMarkerWi
|
|||
}
|
||||
EXPECT_EQ(expectedQueueSemaphoresCount, queueSemaphores.size());
|
||||
ASSERT_GE(queueSemaphores.size(), 2u);
|
||||
verifySemaphore(genCmdCast<MI_SEMAPHORE_WAIT *>(*(queueSemaphores[0])), node1.getNode(0), 0);
|
||||
verifySemaphore(genCmdCast<MI_SEMAPHORE_WAIT *>(*(queueSemaphores[1])), node2.getNode(0), 0);
|
||||
verifySemaphore<FamilyType>(genCmdCast<MI_SEMAPHORE_WAIT *>(*(queueSemaphores[0])), node1.getNode(0), 0);
|
||||
verifySemaphore<FamilyType>(genCmdCast<MI_SEMAPHORE_WAIT *>(*(queueSemaphores[1])), node2.getNode(0), 0);
|
||||
}
|
||||
|
||||
HWTEST_F(TimestampPacketTests, givenWaitlistAndOutputEventWhenEnqueueingBarrierWithoutKernelThenInheritTimestampPacketsAndProgramSemaphores) {
|
||||
|
@ -716,5 +716,5 @@ HWTEST_F(TimestampPacketTests, givenWaitlistAndOutputEventWhenEnqueueingBarrierW
|
|||
}
|
||||
EXPECT_EQ(expectedQueueSemaphoresCount, queueSemaphores.size());
|
||||
ASSERT_GT(queueSemaphores.size(), 0u);
|
||||
verifySemaphore(genCmdCast<MI_SEMAPHORE_WAIT *>(*(queueSemaphores[0])), node1.getNode(0), 0);
|
||||
verifySemaphore<FamilyType>(genCmdCast<MI_SEMAPHORE_WAIT *>(*(queueSemaphores[0])), node1.getNode(0), 0);
|
||||
}
|
||||
|
|
|
@ -45,8 +45,9 @@ struct TimestampPacketTests : public ::testing::Test {
|
|||
context->release();
|
||||
}
|
||||
|
||||
template <typename MI_SEMAPHORE_WAIT>
|
||||
void verifySemaphore(MI_SEMAPHORE_WAIT *semaphoreCmd, TagNodeBase *timestampPacketNode, uint32_t packetId) {
|
||||
template <typename FamilyType>
|
||||
void verifySemaphore(typename FamilyType::MI_SEMAPHORE_WAIT *semaphoreCmd, TagNodeBase *timestampPacketNode, uint32_t packetId) {
|
||||
using MI_SEMAPHORE_WAIT = typename FamilyType::MI_SEMAPHORE_WAIT;
|
||||
ASSERT_NE(nullptr, semaphoreCmd);
|
||||
EXPECT_EQ(semaphoreCmd->getCompareOperation(), MI_SEMAPHORE_WAIT::COMPARE_OPERATION::COMPARE_OPERATION_SAD_NOT_EQUAL_SDD);
|
||||
EXPECT_EQ(1u, semaphoreCmd->getSemaphoreDataDword());
|
||||
|
|
|
@ -89,7 +89,7 @@ class GivenCacheResourceSurfacesWhenprocessingCacheFlushThenExpectProperCacheFlu
|
|||
std::string err;
|
||||
auto cmdBuffOk = expectCmdBuff<FamilyType>(cmdQ.getCS(0), 0,
|
||||
std::vector<MatchCmd *>{
|
||||
new MatchHwCmd<FamilyType, L3_CONTROL_WITHOUT_POST_SYNC>(AtLeastOne)},
|
||||
new MatchHwCmd<FamilyType, L3_CONTROL_WITHOUT_POST_SYNC>(atLeastOne)},
|
||||
&err);
|
||||
EXPECT_TRUE(cmdBuffOk) << err;
|
||||
svmManager->freeSVMAlloc(svm);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2018-2022 Intel Corporation
|
||||
* Copyright (C) 2018-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
|
@ -18,7 +18,7 @@
|
|||
#include <sys/stat.h>
|
||||
#include <sys/sysmacros.h>
|
||||
|
||||
int (*c_open)(const char *pathname, int flags, ...) = nullptr;
|
||||
int (*openFunc)(const char *pathname, int flags, ...) = nullptr;
|
||||
int (*openFull)(const char *pathname, int flags, ...) = nullptr;
|
||||
|
||||
int fakeFd = 1023;
|
||||
|
@ -81,8 +81,8 @@ int open(const char *pathname, int flags, ...) {
|
|||
if (openFull != nullptr) {
|
||||
return openFull(pathname, flags);
|
||||
}
|
||||
if (c_open == nullptr) {
|
||||
c_open = (int (*)(const char *, int, ...))dlsym(RTLD_NEXT, "open");
|
||||
if (openFunc == nullptr) {
|
||||
openFunc = (int (*)(const char *, int, ...))dlsym(RTLD_NEXT, "open");
|
||||
}
|
||||
|
||||
if (strncmp("/dev/dri/", pathname, 9) == 0) {
|
||||
|
@ -93,7 +93,7 @@ int open(const char *pathname, int flags, ...) {
|
|||
}
|
||||
}
|
||||
|
||||
return c_open(pathname, flags);
|
||||
return openFunc(pathname, flags);
|
||||
}
|
||||
bool failOnOpenDir = false;
|
||||
DIR *validDir = reinterpret_cast<DIR *>(0xc001);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2018-2022 Intel Corporation
|
||||
* Copyright (C) 2018-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
|
@ -17,7 +17,7 @@
|
|||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
extern int (*c_open)(const char *pathname, int flags, ...);
|
||||
extern int (*openFunc)(const char *pathname, int flags, ...);
|
||||
extern int (*openFull)(const char *pathname, int flags, ...);
|
||||
|
||||
extern int drmOtherRequests(unsigned long int request, ...);
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
|
||||
using namespace NEO;
|
||||
|
||||
static const unsigned int g_scTestBufferSizeInBytes = 16;
|
||||
static const unsigned int testBufferSizeInBytes = 16;
|
||||
|
||||
TEST(Buffer, GivenInvalidHandleTypeWhenValidateHandleTypeThenReturnFalse) {
|
||||
MemoryProperties memoryProperties;
|
||||
|
@ -77,7 +77,7 @@ class ExportBufferTests : public ClDeviceFixture,
|
|||
std::unique_ptr<MockContext> context;
|
||||
MemoryManager *contextMemoryManager;
|
||||
cl_mem_flags flags = CL_MEM_READ_WRITE;
|
||||
unsigned char pHostPtr[g_scTestBufferSizeInBytes];
|
||||
unsigned char pHostPtr[testBufferSizeInBytes];
|
||||
};
|
||||
|
||||
struct ValidExportHostPtr
|
||||
|
@ -112,7 +112,7 @@ TEST_F(ValidExportHostPtr, givenInvalidPropertiesWithDmaBufWhenValidateInputAndC
|
|||
|
||||
osHandle invalidHandle = static_cast<MockMemoryManager *>(pClExecutionEnvironment->memoryManager.get())->invalidSharedHandle;
|
||||
cl_mem_properties properties[] = {CL_EXTERNAL_MEMORY_HANDLE_DMA_BUF_KHR, invalidHandle, 0};
|
||||
cl_mem buffer = BufferFunctions::validateInputAndCreateBuffer(context.get(), properties, flags, 0, g_scTestBufferSizeInBytes, nullptr, retVal);
|
||||
cl_mem buffer = BufferFunctions::validateInputAndCreateBuffer(context.get(), properties, flags, 0, testBufferSizeInBytes, nullptr, retVal);
|
||||
|
||||
EXPECT_EQ(retVal, CL_INVALID_MEM_OBJECT);
|
||||
EXPECT_EQ(static_cast<MockMemoryManager *>(pClExecutionEnvironment->memoryManager.get())->capturedSharedHandle, properties[1]);
|
||||
|
@ -123,7 +123,7 @@ TEST_F(ValidExportHostPtr, givenInvalidPropertiesWithDmaBufWhenValidateInputAndC
|
|||
|
||||
TEST_F(ValidExportHostPtr, givenInvalidPropertiesWithOpaqueWin32WhenValidateInputAndCreateBufferThenNullptrIsReturned) {
|
||||
cl_mem_properties properties[] = {CL_EXTERNAL_MEMORY_HANDLE_OPAQUE_WIN32_KHR, 0x1234, 0};
|
||||
cl_mem buffer = BufferFunctions::validateInputAndCreateBuffer(context.get(), properties, flags, 0, g_scTestBufferSizeInBytes, nullptr, retVal);
|
||||
cl_mem buffer = BufferFunctions::validateInputAndCreateBuffer(context.get(), properties, flags, 0, testBufferSizeInBytes, nullptr, retVal);
|
||||
|
||||
EXPECT_EQ(retVal, CL_INVALID_PROPERTY);
|
||||
EXPECT_EQ(buffer, nullptr);
|
||||
|
@ -134,7 +134,7 @@ TEST_F(ValidExportHostPtr, givenInvalidPropertiesWithOpaqueWin32WhenValidateInpu
|
|||
TEST_F(ValidExportHostPtr, givenPropertiesWithDmaBufWhenValidateInputAndCreateBufferThenCorrectBufferIsSet) {
|
||||
|
||||
cl_mem_properties properties[] = {CL_EXTERNAL_MEMORY_HANDLE_DMA_BUF_KHR, 0x1234, 0};
|
||||
cl_mem buffer = BufferFunctions::validateInputAndCreateBuffer(context.get(), properties, flags, 0, g_scTestBufferSizeInBytes, nullptr, retVal);
|
||||
cl_mem buffer = BufferFunctions::validateInputAndCreateBuffer(context.get(), properties, flags, 0, testBufferSizeInBytes, nullptr, retVal);
|
||||
|
||||
EXPECT_EQ(retVal, CL_SUCCESS);
|
||||
EXPECT_EQ(static_cast<MockMemoryManager *>(pClExecutionEnvironment->memoryManager.get())->capturedSharedHandle, properties[1]);
|
||||
|
@ -225,4 +225,4 @@ HWTEST_F(BufferCreateLinuxTests, givenClMemCopyHostPointerPassedToBufferCreateWh
|
|||
EXPECT_EQ(commandQueue->writeBufferCounter, writeBufferCounter + 1);
|
||||
EXPECT_EQ(memoryManager->lockResourceCalled, lockResourceCalled);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
#include "opencl/source/sharings/gl/gl_arb_sync_event.h"
|
||||
|
||||
template <bool FailCreation>
|
||||
template <bool failCreation>
|
||||
struct DummyArbEvent : NEO::GlArbSyncEvent {
|
||||
DummyArbEvent(NEO::Context &ctx)
|
||||
: GlArbSyncEvent(ctx) {
|
||||
|
@ -29,10 +29,10 @@ struct DummyArbEvent : NEO::GlArbSyncEvent {
|
|||
}
|
||||
|
||||
static GlArbSyncEvent *create(Event &baseEv) {
|
||||
if (FailCreation) {
|
||||
if (failCreation) {
|
||||
return nullptr;
|
||||
}
|
||||
auto syncEv = new DummyArbEvent<FailCreation>(*baseEv.getContext());
|
||||
auto syncEv = new DummyArbEvent<failCreation>(*baseEv.getContext());
|
||||
syncEv->baseEvent = &baseEv;
|
||||
return syncEv;
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ inline void glArbSyncObjectCleanupMockDoNothing(NEO::OSInterface &osInterface, C
|
|||
inline void glArbSyncObjectSignalMockDoNothing(NEO::OsContext &osContext, CL_GL_SYNC_INFO &glSyncInfo) {
|
||||
}
|
||||
|
||||
template <bool Fail>
|
||||
template <bool fail>
|
||||
inline bool mockGlArbSyncObjectSetup(NEO::GLSharingFunctions &sharing, NEO::OSInterface &osInterface, CL_GL_SYNC_INFO &glSyncInfo) {
|
||||
return (Fail == false);
|
||||
return (fail == false);
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@ class MockMultiDeviceKernel : public MultiDeviceKernel {
|
|||
return kernelVector;
|
||||
}
|
||||
using MultiDeviceKernel::MultiDeviceKernel;
|
||||
template <typename kernel_t = Kernel>
|
||||
template <typename KernelType = Kernel>
|
||||
static MockMultiDeviceKernel *create(Program *programArg, const KernelInfoContainer &kernelInfoArg) {
|
||||
KernelVectorType kernelVector;
|
||||
kernelVector.resize(programArg->getMaxRootDeviceIndex() + 1);
|
||||
|
@ -71,7 +71,7 @@ class MockMultiDeviceKernel : public MultiDeviceKernel {
|
|||
if (kernelVector[rootDeviceIndex]) {
|
||||
continue;
|
||||
}
|
||||
kernelVector[rootDeviceIndex] = new kernel_t(programArg, *kernelInfoArg[rootDeviceIndex], *pDevice);
|
||||
kernelVector[rootDeviceIndex] = new KernelType(programArg, *kernelInfoArg[rootDeviceIndex], *pDevice);
|
||||
}
|
||||
return new MockMultiDeviceKernel(std::move(kernelVector), kernelInfoArg);
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
#include <cstdint>
|
||||
|
||||
const uint32_t MAGIC_CL = 0x494E5443;
|
||||
const uint32_t MAGIC_CL = 0x494E5443; // NOLINT(readability-identifier-naming)
|
||||
struct SProgramBinaryHeader
|
||||
{
|
||||
uint32_t Magic; // NOLINT(readability-identifier-naming)
|
||||
|
@ -154,4 +154,4 @@ struct SPatchAllocateConstantMemorySurfaceProgramBinaryInfo :
|
|||
};
|
||||
static_assert( sizeof( SPatchAllocateConstantMemorySurfaceProgramBinaryInfo ) == ( 8 + sizeof( SPatchItemHeader ) ) , "The size of SPatchAllocateConstantMemorySurfaceProgramBinaryInfo is not what is expected" );
|
||||
#pragma pack( pop )
|
||||
// clang-format on
|
||||
// clang-format on
|
||||
|
|
|
@ -84,7 +84,7 @@ class AILConfiguration {
|
|||
|
||||
extern const std::set<std::string_view> applicationsContextSyncFlag;
|
||||
|
||||
template <PRODUCT_FAMILY Product>
|
||||
template <PRODUCT_FAMILY product>
|
||||
class AILConfigurationHw : public AILConfiguration {
|
||||
public:
|
||||
static std::unique_ptr<AILConfiguration> create() {
|
||||
|
|
|
@ -172,7 +172,7 @@ class BuiltIns {
|
|||
std::unordered_map<ContextId, std::pair<std::unique_ptr<SipKernel>, std::once_flag>> perContextSipKernels;
|
||||
};
|
||||
|
||||
template <EBuiltInOps::Type OpCode>
|
||||
template <EBuiltInOps::Type opCode>
|
||||
class BuiltInOp;
|
||||
|
||||
} // namespace NEO
|
||||
|
|
|
@ -33,8 +33,8 @@
|
|||
#include <algorithm>
|
||||
|
||||
namespace NEO {
|
||||
constexpr size_t TimestampDestinationAddressAlignment = 16;
|
||||
constexpr size_t ImmWriteDestinationAddressAlignment = 8;
|
||||
constexpr size_t timestampDestinationAddressAlignment = 16;
|
||||
constexpr size_t immWriteDestinationAddressAlignment = 8;
|
||||
|
||||
template <typename Family>
|
||||
template <typename InterfaceDescriptorType>
|
||||
|
@ -347,11 +347,11 @@ void EncodeDispatchKernel<Family>::encode(CommandContainer &container, EncodeDis
|
|||
if (args.eventAddress != 0) {
|
||||
postSync.setDataportPipelineFlush(true);
|
||||
if (args.isTimestampEvent) {
|
||||
UNRECOVERABLE_IF(!(isAligned<TimestampDestinationAddressAlignment>(args.eventAddress)));
|
||||
UNRECOVERABLE_IF(!(isAligned<timestampDestinationAddressAlignment>(args.eventAddress)));
|
||||
|
||||
postSync.setOperation(POSTSYNC_DATA::OPERATION_WRITE_TIMESTAMP);
|
||||
} else {
|
||||
UNRECOVERABLE_IF(!(isAligned<ImmWriteDestinationAddressAlignment>(args.eventAddress)));
|
||||
UNRECOVERABLE_IF(!(isAligned<immWriteDestinationAddressAlignment>(args.eventAddress)));
|
||||
|
||||
postSync.setOperation(POSTSYNC_DATA::OPERATION_WRITE_IMMEDIATE_DATA);
|
||||
postSync.setImmediateData(args.postSyncImmValue);
|
||||
|
|
|
@ -50,9 +50,9 @@ inline constexpr ConstStringRef enableFP64GenEmu = "-cl-fp64-gen-emu";
|
|||
inline constexpr size_t nullterminateSize = 1U;
|
||||
inline constexpr size_t spaceSeparatorSize = 1U;
|
||||
|
||||
template <size_t Length>
|
||||
constexpr size_t length(const char (&array)[Length]) {
|
||||
return Length;
|
||||
template <size_t lengthValue>
|
||||
constexpr size_t length(const char (&array)[lengthValue]) {
|
||||
return lengthValue;
|
||||
}
|
||||
|
||||
constexpr size_t length(ConstStringRef string) {
|
||||
|
@ -111,8 +111,8 @@ inline std::string concatenate(T &&arg, RestT &&...rest) {
|
|||
return ret;
|
||||
}
|
||||
|
||||
template <size_t NumOptions>
|
||||
constexpr size_t concatenationLength(const ConstStringRef (&options)[NumOptions]) {
|
||||
template <size_t numOptions>
|
||||
constexpr size_t concatenationLength(const ConstStringRef (&options)[numOptions]) {
|
||||
size_t ret = 0U;
|
||||
for (auto &opt : options) {
|
||||
ret += spaceSeparatorSize + opt.length();
|
||||
|
@ -135,11 +135,11 @@ inline bool extract(const ConstStringRef &toBeExtracted, ContainerT &options) {
|
|||
return true;
|
||||
}
|
||||
|
||||
template <size_t MaxLength = 256>
|
||||
template <size_t maxLength = 256>
|
||||
class ConstConcatenation {
|
||||
public:
|
||||
template <size_t NumOptions>
|
||||
constexpr ConstConcatenation(const ConstStringRef (&options)[NumOptions]) {
|
||||
template <size_t numOptions>
|
||||
constexpr ConstConcatenation(const ConstStringRef (&options)[numOptions]) {
|
||||
size_t i = 0U;
|
||||
for (auto &opt : options) {
|
||||
for (size_t j = 0U, e = opt.length(); j < e; ++j, ++i) {
|
||||
|
@ -163,17 +163,17 @@ class ConstConcatenation {
|
|||
}
|
||||
|
||||
protected:
|
||||
char storage[MaxLength + nullterminateSize] = {};
|
||||
char storage[maxLength + nullterminateSize] = {};
|
||||
size_t length = 0U;
|
||||
};
|
||||
|
||||
template <size_t MaxLength>
|
||||
bool operator==(const ConstStringRef &lhs, const ConstConcatenation<MaxLength> &rhs) {
|
||||
template <size_t maxLength>
|
||||
bool operator==(const ConstStringRef &lhs, const ConstConcatenation<maxLength> &rhs) {
|
||||
return lhs == rhs.operator ConstStringRef();
|
||||
}
|
||||
|
||||
template <size_t MaxLength>
|
||||
bool operator==(const ConstConcatenation<MaxLength> &lhs, const ConstStringRef &rhs) {
|
||||
template <size_t maxLength>
|
||||
bool operator==(const ConstConcatenation<maxLength> &lhs, const ConstStringRef &rhs) {
|
||||
return rhs == lhs;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2020-2021 Intel Corporation
|
||||
* Copyright (C) 2020-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
|
@ -9,12 +9,12 @@
|
|||
|
||||
#include <stddef.h>
|
||||
|
||||
template <typename T, size_t N>
|
||||
constexpr size_t arrayCount(const T (&)[N]) {
|
||||
return N;
|
||||
template <typename T, size_t n>
|
||||
constexpr size_t arrayCount(const T (&)[n]) {
|
||||
return n;
|
||||
}
|
||||
|
||||
template <typename T, size_t N>
|
||||
constexpr bool isInRange(size_t idx, const T (&)[N]) {
|
||||
return (idx < N);
|
||||
template <typename T, size_t n>
|
||||
constexpr bool isInRange(size_t idx, const T (&)[n]) {
|
||||
return (idx < n);
|
||||
}
|
||||
|
|
|
@ -62,21 +62,21 @@ struct PreambleHelper {
|
|||
static uint32_t getScratchSizeValueToProgramMediaVfeState(uint32_t scratchSize);
|
||||
};
|
||||
|
||||
template <PRODUCT_FAMILY ProductFamily>
|
||||
template <PRODUCT_FAMILY productFamily>
|
||||
static uint32_t getL3ConfigHelper(bool useSLM);
|
||||
|
||||
template <PRODUCT_FAMILY ProductFamily>
|
||||
template <PRODUCT_FAMILY productFamily>
|
||||
struct L3CNTLREGConfig {
|
||||
static const uint32_t valueForSLM;
|
||||
static const uint32_t valueForNoSLM;
|
||||
};
|
||||
|
||||
template <PRODUCT_FAMILY ProductFamily>
|
||||
template <PRODUCT_FAMILY productFamily>
|
||||
uint32_t getL3ConfigHelper(bool useSLM) {
|
||||
if (!useSLM) {
|
||||
return L3CNTLREGConfig<ProductFamily>::valueForNoSLM;
|
||||
return L3CNTLREGConfig<productFamily>::valueForNoSLM;
|
||||
}
|
||||
return L3CNTLREGConfig<ProductFamily>::valueForSLM;
|
||||
return L3CNTLREGConfig<productFamily>::valueForSLM;
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
|
|
|
@ -158,9 +158,9 @@ struct ArgDescriptor final {
|
|||
template <typename T>
|
||||
T &as(bool initIfUnknown = false);
|
||||
|
||||
template <ArgType Type>
|
||||
template <ArgType type>
|
||||
bool is() const {
|
||||
return Type == this->type;
|
||||
return type == this->type;
|
||||
}
|
||||
|
||||
ArgTypeTraits &getTraits() {
|
||||
|
@ -208,8 +208,8 @@ struct ArgDescriptor final {
|
|||
};
|
||||
|
||||
namespace {
|
||||
constexpr auto ArgSize = sizeof(ArgDescriptor);
|
||||
static_assert(ArgSize <= 72, "Keep it small");
|
||||
constexpr auto argSize = sizeof(ArgDescriptor);
|
||||
static_assert(argSize <= 72, "Keep it small");
|
||||
} // namespace
|
||||
|
||||
template <>
|
||||
|
@ -276,9 +276,9 @@ inline ArgDescValue &ArgDescriptor::as<ArgDescValue>(bool initIfUnknown) {
|
|||
return this->asByValue;
|
||||
}
|
||||
|
||||
template <uint32_t VecSize, typename T>
|
||||
inline void setOffsetsVec(CrossThreadDataOffset (&dst)[VecSize], const T (&src)[VecSize]) {
|
||||
for (uint32_t i = 0; i < VecSize; ++i) {
|
||||
template <uint32_t vecSize, typename T>
|
||||
inline void setOffsetsVec(CrossThreadDataOffset (&dst)[vecSize], const T (&src)[vecSize]) {
|
||||
for (uint32_t i = 0; i < vecSize; ++i) {
|
||||
dst[i] = src[i];
|
||||
}
|
||||
}
|
||||
|
@ -293,9 +293,9 @@ inline bool patchNonPointer(ArrayRef<uint8_t> buffer, CrossThreadDataOffset loca
|
|||
return true;
|
||||
}
|
||||
|
||||
template <uint32_t VecSize, typename T>
|
||||
inline void patchVecNonPointer(ArrayRef<uint8_t> buffer, const CrossThreadDataOffset (&location)[VecSize], const T (&value)[VecSize]) {
|
||||
for (uint32_t i = 0; i < VecSize; ++i) {
|
||||
template <uint32_t vecSize, typename T>
|
||||
inline void patchVecNonPointer(ArrayRef<uint8_t> buffer, const CrossThreadDataOffset (&location)[vecSize], const T (&value)[vecSize]) {
|
||||
for (uint32_t i = 0; i < vecSize; ++i) {
|
||||
patchNonPointer<T, T>(buffer, location[i], value[i]);
|
||||
}
|
||||
return;
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
namespace NEO {
|
||||
|
||||
template <size_t StaticSize>
|
||||
template <size_t staticSize>
|
||||
struct UmKmDataTempStorageBase {
|
||||
UmKmDataTempStorageBase() = default;
|
||||
UmKmDataTempStorageBase(size_t dynSize) {
|
||||
|
@ -33,14 +33,14 @@ struct UmKmDataTempStorageBase {
|
|||
}
|
||||
|
||||
protected:
|
||||
static constexpr size_t staticSizeQwordsCount = (StaticSize + sizeof(uint64_t) - 1) / sizeof(uint64_t);
|
||||
static constexpr size_t staticSizeQwordsCount = (staticSize + sizeof(uint64_t) - 1) / sizeof(uint64_t);
|
||||
StackVec<uint64_t, staticSizeQwordsCount> storage;
|
||||
size_t requestedSize = 0U;
|
||||
};
|
||||
|
||||
template <typename SrcT, size_t OverestimateMul = 2, typename BaseT = UmKmDataTempStorageBase<sizeof(SrcT) * OverestimateMul>>
|
||||
template <typename SrcT, size_t overestimateMul = 2, typename BaseT = UmKmDataTempStorageBase<sizeof(SrcT) * overestimateMul>>
|
||||
struct UmKmDataTempStorage : BaseT {
|
||||
using BaseT::BaseT;
|
||||
};
|
||||
|
||||
} // namespace NEO
|
||||
} // namespace NEO
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
namespace NEO {
|
||||
|
||||
template <typename NodeObjectType, bool Atomic>
|
||||
template <typename NodeObjectType, bool atomic>
|
||||
struct PtrType {
|
||||
};
|
||||
|
||||
|
@ -29,8 +29,8 @@ struct PtrType<NodeObjectType, false> {
|
|||
using type = NodeObjectType *;
|
||||
};
|
||||
|
||||
template <typename NodeObjectType, bool Atomic>
|
||||
using PtrType_t = typename PtrType<NodeObjectType, Atomic>::type;
|
||||
template <typename NodeObjectType, bool atomic>
|
||||
using PtrType_t = typename PtrType<NodeObjectType, atomic>::type;
|
||||
|
||||
template <typename NodeObjectType>
|
||||
struct IFNode {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
* Copyright (C) 2022-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
|
@ -13,9 +13,9 @@
|
|||
#include <optional>
|
||||
#include <utility>
|
||||
|
||||
template <typename KeyT, typename ValueT, size_t NumElements>
|
||||
template <typename KeyT, typename ValueT, size_t numElements>
|
||||
struct LookupArray {
|
||||
using LookupMapArrayT = std::array<std::pair<KeyT, ValueT>, NumElements>;
|
||||
using LookupMapArrayT = std::array<std::pair<KeyT, ValueT>, numElements>;
|
||||
constexpr LookupArray(const LookupMapArrayT &lookupArray) : lookupArray(lookupArray){};
|
||||
|
||||
constexpr std::optional<ValueT> find(const KeyT &keyToFind) const {
|
||||
|
@ -34,7 +34,7 @@ struct LookupArray {
|
|||
}
|
||||
|
||||
constexpr size_t size() const {
|
||||
return NumElements;
|
||||
return numElements;
|
||||
}
|
||||
|
||||
protected:
|
||||
|
|
|
@ -30,9 +30,9 @@ struct Range {
|
|||
: Range(&*container.begin(), container.size()) {
|
||||
}
|
||||
|
||||
template <typename T, size_t S>
|
||||
Range(T (&base)[S])
|
||||
: Range(&base[0], S) {
|
||||
template <typename T, size_t size>
|
||||
Range(T (&base)[size])
|
||||
: Range(&base[0], size) {
|
||||
}
|
||||
Range &operator=(const Range &) = delete;
|
||||
|
||||
|
|
|
@ -30,13 +30,13 @@ struct CmdValidatorWithStaticStorage : CmdValidator {
|
|||
}
|
||||
};
|
||||
|
||||
template <typename CmdT, typename ReturnT, ReturnT (CmdT::*Getter)() const, ReturnT Expected>
|
||||
struct GenericCmdValidator : CmdValidatorWithStaticStorage<GenericCmdValidator<CmdT, ReturnT, Getter, Expected>> {
|
||||
template <typename CmdT, typename ReturnT, ReturnT (CmdT::*getter)() const, ReturnT expected>
|
||||
struct GenericCmdValidator : CmdValidatorWithStaticStorage<GenericCmdValidator<CmdT, ReturnT, getter, expected>> {
|
||||
bool operator()(GenCmdList::iterator it, size_t numInSection, const std::string &member, std::string &outFailReason) override {
|
||||
auto cmd = genCmdCast<CmdT *>(*it);
|
||||
UNRECOVERABLE_IF(cmd == nullptr);
|
||||
if (Expected != (cmd->*Getter)()) {
|
||||
outFailReason = member + " - expected: " + std::to_string(Expected) + ", got: " + std::to_string((cmd->*Getter)());
|
||||
if (expected != (cmd->*getter)()) {
|
||||
outFailReason = member + " - expected: " + std::to_string(expected) + ", got: " + std::to_string((cmd->*getter)());
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
@ -90,12 +90,12 @@ struct MatchCmd {
|
|||
bool matchesAny = false;
|
||||
};
|
||||
|
||||
inline constexpr int32_t AnyNumber = -1;
|
||||
inline constexpr int32_t AtLeastOne = -2;
|
||||
inline constexpr int32_t anyNumber = -1;
|
||||
inline constexpr int32_t atLeastOne = -2;
|
||||
inline std::string countToString(int32_t count) {
|
||||
if (count == AnyNumber) {
|
||||
if (count == anyNumber) {
|
||||
return "AnyNumber";
|
||||
} else if (count == AtLeastOne) {
|
||||
} else if (count == atLeastOne) {
|
||||
return "AtLeastOne";
|
||||
} else {
|
||||
return std::to_string(count);
|
||||
|
@ -103,7 +103,7 @@ inline std::string countToString(int32_t count) {
|
|||
}
|
||||
|
||||
inline bool notPreciseNumber(int32_t count) {
|
||||
return (count == AnyNumber) || (count == AtLeastOne);
|
||||
return (count == anyNumber) || (count == atLeastOne);
|
||||
}
|
||||
|
||||
struct MatchAnyCmd : MatchCmd {
|
||||
|
@ -204,7 +204,7 @@ inline bool expectCmdBuff(GenCmdList::iterator begin, GenCmdList::iterator end,
|
|||
while (it != end) {
|
||||
if (currentMatcher < expectedCmdBuffMatchers.size()) {
|
||||
auto currentMatcherExpectedCount = expectedCmdBuffMatchers[currentMatcher]->getExpectedCount();
|
||||
if (expectedCmdBuffMatchers[currentMatcher]->getMatchesAny() && ((currentMatcherExpectedCount == AnyNumber) || ((currentMatcherExpectedCount == AtLeastOne) && (currentMatcherCount > 0)))) {
|
||||
if (expectedCmdBuffMatchers[currentMatcher]->getMatchesAny() && ((currentMatcherExpectedCount == anyNumber) || ((currentMatcherExpectedCount == atLeastOne) && (currentMatcherCount > 0)))) {
|
||||
if (expectedCmdBuffMatchers.size() > currentMatcher + 1) {
|
||||
// eat as many as possible but proceed to next matcher when possible
|
||||
if (expectedCmdBuffMatchers[currentMatcher + 1]->matches(it)) {
|
||||
|
@ -214,7 +214,7 @@ inline bool expectCmdBuff(GenCmdList::iterator begin, GenCmdList::iterator end,
|
|||
}
|
||||
} else if ((notPreciseNumber(expectedCmdBuffMatchers[currentMatcher]->getExpectedCount())) && (false == expectedCmdBuffMatchers[currentMatcher]->matches(it))) {
|
||||
// proceed to next matcher if not matched
|
||||
if ((expectedCmdBuffMatchers[currentMatcher]->getExpectedCount() == AtLeastOne) && (currentMatcherCount < 1)) {
|
||||
if ((expectedCmdBuffMatchers[currentMatcher]->getExpectedCount() == atLeastOne) && (currentMatcherCount < 1)) {
|
||||
failed = true;
|
||||
failReason = "Unmatched cmd#" + std::to_string(cmdNum) + ":" + HardwareParse::getCommandName<FamilyType>(*it) + " - expected " + std::string(expectedCmdBuffMatchers[currentMatcher]->getName()) + "(" + countToString(expectedCmdBuffMatchers[currentMatcher]->getExpectedCount()) + " - " + std::to_string(currentMatcherCount) + ") after : " + matchedCommandsString();
|
||||
break;
|
||||
|
@ -271,7 +271,7 @@ inline bool expectCmdBuff(GenCmdList::iterator begin, GenCmdList::iterator end,
|
|||
}
|
||||
|
||||
if (failed == false) {
|
||||
while ((currentMatcher < expectedCmdBuffMatchers.size()) && ((expectedCmdBuffMatchers[currentMatcher]->getExpectedCount() == 0) || (expectedCmdBuffMatchers[currentMatcher]->getExpectedCount() == AnyNumber))) {
|
||||
while ((currentMatcher < expectedCmdBuffMatchers.size()) && ((expectedCmdBuffMatchers[currentMatcher]->getExpectedCount() == 0) || (expectedCmdBuffMatchers[currentMatcher]->getExpectedCount() == anyNumber))) {
|
||||
++currentMatcher;
|
||||
currentMatcherCount = 0;
|
||||
}
|
||||
|
@ -281,7 +281,7 @@ inline bool expectCmdBuff(GenCmdList::iterator begin, GenCmdList::iterator end,
|
|||
} else if (currentMatcher + 1 == expectedCmdBuffMatchers.size()) {
|
||||
// last matcher
|
||||
auto currentMatcherExpectedCount = expectedCmdBuffMatchers[currentMatcher]->getExpectedCount();
|
||||
if ((currentMatcherExpectedCount == AtLeastOne) && (currentMatcherCount < 1)) {
|
||||
if ((currentMatcherExpectedCount == atLeastOne) && (currentMatcherCount < 1)) {
|
||||
failReason = "Unexpected command buffer end at cmd#" + std::to_string(cmdNum) + " - expected " + expectedCmdBuffMatchers[currentMatcher]->getName() + "(" + countToString(currentMatcherExpectedCount) + " - " + std::to_string(currentMatcherCount) + ") after : " + matchedCommandsString();
|
||||
failed = true;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2018-2022 Intel Corporation
|
||||
* Copyright (C) 2018-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
|
@ -7,10 +7,10 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
template <size_t X, size_t Y, size_t Z>
|
||||
template <size_t x, size_t y, size_t z>
|
||||
struct StatickSize3 {
|
||||
operator const size_t *() {
|
||||
static const size_t v[] = {X, Y, Z};
|
||||
static const size_t v[] = {z, y, z};
|
||||
return v;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#include <atomic>
|
||||
|
||||
namespace NEO {
|
||||
static std::atomic<int> PerfTicks{0};
|
||||
static std::atomic<int> perfTicks{0};
|
||||
constexpr uint64_t convertToNs = 100;
|
||||
class MockDeviceTime : public DeviceTime {
|
||||
public:
|
||||
|
@ -20,12 +20,12 @@ class MockDeviceTime : public DeviceTime {
|
|||
if (gpuTimeStampResult) {
|
||||
pGpuCpuTime->gpuTimeStamp = *gpuTimeStampResult;
|
||||
} else {
|
||||
pGpuCpuTime->gpuTimeStamp = ++PerfTicks;
|
||||
pGpuCpuTime->gpuTimeStamp = ++perfTicks;
|
||||
}
|
||||
if (cpuTimeResult) {
|
||||
pGpuCpuTime->cpuTimeinNS = *cpuTimeResult;
|
||||
} else {
|
||||
pGpuCpuTime->cpuTimeinNS = PerfTicks * convertToNs;
|
||||
pGpuCpuTime->cpuTimeinNS = perfTicks * convertToNs;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ class MockOSTime : public OSTime {
|
|||
if (cpuTimeResult) {
|
||||
*timeStamp = *cpuTimeResult;
|
||||
} else {
|
||||
*timeStamp = ++PerfTicks * convertToNs;
|
||||
*timeStamp = ++perfTicks * convertToNs;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2018-2022 Intel Corporation
|
||||
* Copyright (C) 2018-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
|
@ -27,8 +27,8 @@ static ReleaseableObjectPtr<T> clUniquePtr(T *object) {
|
|||
return ReleaseableObjectPtr<T>{object};
|
||||
}
|
||||
|
||||
template <class _Ty, class... _Types>
|
||||
inline ReleaseableObjectPtr<_Ty> makeReleaseable(_Types &&...args) {
|
||||
return (ReleaseableObjectPtr<_Ty>(new _Ty(std::forward<_Types>(args)...)));
|
||||
template <class Type, class... Types>
|
||||
inline ReleaseableObjectPtr<Type> makeReleaseable(Types &&...args) {
|
||||
return (ReleaseableObjectPtr<Type>(new Type(std::forward<Types>(args)...)));
|
||||
}
|
||||
} // namespace NEO
|
||||
|
|
|
@ -18,9 +18,9 @@
|
|||
|
||||
using namespace NEO;
|
||||
|
||||
using PIPE_CONTROL = typename Gen11Family::PIPE_CONTROL;
|
||||
struct Gen11MediaSamplerProgramingTest : public ::testing::Test {
|
||||
typedef typename Gen11Family::MI_LOAD_REGISTER_IMM MI_LOAD_REGISTER_IMM;
|
||||
typedef typename Gen11Family::PIPE_CONTROL PIPE_CONTROL;
|
||||
|
||||
struct MyCsr : public CommandStreamReceiverHw<Gen11Family> {
|
||||
using CommandStreamReceiver::commandStream;
|
||||
|
@ -59,7 +59,6 @@ struct Gen11MediaSamplerProgramingTest : public ::testing::Test {
|
|||
std::unique_ptr<LinearStream> stream;
|
||||
};
|
||||
|
||||
template <typename PIPE_CONTROL>
|
||||
void setFlushAllCaches(PIPE_CONTROL &pc) {
|
||||
pc.setDcFlushEnable(true);
|
||||
pc.setRenderTargetCacheFlushEnable(true);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2019-2022 Intel Corporation
|
||||
* Copyright (C) 2019-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
|
@ -34,13 +34,13 @@ HWTEST_F(HwParseTest, WhenEmptyBufferThenDontExpectCommands) {
|
|||
|
||||
cmdBuffOk = expectCmdBuff<FamilyType>(beg, end,
|
||||
std::vector<MatchCmd *>{
|
||||
new MatchHwCmd<FamilyType, PIPE_CONTROL>(AnyNumber),
|
||||
new MatchHwCmd<FamilyType, PIPE_CONTROL>(anyNumber),
|
||||
});
|
||||
EXPECT_TRUE(cmdBuffOk);
|
||||
|
||||
cmdBuffOk = expectCmdBuff<FamilyType>(beg, end,
|
||||
std::vector<MatchCmd *>{
|
||||
new MatchHwCmd<FamilyType, PIPE_CONTROL>(AtLeastOne),
|
||||
new MatchHwCmd<FamilyType, PIPE_CONTROL>(atLeastOne),
|
||||
});
|
||||
EXPECT_FALSE(cmdBuffOk);
|
||||
|
||||
|
@ -70,13 +70,13 @@ HWTEST_F(HwParseTest, WhenExpectingAnyCommandThenAllCommandsAreValidAsLongAsTheC
|
|||
|
||||
cmdBuffOk = expectCmdBuff<FamilyType>(stream, 0,
|
||||
std::vector<MatchCmd *>{
|
||||
new MatchAnyCmd(AtLeastOne),
|
||||
new MatchAnyCmd(atLeastOne),
|
||||
});
|
||||
EXPECT_TRUE(cmdBuffOk);
|
||||
|
||||
cmdBuffOk = expectCmdBuff<FamilyType>(stream, 0,
|
||||
std::vector<MatchCmd *>{
|
||||
new MatchAnyCmd(AnyNumber),
|
||||
new MatchAnyCmd(anyNumber),
|
||||
});
|
||||
EXPECT_TRUE(cmdBuffOk);
|
||||
|
||||
|
@ -93,7 +93,7 @@ HWTEST_F(HwParseTest, WhenExpectingAnyCommandThenAllCommandsAreValidAsLongAsTheC
|
|||
new MatchAnyCmd(1),
|
||||
new MatchAnyCmd(1),
|
||||
new MatchAnyCmd(1),
|
||||
new MatchAnyCmd(AtLeastOne)});
|
||||
new MatchAnyCmd(atLeastOne)});
|
||||
EXPECT_FALSE(cmdBuffOk);
|
||||
|
||||
cmdBuffOk = expectCmdBuff<FamilyType>(stream, 0,
|
||||
|
@ -101,18 +101,18 @@ HWTEST_F(HwParseTest, WhenExpectingAnyCommandThenAllCommandsAreValidAsLongAsTheC
|
|||
new MatchAnyCmd(1),
|
||||
new MatchAnyCmd(1),
|
||||
new MatchAnyCmd(1),
|
||||
new MatchAnyCmd(AnyNumber)});
|
||||
new MatchAnyCmd(anyNumber)});
|
||||
EXPECT_TRUE(cmdBuffOk);
|
||||
|
||||
cmdBuffOk = expectCmdBuff<FamilyType>(stream, 0,
|
||||
std::vector<MatchCmd *>{
|
||||
new MatchAnyCmd(AtLeastOne),
|
||||
new MatchAnyCmd(atLeastOne),
|
||||
new MatchAnyCmd(1)});
|
||||
EXPECT_FALSE(cmdBuffOk);
|
||||
|
||||
cmdBuffOk = expectCmdBuff<FamilyType>(stream, 0,
|
||||
std::vector<MatchCmd *>{
|
||||
new MatchAnyCmd(AnyNumber),
|
||||
new MatchAnyCmd(anyNumber),
|
||||
new MatchAnyCmd(1)});
|
||||
EXPECT_FALSE(cmdBuffOk);
|
||||
|
||||
|
@ -217,40 +217,40 @@ HWTEST_F(HwParseTest, WhenExpectingAnyNumberOfCommandsThenOnlyTypeOfCommandMatte
|
|||
cmdBuffOk = expectCmdBuff<FamilyType>(stream, 0,
|
||||
std::vector<MatchCmd *>{
|
||||
new MatchHwCmd<FamilyType, PIPE_CONTROL>(1),
|
||||
new MatchHwCmd<FamilyType, STATE_BASE_ADDRESS>(AnyNumber),
|
||||
new MatchHwCmd<FamilyType, STATE_BASE_ADDRESS>(anyNumber),
|
||||
new MatchHwCmd<FamilyType, PIPE_CONTROL>(1)});
|
||||
EXPECT_TRUE(cmdBuffOk);
|
||||
|
||||
cmdBuffOk = expectCmdBuff<FamilyType>(stream, 0,
|
||||
std::vector<MatchCmd *>{
|
||||
new MatchHwCmd<FamilyType, PIPE_CONTROL>(AnyNumber),
|
||||
new MatchHwCmd<FamilyType, STATE_BASE_ADDRESS>(AnyNumber),
|
||||
new MatchHwCmd<FamilyType, PIPE_CONTROL>(AnyNumber)});
|
||||
new MatchHwCmd<FamilyType, PIPE_CONTROL>(anyNumber),
|
||||
new MatchHwCmd<FamilyType, STATE_BASE_ADDRESS>(anyNumber),
|
||||
new MatchHwCmd<FamilyType, PIPE_CONTROL>(anyNumber)});
|
||||
EXPECT_TRUE(cmdBuffOk);
|
||||
|
||||
cmdBuffOk = expectCmdBuff<FamilyType>(stream, 0,
|
||||
std::vector<MatchCmd *>{
|
||||
new MatchHwCmd<FamilyType, PIPE_CONTROL>(AtLeastOne),
|
||||
new MatchHwCmd<FamilyType, STATE_BASE_ADDRESS>(AtLeastOne),
|
||||
new MatchHwCmd<FamilyType, PIPE_CONTROL>(AtLeastOne)});
|
||||
new MatchHwCmd<FamilyType, PIPE_CONTROL>(atLeastOne),
|
||||
new MatchHwCmd<FamilyType, STATE_BASE_ADDRESS>(atLeastOne),
|
||||
new MatchHwCmd<FamilyType, PIPE_CONTROL>(atLeastOne)});
|
||||
EXPECT_TRUE(cmdBuffOk);
|
||||
|
||||
cmdBuffOk = expectCmdBuff<FamilyType>(stream, 0,
|
||||
std::vector<MatchCmd *>{
|
||||
new MatchHwCmd<FamilyType, PIPE_CONTROL>(AtLeastOne),
|
||||
new MatchHwCmd<FamilyType, PIPE_CONTROL>(AtLeastOne),
|
||||
new MatchHwCmd<FamilyType, PIPE_CONTROL>(AtLeastOne),
|
||||
new MatchHwCmd<FamilyType, STATE_BASE_ADDRESS>(AtLeastOne),
|
||||
new MatchHwCmd<FamilyType, PIPE_CONTROL>(AtLeastOne),
|
||||
new MatchHwCmd<FamilyType, PIPE_CONTROL>(atLeastOne),
|
||||
new MatchHwCmd<FamilyType, PIPE_CONTROL>(atLeastOne),
|
||||
new MatchHwCmd<FamilyType, PIPE_CONTROL>(atLeastOne),
|
||||
new MatchHwCmd<FamilyType, STATE_BASE_ADDRESS>(atLeastOne),
|
||||
new MatchHwCmd<FamilyType, PIPE_CONTROL>(atLeastOne),
|
||||
});
|
||||
EXPECT_FALSE(cmdBuffOk);
|
||||
|
||||
cmdBuffOk = expectCmdBuff<FamilyType>(stream, 0,
|
||||
std::vector<MatchCmd *>{
|
||||
new MatchHwCmd<FamilyType, PIPE_CONTROL>(AnyNumber),
|
||||
new MatchHwCmd<FamilyType, PIPE_CONTROL>(anyNumber),
|
||||
new MatchHwCmd<FamilyType, PIPE_CONTROL>(0),
|
||||
new MatchHwCmd<FamilyType, STATE_BASE_ADDRESS>(AnyNumber),
|
||||
new MatchHwCmd<FamilyType, PIPE_CONTROL>(AnyNumber),
|
||||
new MatchHwCmd<FamilyType, STATE_BASE_ADDRESS>(anyNumber),
|
||||
new MatchHwCmd<FamilyType, PIPE_CONTROL>(anyNumber),
|
||||
new MatchHwCmd<FamilyType, STATE_BASE_ADDRESS>(0)});
|
||||
EXPECT_TRUE(cmdBuffOk);
|
||||
}
|
||||
|
@ -269,15 +269,15 @@ HWTEST_F(HwParseTest, WhenCommandMemberValidatorFailsThenCommandBufferValidation
|
|||
|
||||
cmdBuffOk = expectCmdBuff<FamilyType>(stream, 0,
|
||||
std::vector<MatchCmd *>{
|
||||
new MatchHwCmd<FamilyType, PIPE_CONTROL>(AnyNumber),
|
||||
new MatchHwCmd<FamilyType, STATE_BASE_ADDRESS>(AnyNumber, Expects{EXPECT_MEMBER(STATE_BASE_ADDRESS, getGeneralStateBaseAddressModifyEnable, true)}),
|
||||
new MatchHwCmd<FamilyType, PIPE_CONTROL>(AnyNumber)});
|
||||
new MatchHwCmd<FamilyType, PIPE_CONTROL>(anyNumber),
|
||||
new MatchHwCmd<FamilyType, STATE_BASE_ADDRESS>(anyNumber, Expects{EXPECT_MEMBER(STATE_BASE_ADDRESS, getGeneralStateBaseAddressModifyEnable, true)}),
|
||||
new MatchHwCmd<FamilyType, PIPE_CONTROL>(anyNumber)});
|
||||
EXPECT_TRUE(cmdBuffOk);
|
||||
|
||||
cmdBuffOk = expectCmdBuff<FamilyType>(stream, 0,
|
||||
std::vector<MatchCmd *>{
|
||||
new MatchHwCmd<FamilyType, PIPE_CONTROL>(AnyNumber),
|
||||
new MatchHwCmd<FamilyType, STATE_BASE_ADDRESS>(AnyNumber, Expects{EXPECT_MEMBER(STATE_BASE_ADDRESS, getGeneralStateBaseAddressModifyEnable, false)}),
|
||||
new MatchHwCmd<FamilyType, PIPE_CONTROL>(AnyNumber)});
|
||||
new MatchHwCmd<FamilyType, PIPE_CONTROL>(anyNumber),
|
||||
new MatchHwCmd<FamilyType, STATE_BASE_ADDRESS>(anyNumber, Expects{EXPECT_MEMBER(STATE_BASE_ADDRESS, getGeneralStateBaseAddressModifyEnable, false)}),
|
||||
new MatchHwCmd<FamilyType, PIPE_CONTROL>(anyNumber)});
|
||||
EXPECT_FALSE(cmdBuffOk);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue