mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 06:49:52 +08:00
Cleaned up files: shared/source/command_stream/experimental_command_buffer.h shared/source/helpers/get_info.h shared/source/helpers/local_id_gen.h shared/source/memory_manager/gfx_partition.h shared/source/memory_manager/host_ptr_manager.h shared/source/memory_manager/prefetch_manager.h shared/test/common/mocks/mock_memory_manager.h Related-To: NEO-5548 Signed-off-by: Warchulski, Jaroslaw <jaroslaw.warchulski@intel.com>
55 lines
1.9 KiB
C++
55 lines
1.9 KiB
C++
/*
|
|
* Copyright (C) 2018-2023 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#pragma once
|
|
#include "shared/source/helpers/hw_info.h"
|
|
#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/helpers/default_hw_info.h"
|
|
#include "shared/test/common/mocks/mock_graphics_allocation.h"
|
|
|
|
namespace NEO {
|
|
struct MockSVMAllocsManager : public SVMAllocsManager {
|
|
public:
|
|
using SVMAllocsManager::memoryManager;
|
|
using SVMAllocsManager::mtxForIndirectAccess;
|
|
using SVMAllocsManager::multiOsContextSupport;
|
|
using SVMAllocsManager::SVMAllocs;
|
|
using SVMAllocsManager::SVMAllocsManager;
|
|
using SVMAllocsManager::svmMapOperations;
|
|
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
|