mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 09:09:04 +08:00
Add memory prefetch for kmd migrated shared allocations
This feature is disabled by default, controlled with the knob AppendMemoryPrefetchForKmdMigratedSharedAllocations Related-To: NEO-6740 Signed-off-by: Milczarek, Slawomir <slawomir.milczarek@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
10e7b9d5be
commit
c0b7f05897
@@ -252,6 +252,24 @@ TEST_F(IoctlHelperPrelimFixture, givenDrmAllocationWhenSetMemAdviseWithDevicePre
|
||||
EXPECT_EQ(2u, drm->ioctlCallsCount);
|
||||
}
|
||||
|
||||
TEST_F(IoctlHelperPrelimFixture, givenDrmAllocationWhenSetMemPrefetchSucceedsThenReturnTrue) {
|
||||
MockBufferObject bo(drm.get(), 0, 0, 1);
|
||||
MockDrmAllocation allocation(AllocationType::BUFFER, MemoryPool::LocalMemory);
|
||||
allocation.bufferObjects[0] = &bo;
|
||||
|
||||
drm->ioctlRetVal = 0;
|
||||
EXPECT_TRUE(allocation.setMemPrefetch(drm.get()));
|
||||
}
|
||||
|
||||
TEST_F(IoctlHelperPrelimFixture, givenDrmAllocationWhenSetMemPrefetchFailsThenReturnFalse) {
|
||||
MockBufferObject bo(drm.get(), 0, 0, 1);
|
||||
MockDrmAllocation allocation(AllocationType::BUFFER, MemoryPool::LocalMemory);
|
||||
allocation.bufferObjects[0] = &bo;
|
||||
|
||||
drm->ioctlRetVal = EINVAL;
|
||||
EXPECT_FALSE(allocation.setMemPrefetch(drm.get()));
|
||||
}
|
||||
|
||||
TEST_F(IoctlHelperPrelimFixture, givenVariousDirectSubmissionFlagSettingWhenCreateDrmContextIsCalledThenCorrectFlagsArePassedToIoctl) {
|
||||
DebugManagerStateRestore stateRestore;
|
||||
uint32_t vmId = 0u;
|
||||
|
||||
@@ -169,6 +169,15 @@ TEST(IoctlHelperTestsUpstream, givenUpstreamWhenSetVmBoAdviseThenReturnTrue) {
|
||||
EXPECT_TRUE(ioctlHelper->setVmBoAdvise(drm.get(), 0, 0, nullptr));
|
||||
}
|
||||
|
||||
TEST(IoctlHelperTestsUpstream, givenUpstreamWhenSetVmPrefetchThenReturnTrue) {
|
||||
auto executionEnvironment = std::make_unique<ExecutionEnvironment>();
|
||||
executionEnvironment->prepareRootDeviceEnvironments(1);
|
||||
auto drm = std::make_unique<DrmTipMock>(*executionEnvironment->rootDeviceEnvironments[0]);
|
||||
|
||||
auto ioctlHelper = drm->getIoctlHelper();
|
||||
EXPECT_TRUE(ioctlHelper->setVmPrefetch(drm.get(), 0, 0, 0));
|
||||
}
|
||||
|
||||
TEST(IoctlHelperTestsUpstream, givenUpstreamWhenDirectSubmissionEnabledThenNoFlagsAdded) {
|
||||
DebugManagerStateRestore stateRestore;
|
||||
DebugManager.flags.DirectSubmissionDrmContext.set(1);
|
||||
|
||||
Reference in New Issue
Block a user