mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 09:09:04 +08:00
refactor: Move logic for querying maxMemoryFillPatternSize to product helper
Signed-off-by: Kacper Nowak <kacper.nowak@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
3b49836d0d
commit
b8d19ccfb5
@@ -235,7 +235,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::initialize(Device *device, NEO
|
||||
this->dummyBlitWa.rootDeviceEnvironment = &(neoDevice->getRootDeviceEnvironmentRef());
|
||||
this->dispatchCmdListBatchBufferAsPrimary = L0GfxCoreHelper::dispatchCmdListBatchBufferAsPrimary(rootDeviceEnvironment, !isImmediateType());
|
||||
this->useOnlyGlobalTimestamps = gfxCoreHelper.useOnlyGlobalTimestamps();
|
||||
this->maxFillPaternSizeForCopyEngine = gfxCoreHelper.getMaxFillPaternSizeForCopyEngine();
|
||||
this->maxFillPaternSizeForCopyEngine = productHelper.getMaxFillPaternSizeForCopyEngine();
|
||||
this->heaplessModeEnabled = compilerProductHelper.isHeaplessModeEnabled();
|
||||
this->heaplessStateInitEnabled = compilerProductHelper.isHeaplessStateInitEnabled();
|
||||
this->requiredStreamState.initSupport(rootDeviceEnvironment);
|
||||
|
||||
@@ -375,13 +375,14 @@ uint32_t DeviceImp::getCopyQueueGroupsFromSubDevice(uint32_t numberOfSubDeviceCo
|
||||
return numSubDeviceCopyEngineGroups;
|
||||
}
|
||||
|
||||
auto &gfxCoreHelper = this->neoDevice->getRootDeviceEnvironment().getHelper<NEO::GfxCoreHelper>();
|
||||
auto &l0GfxCoreHelper = this->neoDevice->getRootDeviceEnvironment().getHelper<L0GfxCoreHelper>();
|
||||
auto &rootDeviceEnv = this->neoDevice->getRootDeviceEnvironment();
|
||||
auto &l0GfxCoreHelper = rootDeviceEnv.getHelper<L0GfxCoreHelper>();
|
||||
auto &productHelper = rootDeviceEnv.getHelper<NEO::ProductHelper>();
|
||||
|
||||
uint32_t subDeviceQueueGroupsIter = 0;
|
||||
for (; subDeviceQueueGroupsIter < std::min(numSubDeviceCopyEngineGroups, numberOfSubDeviceCopyEngineGroupsRequested); subDeviceQueueGroupsIter++) {
|
||||
pCommandQueueGroupProperties[subDeviceQueueGroupsIter].flags = ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COPY;
|
||||
pCommandQueueGroupProperties[subDeviceQueueGroupsIter].maxMemoryFillPatternSize = gfxCoreHelper.getMaxFillPaternSizeForCopyEngine();
|
||||
pCommandQueueGroupProperties[subDeviceQueueGroupsIter].maxMemoryFillPatternSize = productHelper.getMaxFillPaternSizeForCopyEngine();
|
||||
|
||||
l0GfxCoreHelper.setAdditionalGroupProperty(pCommandQueueGroupProperties[subDeviceQueueGroupsIter], this->subDeviceCopyEngineGroups[subDeviceQueueGroupsIter]);
|
||||
pCommandQueueGroupProperties[subDeviceQueueGroupsIter].numQueues = static_cast<uint32_t>(this->subDeviceCopyEngineGroups[subDeviceQueueGroupsIter].engines.size());
|
||||
@@ -408,8 +409,9 @@ ze_result_t DeviceImp::getCommandQueueGroupProperties(uint32_t *pCount,
|
||||
return ZE_RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
auto &gfxCoreHelper = this->neoDevice->getRootDeviceEnvironment().getHelper<NEO::GfxCoreHelper>();
|
||||
auto &l0GfxCoreHelper = this->neoDevice->getRootDeviceEnvironment().getHelper<L0GfxCoreHelper>();
|
||||
auto &rootDeviceEnv = this->neoDevice->getRootDeviceEnvironment();
|
||||
auto &l0GfxCoreHelper = rootDeviceEnv.getHelper<L0GfxCoreHelper>();
|
||||
auto &productHelper = rootDeviceEnv.getHelper<NEO::ProductHelper>();
|
||||
|
||||
*pCount = std::min(totalEngineGroups, *pCount);
|
||||
for (uint32_t i = 0; i < std::min(numEngineGroups, *pCount); i++) {
|
||||
@@ -428,7 +430,7 @@ ze_result_t DeviceImp::getCommandQueueGroupProperties(uint32_t *pCount,
|
||||
}
|
||||
if (engineGroups[i].engineGroupType == NEO::EngineGroupType::copy) {
|
||||
pCommandQueueGroupProperties[i].flags = ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COPY;
|
||||
pCommandQueueGroupProperties[i].maxMemoryFillPatternSize = gfxCoreHelper.getMaxFillPaternSizeForCopyEngine();
|
||||
pCommandQueueGroupProperties[i].maxMemoryFillPatternSize = productHelper.getMaxFillPaternSizeForCopyEngine();
|
||||
}
|
||||
l0GfxCoreHelper.setAdditionalGroupProperty(pCommandQueueGroupProperties[i], engineGroups[i]);
|
||||
pCommandQueueGroupProperties[i].numQueues = static_cast<uint32_t>(engineGroups[i].engines.size());
|
||||
|
||||
@@ -914,7 +914,7 @@ HWTEST2_F(HostPointerManagerCommandListTest,
|
||||
auto ret = hostDriverHandle->importExternalPointer(heapPointer, MemoryConstants::pageSize);
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, ret);
|
||||
|
||||
int pattern = 1;
|
||||
char pattern = 'a';
|
||||
ret = commandList->appendMemoryFill(heapPointer, reinterpret_cast<void *>(&pattern), sizeof(pattern), 64u, nullptr, 0, nullptr, false);
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, ret);
|
||||
|
||||
@@ -1091,7 +1091,7 @@ HWTEST2_F(HostPointerManagerCommandListTest, givenCommandListWhenMemoryFillWithS
|
||||
|
||||
auto ret = hostDriverHandle->importExternalPointer(heapPointer, MemoryConstants::pageSize);
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, ret);
|
||||
int one = 1;
|
||||
char pattern = 'a';
|
||||
size_t size = 16;
|
||||
|
||||
ze_event_pool_desc_t eventPoolDesc = {};
|
||||
@@ -1109,7 +1109,7 @@ HWTEST2_F(HostPointerManagerCommandListTest, givenCommandListWhenMemoryFillWithS
|
||||
auto event1 = std::unique_ptr<L0::Event>(L0::Event::create<typename FamilyType::TimestampPacketType>(eventPool.get(), &eventDesc, device));
|
||||
events.push_back(event1.get());
|
||||
|
||||
result = commandList->appendMemoryFill(heapPointer, reinterpret_cast<void *>(&one), sizeof(one), size,
|
||||
result = commandList->appendMemoryFill(heapPointer, reinterpret_cast<void *>(&pattern), sizeof(pattern), size,
|
||||
events[0], 1, &events[1], false);
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
|
||||
|
||||
@@ -4180,7 +4180,7 @@ HWTEST2_F(MultipleDevicePeerAllocationTest,
|
||||
auto commandList = std::make_unique<::L0::ult::CommandListCoreFamily<gfxCoreFamily>>();
|
||||
commandList->initialize(device1, NEO::EngineGroupType::renderCompute, 0u);
|
||||
|
||||
uint32_t pattern = 1;
|
||||
char pattern = 'a';
|
||||
result = commandList->appendBlitFill(ptr, &pattern, sizeof(pattern), size, nullptr, 0, nullptr, false);
|
||||
EXPECT_EQ(result, ZE_RESULT_ERROR_INVALID_ARGUMENT);
|
||||
|
||||
@@ -4206,7 +4206,7 @@ HWTEST2_F(MultipleDevicePeerAllocationTest,
|
||||
auto commandList = std::make_unique<::L0::ult::CommandListCoreFamily<gfxCoreFamily>>();
|
||||
commandList->initialize(device0, NEO::EngineGroupType::renderCompute, 0u);
|
||||
|
||||
uint32_t pattern = 1;
|
||||
char pattern = 'a';
|
||||
result = commandList->appendBlitFill(ptr, &pattern, sizeof(pattern), size, nullptr, 0, nullptr, false);
|
||||
EXPECT_EQ(result, ZE_RESULT_SUCCESS);
|
||||
|
||||
@@ -4233,7 +4233,7 @@ HWTEST2_F(MultipleDevicePeerAllocationTest,
|
||||
auto commandList = std::make_unique<::L0::ult::CommandListCoreFamily<gfxCoreFamily>>();
|
||||
commandList->initialize(device1, NEO::EngineGroupType::renderCompute, 0u);
|
||||
|
||||
uint32_t pattern = 1;
|
||||
char pattern = 'a';
|
||||
result = commandList->appendBlitFill(ptr, &pattern, sizeof(pattern), size, nullptr, 0, nullptr, false);
|
||||
EXPECT_EQ(result, ZE_RESULT_SUCCESS);
|
||||
|
||||
@@ -4264,7 +4264,7 @@ HWTEST2_F(MultipleDevicePeerAllocationTest,
|
||||
auto commandList = std::make_unique<::L0::ult::CommandListCoreFamily<gfxCoreFamily>>();
|
||||
commandList->initialize(device1, NEO::EngineGroupType::renderCompute, 0u);
|
||||
|
||||
uint32_t pattern = 1;
|
||||
char pattern = 'a';
|
||||
result = commandList->appendBlitFill(ptr, &pattern, sizeof(pattern), size, nullptr, 0, nullptr, false);
|
||||
EXPECT_EQ(result, ZE_RESULT_SUCCESS);
|
||||
|
||||
@@ -4291,7 +4291,7 @@ HWTEST2_F(MultipleDevicePeerAllocationTest,
|
||||
auto commandList = std::make_unique<::L0::ult::CommandListCoreFamily<gfxCoreFamily>>();
|
||||
commandList->initialize(device0, NEO::EngineGroupType::renderCompute, 0u);
|
||||
|
||||
uint32_t pattern = 1;
|
||||
char pattern = 'a';
|
||||
result = commandList->appendBlitFill(ptr, &pattern, sizeof(pattern), size, nullptr, 0, nullptr, false);
|
||||
EXPECT_EQ(result, ZE_RESULT_SUCCESS);
|
||||
|
||||
@@ -4310,7 +4310,7 @@ HWTEST2_F(MultipleDevicePeerAllocationTest,
|
||||
auto commandList = std::make_unique<::L0::ult::CommandListCoreFamily<gfxCoreFamily>>();
|
||||
commandList->initialize(device0, NEO::EngineGroupType::renderCompute, 0u);
|
||||
|
||||
uint32_t pattern = 1;
|
||||
char pattern = 'a';
|
||||
ze_result_t result = commandList->appendBlitFill(ptr, &pattern, sizeof(pattern), size, nullptr, 0, nullptr, false);
|
||||
EXPECT_EQ(result, ZE_RESULT_ERROR_INVALID_ARGUMENT);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user