mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Ensure base ptr is passed to PageFaultManager::removeAllocation
Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
f5fb26d017
commit
e197736b6f
@ -7,6 +7,8 @@
|
||||
|
||||
#pragma once
|
||||
#include "shared/source/memory_manager/unified_memory_manager.h"
|
||||
#include "shared/test/common/fixtures/cpu_page_fault_manager_tests_fixture.h"
|
||||
#include "shared/test/common/mocks/mock_graphics_allocation.h"
|
||||
namespace NEO {
|
||||
struct MockSVMAllocsManager : public SVMAllocsManager {
|
||||
public:
|
||||
@ -19,4 +21,31 @@ struct MockSVMAllocsManager : public SVMAllocsManager {
|
||||
using SVMAllocsManager::usmDeviceAllocationsCache;
|
||||
using SVMAllocsManager::usmDeviceAllocationsCacheEnabled;
|
||||
};
|
||||
|
||||
template <bool enableLocalMemory>
|
||||
struct SVMMemoryAllocatorFixture {
|
||||
SVMMemoryAllocatorFixture() : executionEnvironment(defaultHwInfo.get()) {}
|
||||
|
||||
void setUp() {
|
||||
bool svmSupported = executionEnvironment.rootDeviceEnvironments[0]->getHardwareInfo()->capabilityTable.ftrSvm;
|
||||
if (!svmSupported) {
|
||||
GTEST_SKIP();
|
||||
}
|
||||
executionEnvironment.initGmm();
|
||||
memoryManager = std::make_unique<MockMemoryManager>(false, enableLocalMemory, executionEnvironment);
|
||||
svmManager = std::make_unique<MockSVMAllocsManager>(memoryManager.get(), false);
|
||||
if (enableLocalMemory) {
|
||||
memoryManager->pageFaultManager.reset(new MockPageFaultManager);
|
||||
}
|
||||
}
|
||||
void tearDown() {
|
||||
}
|
||||
|
||||
MockExecutionEnvironment executionEnvironment;
|
||||
std::unique_ptr<MockMemoryManager> memoryManager;
|
||||
std::unique_ptr<MockSVMAllocsManager> svmManager;
|
||||
RootDeviceIndicesContainer rootDeviceIndices = {mockRootDeviceIndex};
|
||||
std::map<uint32_t, DeviceBitfield> deviceBitfields{{mockRootDeviceIndex, mockDeviceBitfield}};
|
||||
};
|
||||
|
||||
} // namespace NEO
|
||||
|
Reference in New Issue
Block a user