Return correct maxFillSize property

Related-To: NEO-5205

Change-Id: I62b7fec89451c640f70028b8d3ecb81f7655225d
Signed-off-by: Maciej Plewka <maciej.plewka@intel.com>
This commit is contained in:
Maciej Plewka
2020-10-22 11:25:32 +02:00
committed by sys_ocldev
parent 2dcc2f5422
commit 44af85b492
18 changed files with 110 additions and 79 deletions

View File

@@ -124,15 +124,17 @@ HWTEST2_F(DeviceQueueGroupTest,
} else {
EXPECT_EQ(properties[i].numQueues, 1u);
}
EXPECT_EQ(properties[i].maxMemoryFillPatternSize, std::numeric_limits<size_t>::max());
} else if (i == static_cast<uint32_t>(NEO::EngineGroupType::Compute)) {
EXPECT_TRUE(properties[i].flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COMPUTE);
EXPECT_TRUE(properties[i].flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COPY);
EXPECT_EQ(properties[i].numQueues, 1u);
EXPECT_EQ(properties[i].maxMemoryFillPatternSize, std::numeric_limits<size_t>::max());
} else if (i == static_cast<uint32_t>(NEO::EngineGroupType::Copy)) {
EXPECT_TRUE(properties[i].flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COPY);
EXPECT_EQ(properties[i].numQueues, 1u);
EXPECT_EQ(properties[i].maxMemoryFillPatternSize, 4 * sizeof(uint32_t));
}
EXPECT_EQ(properties[i].maxMemoryFillPatternSize, sizeof(uint32_t));
}
}
@@ -171,15 +173,17 @@ HWTEST2_F(DeviceQueueGroupTest,
} else {
EXPECT_EQ(properties[i].numQueues, 1u);
}
EXPECT_EQ(properties[i].maxMemoryFillPatternSize, std::numeric_limits<size_t>::max());
} else if (i == static_cast<uint32_t>(NEO::EngineGroupType::Compute)) {
EXPECT_TRUE(properties[i].flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COMPUTE);
EXPECT_TRUE(properties[i].flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COPY);
EXPECT_EQ(properties[i].numQueues, 1u);
EXPECT_EQ(properties[i].maxMemoryFillPatternSize, std::numeric_limits<size_t>::max());
} else if (i == static_cast<uint32_t>(NEO::EngineGroupType::Copy)) {
EXPECT_TRUE(properties[i].flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COPY);
EXPECT_EQ(properties[i].numQueues, 1u);
EXPECT_EQ(properties[i].maxMemoryFillPatternSize, 4 * sizeof(uint32_t));
}
EXPECT_EQ(properties[i].maxMemoryFillPatternSize, sizeof(uint32_t));
}
}
@@ -209,11 +213,11 @@ HWTEST2_F(DeviceQueueGroupTest,
EXPECT_TRUE(properties[i].flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COPY);
EXPECT_TRUE(properties[i].flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COOPERATIVE_KERNELS);
EXPECT_TRUE(properties[i].flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_METRICS);
EXPECT_EQ(properties[i].maxMemoryFillPatternSize, sizeof(uint32_t));
EXPECT_EQ(properties[i].maxMemoryFillPatternSize, std::numeric_limits<size_t>::max());
EXPECT_EQ(properties[i].numQueues, 1u);
} else if (i == static_cast<uint32_t>(NEO::EngineGroupType::Copy)) {
EXPECT_TRUE(properties[i].flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COPY);
EXPECT_EQ(properties[i].maxMemoryFillPatternSize, sizeof(uint32_t));
EXPECT_EQ(properties[i].maxMemoryFillPatternSize, 4 * sizeof(uint32_t));
EXPECT_EQ(properties[i].numQueues, 1u);
}
}
@@ -251,11 +255,11 @@ HWTEST2_F(DeviceQueueGroupTest,
EXPECT_TRUE(properties[i].flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COPY);
EXPECT_TRUE(properties[i].flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COOPERATIVE_KERNELS);
EXPECT_TRUE(properties[i].flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_METRICS);
EXPECT_EQ(properties[i].maxMemoryFillPatternSize, sizeof(uint32_t));
EXPECT_EQ(properties[i].maxMemoryFillPatternSize, std::numeric_limits<size_t>::max());
EXPECT_EQ(properties[i].numQueues, 1u);
} else if (i == static_cast<uint32_t>(NEO::EngineGroupType::Copy)) {
EXPECT_TRUE(properties[i].flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COPY);
EXPECT_EQ(properties[i].maxMemoryFillPatternSize, sizeof(uint32_t));
EXPECT_EQ(properties[i].maxMemoryFillPatternSize, 4 * sizeof(uint32_t));
EXPECT_EQ(properties[i].numQueues, 1u);
}

View File

