mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-04 15:53:45 +08:00
fix: adjust tests to enabled global allocator 2/n
Related-To: NEO-7063 Signed-off-by: Fabian Zwoliński <fabian.zwolinski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
e79c60a965
commit
bc8d950105
@@ -102,6 +102,8 @@ void MultiDeviceFixture::setUp() {
|
||||
debugManager.flags.CreateMultipleRootDevices.set(numRootDevices);
|
||||
debugManager.flags.CreateMultipleSubDevices.set(numSubDevices);
|
||||
auto executionEnvironment = new NEO::ExecutionEnvironment;
|
||||
executionEnvironment->prepareRootDeviceEnvironments(1u);
|
||||
executionEnvironment->rootDeviceEnvironments[0]->memoryOperationsInterface = std::make_unique<MockMemoryOperations>();
|
||||
auto devices = NEO::DeviceFactory::createDevices(*executionEnvironment);
|
||||
driverHandle = std::make_unique<Mock<L0::DriverHandleImp>>();
|
||||
ze_result_t res = driverHandle->initialize(std::move(devices));
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "level_zero/core/test/unit_tests/fixtures/module_fixture.h"
|
||||
|
||||
#include "shared/source/command_container/implicit_scaling.h"
|
||||
#include "shared/source/helpers/api_specific_config.h"
|
||||
#include "shared/test/common/mocks/mock_device.h"
|
||||
#include "shared/test/common/mocks/mock_graphics_allocation.h"
|
||||
|
||||
@@ -163,6 +164,9 @@ void ModuleFixture::createKernel() {
|
||||
kernel = std::make_unique<WhiteBox<::L0::KernelImp>>();
|
||||
kernel->module = module.get();
|
||||
kernel->initialize(&desc);
|
||||
if (NEO::ApiSpecificConfig::getBindlessMode(device->getNEODevice()->getReleaseHelper())) {
|
||||
const_cast<KernelDescriptor &>(kernel->getKernelDescriptor()).kernelAttributes.bufferAddressingMode = KernelDescriptor::Bindless;
|
||||
}
|
||||
}
|
||||
|
||||
std::unique_ptr<WhiteBox<::L0::KernelImp>> ModuleFixture::createKernelWithName(std::string name) {
|
||||
|
||||
@@ -828,12 +828,12 @@ HWTEST_F(CommandListAppendLaunchKernel, givenKernelWithPrintfAndEventAppendedToI
|
||||
}
|
||||
|
||||
HWTEST_F(CommandListAppendLaunchKernel, WhenAppendingMultipleTimesThenSshIsNotDepletedButReallocated) {
|
||||
createKernel();
|
||||
ze_result_t returnValue;
|
||||
|
||||
DebugManagerStateRestore dbgRestorer;
|
||||
debugManager.flags.UseBindlessMode.set(0);
|
||||
|
||||
createKernel();
|
||||
ze_result_t returnValue;
|
||||
|
||||
std::unique_ptr<L0::CommandList> commandList(CommandList::create(productFamily, device, NEO::EngineGroupType::renderCompute, 0u, returnValue, false));
|
||||
ze_group_count_t groupCount{1, 1, 1};
|
||||
|
||||
@@ -1200,6 +1200,8 @@ HWTEST_F(CommandListAppendLaunchKernel, givenCommandListWhenResetCalledThenState
|
||||
DebugManagerStateRestore dbgRestorer;
|
||||
debugManager.flags.EnableStateBaseAddressTracking.set(0);
|
||||
|
||||
auto bindlessHeapsHelper = neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[neoDevice->getRootDeviceIndex()]->bindlessHeapsHelper.get();
|
||||
|
||||
using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS;
|
||||
createKernel();
|
||||
|
||||
@@ -1241,6 +1243,9 @@ HWTEST_F(CommandListAppendLaunchKernel, givenCommandListWhenResetCalledThenState
|
||||
if (NEO::HeapType::dynamicState == heapType && !device->getHwInfo().capabilityTable.supportsImages) {
|
||||
ASSERT_EQ(nullptr, commandListControl->getCmdContainer().getIndirectHeapAllocation(heapType));
|
||||
ASSERT_EQ(nullptr, commandListControl->getCmdContainer().getIndirectHeap(heapType));
|
||||
} else if (NEO::HeapType::surfaceState == heapType && bindlessHeapsHelper) {
|
||||
ASSERT_EQ(nullptr, commandListControl->getCmdContainer().getIndirectHeapAllocation(heapType));
|
||||
ASSERT_EQ(nullptr, commandListControl->getCmdContainer().getIndirectHeap(heapType));
|
||||
} else {
|
||||
ASSERT_NE(nullptr, commandListControl->getCmdContainer().getIndirectHeapAllocation(heapType));
|
||||
ASSERT_NE(nullptr, commandList->getCmdContainer().getIndirectHeapAllocation(heapType));
|
||||
|
||||
@@ -2349,6 +2349,8 @@ HWTEST2_F(ImmediateFlushTaskPrivateHeapCmdListTest,
|
||||
IsAtLeastXeHpCore) {
|
||||
using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS;
|
||||
|
||||
auto bindlessHeapsHelper = neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[neoDevice->getRootDeviceIndex()]->bindlessHeapsHelper.get();
|
||||
|
||||
auto &csrImmediate = neoDevice->getUltCommandStreamReceiver<FamilyType>();
|
||||
csrImmediate.storeMakeResidentAllocations = true;
|
||||
auto &csrStream = csrImmediate.commandStream;
|
||||
@@ -2385,7 +2387,11 @@ HWTEST2_F(ImmediateFlushTaskPrivateHeapCmdListTest,
|
||||
EXPECT_EQ(ssBaseAddress, sbaCmd->getSurfaceStateBaseAddress());
|
||||
|
||||
EXPECT_EQ(dshRequired, sbaCmd->getDynamicStateBaseAddressModifyEnable());
|
||||
EXPECT_EQ(dsBaseAddress, sbaCmd->getDynamicStateBaseAddress());
|
||||
if (bindlessHeapsHelper) {
|
||||
EXPECT_EQ(bindlessHeapsHelper->getGlobalHeapsBase(), sbaCmd->getDynamicStateBaseAddress());
|
||||
} else {
|
||||
EXPECT_EQ(dsBaseAddress, sbaCmd->getDynamicStateBaseAddress());
|
||||
}
|
||||
|
||||
EXPECT_EQ(ioBaseAddress, sbaCmd->getGeneralStateBaseAddress());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user