mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Make work partition allocation resident
Related-To: NEO-5546 Signed-off-by: Maciej Dziuban <maciej.dziuban@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
9f3218775d
commit
c361570fab
@ -10,6 +10,7 @@
|
||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||
#include "shared/test/common/helpers/dispatch_flags_helper.h"
|
||||
#include "shared/test/common/mocks/mock_device.h"
|
||||
#include "shared/test/common/mocks/ult_device_factory.h"
|
||||
|
||||
#include "opencl/source/helpers/hardware_commands_helper.h"
|
||||
#include "opencl/source/mem_obj/buffer.h"
|
||||
@ -1941,3 +1942,37 @@ TEST(MultiRootDeviceCommandStreamReceiverTests, givenMultipleEventInMultiRootDev
|
||||
EXPECT_EQ(2u, mockCsr3->waitForCompletionWithTimeoutCalled);
|
||||
}
|
||||
}
|
||||
|
||||
HWTEST_F(CommandStreamReceiverFlushTaskTests, givenStaticPartitioningEnabledWhenFlushingTaskThenWorkPartitionAllocationIsMadeResident) {
|
||||
DebugManagerStateRestore restore{};
|
||||
DebugManager.flags.EnableStaticPartitioning.set(1);
|
||||
DebugManager.flags.ForcePreemptionMode.set(PreemptionMode::Disabled);
|
||||
UltDeviceFactory deviceFactory{1, 2};
|
||||
MockDevice *device = deviceFactory.rootDevices[0];
|
||||
auto &mockCsr = device->getUltCommandStreamReceiver<FamilyType>();
|
||||
ASSERT_NE(nullptr, mockCsr.getWorkPartitionAllocation());
|
||||
|
||||
auto mockedSubmissionsAggregator = new mockSubmissionsAggregator();
|
||||
mockCsr.overrideDispatchPolicy(DispatchMode::BatchedDispatch);
|
||||
mockCsr.submissionAggregator.reset(mockedSubmissionsAggregator);
|
||||
|
||||
DispatchFlags dispatchFlags = DispatchFlagsHelper::createDefaultDispatchFlags();
|
||||
mockCsr.flushTask(commandStream,
|
||||
0,
|
||||
dsh,
|
||||
ioh,
|
||||
ssh,
|
||||
taskLevel,
|
||||
dispatchFlags,
|
||||
*device);
|
||||
|
||||
auto cmdBuffer = mockedSubmissionsAggregator->peekCommandBuffers().peekHead();
|
||||
bool found = false;
|
||||
for (auto allocation : cmdBuffer->surfaces) {
|
||||
if (allocation == mockCsr.getWorkPartitionAllocation()) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
EXPECT_TRUE(found);
|
||||
}
|
||||
|
Reference in New Issue
Block a user