@@ -54,7 +54,7 @@ HWTEST2_F(DeviceQueueGroupTest, givenCommandQueuePropertiesCallThenCorrectNumber
EXPECT_TRUE(properties.flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COOPERATIVE_KERNELS);
EXPECT_TRUE(properties.flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_METRICS);
EXPECT_EQ(properties.numQueues, 1u);
EXPECT_EQ(properties.maxMemoryFillPatternSize, sizeof(uint32_t));
EXPECT_EQ(properties.maxMemoryFillPatternSize, std::numeric_limits<size_t>::max());
}
HWTEST2_F(DeviceQueueGroupTest, givenQueueGroupsReturnedThenCommandListIsCreatedCorrectly, IsGen9) {
@@ -72,7 +72,7 @@ HWTEST2_F(DeviceQueueGroupTest, givenQueueGroupsReturnedThenCommandListIsCreated
EXPECT_TRUE(properties.flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COOPERATIVE_KERNELS);
EXPECT_TRUE(properties.flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_METRICS);
EXPECT_EQ(properties.numQueues, 1u);
EXPECT_EQ(properties.maxMemoryFillPatternSize, sizeof(uint32_t));
EXPECT_EQ(properties.maxMemoryFillPatternSize, std::numeric_limits<size_t>::max());
ze_context_handle_t hContext;
ze_context_desc_t contextDesc;

View File

@@ -1035,5 +1035,27 @@ HWTEST2_F(CommandListCreate, givenCommandList, SupportedPlatforms) {
auto size = helper.getRenderSurfaceStateSize();
EXPECT_EQ(commandList.getReserveSshSize(), size);
}
HWTEST_F(CommandListCreate, GivenCommandListWhenUnalignedPtrThenLeftMiddleAndRightCopyAdded) {
using XY_COPY_BLT = typename FamilyType::XY_COPY_BLT;
ze_result_t returnValue;
std::unique_ptr<L0::CommandList> commandList(CommandList::create(productFamily, device, NEO::EngineGroupType::Copy, returnValue));
ASSERT_NE(nullptr, commandList);
EXPECT_EQ(device, commandList->device);
void *srcPtr = reinterpret_cast<void *>(0x4321);
void *dstPtr = reinterpret_cast<void *>(0x2345);
auto result = commandList->appendMemoryCopy(dstPtr, srcPtr, 2 * MemoryConstants::cacheLineSize, nullptr, 0, nullptr);
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
GenCmdList cmdList;
ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer(
cmdList, ptrOffset(commandList->commandContainer.getCommandStream()->getCpuBase(), 0), commandList->commandContainer.getCommandStream()->getUsed()));
auto itor = find<XY_COPY_BLT *>(cmdList.begin(), cmdList.end());
for (uint32_t i = 0; i < 3u; i++, itor++) {
EXPECT_NE(itor++, cmdList.end());
}
}
} // namespace ult
} // namespace L0

View File

@@ -160,8 +160,8 @@ HWTEST2_F(AppendMemoryCopy, givenCopyOnlyCommandListWhenAppenBlitFillCalledWithL
cmdList.initialize(device, NEO::EngineGroupType::Copy);
uint64_t pattern[4] = {1, 2, 3, 4};
void *ptr = reinterpret_cast<void *>(0x1234);
cmdList.appendMemoryFill(ptr, reinterpret_cast<void *>(&pattern), sizeof(pattern), 0x1000, nullptr);
EXPECT_GT(cmdList.appendMemoryCopyBlitCalledTimes, 0u);
auto ret = cmdList.appendMemoryFill(ptr, reinterpret_cast<void *>(&pattern), sizeof(pattern), 0x1000, nullptr);
EXPECT_EQ(ZE_RESULT_ERROR_INVALID_SIZE, ret);
}
HWTEST2_F(AppendMemoryCopy, givenCopyOnlyCommandListWhenAppenBlitFillToNotDeviceMemThenInvalidArgumentReturned, Platforms) {
@@ -173,7 +173,9 @@ HWTEST2_F(AppendMemoryCopy, givenCopyOnlyCommandListWhenAppenBlitFillToNotDevice
EXPECT_EQ(ret, ZE_RESULT_ERROR_INVALID_ARGUMENT);
}
HWTEST2_F(AppendMemoryCopy, givenCopyOnlyCommandListWhenAppenBlitFillThenCopyBltIsProgrammed, Platforms) {
using MemFillPlatforms = IsWithinProducts<IGFX_SKYLAKE, IGFX_TIGERLAKE_LP>;
HWTEST2_F(AppendMemoryCopy, givenCopyOnlyCommandListWhenAppenBlitFillThenCopyBltIsProgrammed, MemFillPlatforms) {
using GfxFamily = typename NEO::GfxFamilyMapper<gfxCoreFamily>::GfxFamily;
using XY_COLOR_BLT = typename GfxFamily::XY_COLOR_BLT;
MockCommandListForMemFill<gfxCoreFamily> commandList;
@@ -191,21 +193,6 @@ HWTEST2_F(AppendMemoryCopy, givenCopyOnlyCommandListWhenAppenBlitFillThenCopyBlt
device->setDriverHandle(driverHandle.get());
}
HWTEST2_F(AppendMemoryCopy, givenCopyOnlyCommandListWhenAppendBlitFillCalledWithLargePatternSizeThenInternalAllocHasPattern, Platforms) {
MockCommandListForMemFill<gfxCoreFamily> cmdList;
cmdList.initialize(device, NEO::EngineGroupType::Copy);
uint64_t pattern[4] = {1, 2, 3, 4};
void *ptr = reinterpret_cast<void *>(0x1234);
uint32_t fillElements = 0x101;
auto size = fillElements * sizeof(uint64_t);
cmdList.appendMemoryFill(ptr, reinterpret_cast<void *>(&pattern), sizeof(pattern), size, nullptr);
auto internalAlloc = cmdList.commandContainer.getDeallocationContainer()[0];
for (uint32_t i = 0; i < fillElements; i++) {
auto allocValue = reinterpret_cast<uint64_t *>(internalAlloc->getUnderlyingBuffer())[i];
EXPECT_EQ(allocValue, pattern[i % 4]);
}
}
HWTEST2_F(AppendMemoryCopy, givenCopyOnlyCommandListAndHostPointersWhenMemoryCopyCalledThenPipeControlWithDcFlushAddedIsNotAddedAfterBlitCopy, Platforms) {
using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL;
using GfxFamily = typename NEO::GfxFamilyMapper<gfxCoreFamily>::GfxFamily;