mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-19 06:24:51 +08:00
Move code from header files to cpp files
Moved code from: - shared/test/common/mocks/mock_execution_environment.h - shared/test/common/fixtures/mock_aub_center_fixture.h Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
0a3a5913ae
commit
59b3d3fbea
@@ -17,6 +17,8 @@
|
||||
#include "level_zero/core/test/unit_tests/mocks/mock_context.h"
|
||||
#include "level_zero/core/test/unit_tests/mocks/mock_device.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
namespace L0 {
|
||||
namespace ult {
|
||||
|
||||
|
||||
@@ -31,6 +31,8 @@
|
||||
#include "level_zero/core/test/unit_tests/mocks/mock_cmdlist.h"
|
||||
#include "level_zero/core/test/unit_tests/mocks/mock_kernel.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
namespace L0 {
|
||||
namespace ult {
|
||||
|
||||
|
||||
@@ -27,6 +27,8 @@
|
||||
#include "level_zero/core/test/unit_tests/mocks/mock_device.h"
|
||||
#include "level_zero/core/test/unit_tests/mocks/mock_kernel.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
namespace L0 {
|
||||
namespace ult {
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "shared/test/common/mocks/mock_gmm_client_context.h"
|
||||
#include "shared/test/common/mocks/mock_sip.h"
|
||||
#include "shared/test/common/test_stats.h"
|
||||
#include "shared/test/common/tests_configuration.h"
|
||||
|
||||
#include "level_zero/core/source/cmdlist/cmdlist.h"
|
||||
#include "level_zero/core/source/compiler_interface/l0_reg_path.h"
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
#include "level_zero/core/source/driver/driver_imp.h"
|
||||
#include "level_zero/core/test/unit_tests/fixtures/device_fixture.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
namespace NEO {
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
#include "level_zero/core/test/unit_tests/fixtures/device_fixture.h"
|
||||
#include <level_zero/zet_api.h>
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
namespace L0 {
|
||||
namespace ult {
|
||||
class MockMetricIpSamplingOsInterface;
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
#include "shared/test/common/helpers/variable_backup.h"
|
||||
#include "shared/test/common/mocks/mock_io_functions.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
extern bool sysmanUltsEnable;
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "opencl/test/unit_test/mocks/mock_context.h"
|
||||
|
||||
#include "CL/cl.h"
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
namespace NEO {
|
||||
class Device;
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
|
||||
#include "opencl/test/unit_test/fixtures/cl_device_fixture.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
namespace ULT {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2019-2021 Intel Corporation
|
||||
* Copyright (C) 2019-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -15,6 +15,8 @@
|
||||
#include "opencl/test/unit_test/mocks/mock_cl_device.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_context.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
namespace NEO {
|
||||
class MultiRootDeviceFixture : public ::testing::Test {
|
||||
public:
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
#include "opencl/source/platform/platform.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_platform.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
struct MultiTileFixture : public ::testing::Test {
|
||||
void SetUp() override {
|
||||
ultHwConfig.useMockedPrepareDeviceEnvironmentsFunc = false;
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
#include "opencl/test/unit_test/mocks/mock_kernel.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_program.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
#include "opencl/source/helpers/cl_memory_properties_helpers.h"
|
||||
#include "opencl/source/mem_obj/mem_obj_helper.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
TEST(MemoryManagerTest, givenEnabledLocalMemoryWhenAllocatingSharedResourceCopyThenLocalMemoryAllocationIsReturnedAndGpuAddresIsInStandard64kHeap) {
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "shared/source/helpers/constants.h"
|
||||
#include "shared/source/memory_manager/graphics_allocation.h"
|
||||
#include "shared/source/memory_manager/internal_allocation_storage.h"
|
||||
#include "shared/source/memory_manager/memory_banks.h"
|
||||
#include "shared/source/memory_manager/residency.h"
|
||||
#include "shared/source/os_interface/hw_info_config.h"
|
||||
#include "shared/source/os_interface/os_context.h"
|
||||
@@ -25,6 +26,8 @@
|
||||
#include "shared/test/common/helpers/raii_hw_helper.h"
|
||||
#include "shared/test/common/helpers/variable_backup.h"
|
||||
#include "shared/test/common/mocks/mock_allocation_properties.h"
|
||||
#include "shared/test/common/mocks/mock_aub_center.h"
|
||||
#include "shared/test/common/mocks/mock_aub_manager.h"
|
||||
#include "shared/test/common/mocks/mock_csr.h"
|
||||
#include "shared/test/common/mocks/mock_deferrable_deletion.h"
|
||||
#include "shared/test/common/mocks/mock_deferred_deleter.h"
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
#include "shared/source/utilities/perf_counter.h"
|
||||
#include "shared/test/common/mocks/mock_execution_environment.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
using namespace MetricsLibraryApi;
|
||||
|
||||
namespace NEO {
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
#include "opencl/test/unit_test/fixtures/cl_device_fixture.h"
|
||||
#include "opencl/test/unit_test/fixtures/context_fixture.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
class ProgramTests : public NEO::ClDeviceFixture,
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
|
||||
#include "opencl/test/unit_test/mocks/mock_cl_device.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
class CommandStreamReceiverWithActiveDebuggerTest : public ::testing::Test {
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
|
||||
#include "opencl/test/unit_test/mocks/mock_platform.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
void HwHelperTestsXeHpcCore::setupDeviceIdAndRevision(HardwareInfo *hwInfo, ClDevice &clDevice) {
|
||||
@@ -74,4 +76,4 @@ void HwHelperTestsXeHpcCore::checkIfMultiTileCsrWhenAllocatingCsrSpecificAllocat
|
||||
EXPECT_NE(heapAllocation, commandBufferAllocation);
|
||||
EXPECT_EQ(commandBufferAllocation->getMemoryPool(), MemoryPool::LocalMemory);
|
||||
}
|
||||
} // namespace NEO
|
||||
} // namespace NEO
|
||||
|
||||
@@ -8,8 +8,9 @@ target_sources(neo_libult_common PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cpu_page_fault_manager_tests_fixture.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/linear_stream_fixture.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/mock_aub_center_fixture.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/mock_aub_center_fixture.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/preamble_fixture.h
|
||||
)
|
||||
|
||||
add_subdirectories()
|
||||
add_subdirectories()
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
#include "shared/test/common/fixtures/command_stream_receiver_fixture.h"
|
||||
#include "shared/test/common/libult/ult_command_stream_receiver.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
template <typename FamilyType>
|
||||
void CommandStreamReceiverSystolicFixture::testBody() {
|
||||
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
#include "shared/test/common/mocks/mock_cpu_page_fault_manager.h"
|
||||
#include "shared/test/common/mocks/mock_memory_manager.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace NEO {
|
||||
|
||||
32
shared/test/common/fixtures/mock_aub_center_fixture.cpp
Normal file
32
shared/test/common/fixtures/mock_aub_center_fixture.cpp
Normal file
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/test/common/fixtures/mock_aub_center_fixture.h"
|
||||
|
||||
#include "shared/source/execution_environment/root_device_environment.h"
|
||||
#include "shared/test/common/helpers/default_hw_info.h"
|
||||
#include "shared/test/common/mocks/mock_aub_center.h"
|
||||
#include "shared/test/common/mocks/mock_aub_manager.h"
|
||||
#include "shared/test/common/tests_configuration.h"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
MockAubCenterFixture::MockAubCenterFixture(CommandStreamReceiverType commandStreamReceiverType) : commandStreamReceiverType(commandStreamReceiverType){};
|
||||
|
||||
void MockAubCenterFixture::setMockAubCenter(RootDeviceEnvironment &rootDeviceEnvironment) {
|
||||
setMockAubCenter(rootDeviceEnvironment, CommandStreamReceiverType::CSR_AUB);
|
||||
}
|
||||
void MockAubCenterFixture::setMockAubCenter(RootDeviceEnvironment &rootDeviceEnvironment, CommandStreamReceiverType commandStreamReceiverType) {
|
||||
if (testMode != TestMode::AubTests && testMode != TestMode::AubTestsWithTbx) {
|
||||
rootDeviceEnvironment.initGmm();
|
||||
auto mockAubCenter = std::make_unique<MockAubCenter>(defaultHwInfo.get(), *rootDeviceEnvironment.getGmmHelper(), false, "", commandStreamReceiverType);
|
||||
mockAubCenter->aubManager = std::make_unique<MockAubManager>();
|
||||
rootDeviceEnvironment.aubCenter.reset(mockAubCenter.release());
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
@@ -7,34 +7,22 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "shared/source/execution_environment/root_device_environment.h"
|
||||
#include "shared/test/common/helpers/default_hw_info.h"
|
||||
#include "shared/test/common/mocks/mock_aub_center.h"
|
||||
#include "shared/test/common/mocks/mock_aub_manager.h"
|
||||
#include "shared/test/common/tests_configuration.h"
|
||||
#include "shared/source/helpers/options.h"
|
||||
|
||||
namespace NEO {
|
||||
struct RootDeviceEnvironment;
|
||||
struct MockAubCenterFixture {
|
||||
|
||||
MockAubCenterFixture() = default;
|
||||
MockAubCenterFixture(CommandStreamReceiverType commandStreamReceiverType) : commandStreamReceiverType(commandStreamReceiverType){};
|
||||
MockAubCenterFixture(CommandStreamReceiverType commandStreamReceiverType);
|
||||
|
||||
void setUp() {
|
||||
}
|
||||
void tearDown() {
|
||||
}
|
||||
|
||||
static void setMockAubCenter(RootDeviceEnvironment &rootDeviceEnvironment) {
|
||||
setMockAubCenter(rootDeviceEnvironment, CommandStreamReceiverType::CSR_AUB);
|
||||
}
|
||||
static void setMockAubCenter(RootDeviceEnvironment &rootDeviceEnvironment, CommandStreamReceiverType commandStreamReceiverType) {
|
||||
if (testMode != TestMode::AubTests && testMode != TestMode::AubTestsWithTbx) {
|
||||
rootDeviceEnvironment.initGmm();
|
||||
auto mockAubCenter = std::make_unique<MockAubCenter>(defaultHwInfo.get(), *rootDeviceEnvironment.getGmmHelper(), false, "", commandStreamReceiverType);
|
||||
mockAubCenter->aubManager = std::make_unique<MockAubManager>();
|
||||
rootDeviceEnvironment.aubCenter.reset(mockAubCenter.release());
|
||||
}
|
||||
}
|
||||
static void setMockAubCenter(RootDeviceEnvironment &rootDeviceEnvironment);
|
||||
static void setMockAubCenter(RootDeviceEnvironment &rootDeviceEnvironment, CommandStreamReceiverType commandStreamReceiverType);
|
||||
|
||||
protected:
|
||||
CommandStreamReceiverType commandStreamReceiverType = CommandStreamReceiverType::CSR_AUB;
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
#include "shared/test/common/fixtures/mock_execution_environment_gmm_fixture.h"
|
||||
|
||||
#include "shared/source/execution_environment/root_device_environment.h"
|
||||
#include "shared/test/common/mocks/mock_execution_environment.h"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
@@ -46,6 +46,7 @@ set(NEO_CORE_tests_mocks
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/mock_direct_submission_hw.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/mock_driver_model.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/mock_elf.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/mock_execution_environment.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/mock_execution_environment.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/mock_experimental_command_buffer.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/mock_gfx_partition.cpp
|
||||
@@ -131,4 +132,4 @@ target_include_directories(neo_shared_mocks PRIVATE
|
||||
${SOURCE_LEVEL_DEBUGGER_HEADERS_DIR}
|
||||
)
|
||||
target_compile_definitions(neo_shared_mocks PRIVATE $<TARGET_PROPERTY:${NEO_SHARED_MOCKABLE_LIB_NAME},INTERFACE_COMPILE_DEFINITIONS>)
|
||||
create_project_source_tree(neo_shared_mocks)
|
||||
create_project_source_tree(neo_shared_mocks)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2021 Intel Corporation
|
||||
* Copyright (C) 2018-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "shared/source/built_ins/sip.h"
|
||||
#include "shared/test/common/mocks/mock_sip.h"
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
|
||||
namespace NEO {
|
||||
@@ -33,4 +34,4 @@ class MockBuiltins : public BuiltIns {
|
||||
bool getSipKernelCalled = false;
|
||||
SipKernelType getSipKernelType = SipKernelType::COUNT;
|
||||
};
|
||||
} // namespace NEO
|
||||
} // namespace NEO
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "shared/source/device/sub_device.h"
|
||||
#include "shared/source/memory_manager/memory_manager.h"
|
||||
#include "shared/test/common/fixtures/mock_aub_center_fixture.h"
|
||||
#include "shared/test/common/helpers/default_hw_info.h"
|
||||
#include "shared/test/common/helpers/variable_backup.h"
|
||||
#include "shared/test/common/mocks/mock_graphics_allocation.h"
|
||||
|
||||
|
||||
56
shared/test/common/mocks/mock_execution_environment.cpp
Normal file
56
shared/test/common/mocks/mock_execution_environment.cpp
Normal file
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/test/common/mocks/mock_execution_environment.h"
|
||||
|
||||
#include "shared/test/common/fixtures/mock_aub_center_fixture.h"
|
||||
#include "shared/test/common/helpers/default_hw_info.h"
|
||||
|
||||
namespace NEO {
|
||||
extern bool useMockGmm;
|
||||
|
||||
void MockRootDeviceEnvironment::initAubCenter(bool localMemoryEnabled, const std::string &aubFileName, CommandStreamReceiverType csrType) {
|
||||
if (!initAubCenterCalled) {
|
||||
initAubCenterCalled = true;
|
||||
localMemoryEnabledReceived = localMemoryEnabled;
|
||||
aubFileNameReceived = aubFileName;
|
||||
}
|
||||
if (useMockAubCenter) {
|
||||
MockAubCenterFixture::setMockAubCenter(*this);
|
||||
}
|
||||
RootDeviceEnvironment::initAubCenter(localMemoryEnabled, aubFileName, csrType);
|
||||
}
|
||||
|
||||
MockExecutionEnvironment::MockExecutionEnvironment() : MockExecutionEnvironment(defaultHwInfo.get()) {}
|
||||
MockExecutionEnvironment::MockExecutionEnvironment(const HardwareInfo *hwInfo) : MockExecutionEnvironment(hwInfo, true, 1u) {
|
||||
}
|
||||
MockExecutionEnvironment::MockExecutionEnvironment(const HardwareInfo *hwInfo, bool useMockAubCenter, uint32_t numRootDevices) {
|
||||
prepareRootDeviceEnvironments(numRootDevices);
|
||||
for (auto rootDeviceIndex = 0u; rootDeviceIndex < numRootDevices; rootDeviceIndex++) {
|
||||
auto rootDeviceEnvironment = new MockRootDeviceEnvironment(*this);
|
||||
rootDeviceEnvironment->useMockAubCenter = useMockAubCenter;
|
||||
rootDeviceEnvironments[rootDeviceIndex].reset(rootDeviceEnvironment);
|
||||
|
||||
if (hwInfo) {
|
||||
rootDeviceEnvironments[rootDeviceIndex]->setHwInfo(hwInfo);
|
||||
} else {
|
||||
rootDeviceEnvironments[rootDeviceIndex]->setHwInfo(defaultHwInfo.get());
|
||||
}
|
||||
if (useMockGmm) {
|
||||
rootDeviceEnvironments[rootDeviceIndex]->initGmm();
|
||||
}
|
||||
}
|
||||
|
||||
calculateMaxOsContextCount();
|
||||
}
|
||||
void MockExecutionEnvironment::initGmm() {
|
||||
for (auto &rootDeviceEnvironment : rootDeviceEnvironments) {
|
||||
rootDeviceEnvironment->initGmm();
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
@@ -8,28 +8,16 @@
|
||||
#pragma once
|
||||
|
||||
#include "shared/source/execution_environment/execution_environment.h"
|
||||
#include "shared/source/helpers/hw_helper.h"
|
||||
#include "shared/test/common/fixtures/mock_aub_center_fixture.h"
|
||||
#include "shared/source/execution_environment/root_device_environment.h"
|
||||
|
||||
namespace NEO {
|
||||
extern bool useMockGmm;
|
||||
|
||||
struct MockRootDeviceEnvironment : public RootDeviceEnvironment {
|
||||
using RootDeviceEnvironment::RootDeviceEnvironment;
|
||||
|
||||
~MockRootDeviceEnvironment() override = default;
|
||||
|
||||
void initAubCenter(bool localMemoryEnabled, const std::string &aubFileName, CommandStreamReceiverType csrType) override {
|
||||
if (!initAubCenterCalled) {
|
||||
initAubCenterCalled = true;
|
||||
localMemoryEnabledReceived = localMemoryEnabled;
|
||||
aubFileNameReceived = aubFileName;
|
||||
}
|
||||
if (useMockAubCenter) {
|
||||
MockAubCenterFixture::setMockAubCenter(*this);
|
||||
}
|
||||
RootDeviceEnvironment::initAubCenter(localMemoryEnabled, aubFileName, csrType);
|
||||
}
|
||||
void initAubCenter(bool localMemoryEnabled, const std::string &aubFileName, CommandStreamReceiverType csrType) override;
|
||||
bool initAubCenterCalled = false;
|
||||
bool localMemoryEnabledReceived = false;
|
||||
std::string aubFileNameReceived = "";
|
||||
@@ -40,33 +28,10 @@ struct MockExecutionEnvironment : ExecutionEnvironment {
|
||||
using ExecutionEnvironment::directSubmissionController;
|
||||
|
||||
~MockExecutionEnvironment() override = default;
|
||||
MockExecutionEnvironment() : MockExecutionEnvironment(defaultHwInfo.get()) {}
|
||||
MockExecutionEnvironment(const HardwareInfo *hwInfo) : MockExecutionEnvironment(hwInfo, true, 1u) {
|
||||
}
|
||||
MockExecutionEnvironment(const HardwareInfo *hwInfo, bool useMockAubCenter, uint32_t numRootDevices) {
|
||||
prepareRootDeviceEnvironments(numRootDevices);
|
||||
for (auto rootDeviceIndex = 0u; rootDeviceIndex < numRootDevices; rootDeviceIndex++) {
|
||||
auto rootDeviceEnvironment = new MockRootDeviceEnvironment(*this);
|
||||
rootDeviceEnvironment->useMockAubCenter = useMockAubCenter;
|
||||
rootDeviceEnvironments[rootDeviceIndex].reset(rootDeviceEnvironment);
|
||||
|
||||
if (hwInfo) {
|
||||
rootDeviceEnvironments[rootDeviceIndex]->setHwInfo(hwInfo);
|
||||
} else {
|
||||
rootDeviceEnvironments[rootDeviceIndex]->setHwInfo(defaultHwInfo.get());
|
||||
}
|
||||
if (useMockGmm) {
|
||||
rootDeviceEnvironments[rootDeviceIndex]->initGmm();
|
||||
}
|
||||
}
|
||||
|
||||
calculateMaxOsContextCount();
|
||||
}
|
||||
void initGmm() {
|
||||
for (auto &rootDeviceEnvironment : rootDeviceEnvironments) {
|
||||
rootDeviceEnvironment->initGmm();
|
||||
}
|
||||
}
|
||||
MockExecutionEnvironment();
|
||||
MockExecutionEnvironment(const HardwareInfo *hwInfo);
|
||||
MockExecutionEnvironment(const HardwareInfo *hwInfo, bool useMockAubCenter, uint32_t numRootDevices);
|
||||
void initGmm();
|
||||
};
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "shared/test/common/helpers/variable_backup.h"
|
||||
#include "shared/test/common/mocks/mock_device.h"
|
||||
#include "shared/test/common/mocks/mock_memory_manager.h"
|
||||
#include "shared/test/common/tests_configuration.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
#include "shared/test/common/helpers/engine_descriptor_helper.h"
|
||||
#include "shared/test/common/mocks/mock_execution_environment.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
#include "shared/test/common/mocks/mock_device.h"
|
||||
#include "shared/test/common/mocks/mock_execution_environment.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
template <typename GfxFamily>
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "shared/test/common/fixtures/aub_command_stream_receiver_fixture.h"
|
||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||
#include "shared/test/common/helpers/engine_descriptor_helper.h"
|
||||
#include "shared/test/common/mocks/mock_aub_center.h"
|
||||
#include "shared/test/common/mocks/mock_aub_csr.h"
|
||||
#include "shared/test/common/mocks/mock_aub_manager.h"
|
||||
#include "shared/test/common/mocks/mock_memory_manager.h"
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "shared/source/os_interface/device_factory.h"
|
||||
#include "shared/source/os_interface/hw_info_config.h"
|
||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||
#include "shared/test/common/helpers/default_hw_info.h"
|
||||
#include "shared/test/common/helpers/ult_hw_config.h"
|
||||
#include "shared/test/common/helpers/variable_backup.h"
|
||||
#include "shared/test/common/libult/create_command_stream.h"
|
||||
|
||||
@@ -21,6 +21,8 @@
|
||||
#include "shared/test/common/helpers/engine_descriptor_helper.h"
|
||||
#include "shared/test/common/helpers/variable_backup.h"
|
||||
#include "shared/test/common/mocks/mock_allocation_properties.h"
|
||||
#include "shared/test/common/mocks/mock_aub_center.h"
|
||||
#include "shared/test/common/mocks/mock_aub_manager.h"
|
||||
#include "shared/test/common/mocks/mock_aub_subcapture_manager.h"
|
||||
#include "shared/test/common/mocks/mock_execution_environment.h"
|
||||
#include "shared/test/common/mocks/mock_graphics_allocation.h"
|
||||
|
||||
@@ -16,8 +16,7 @@ namespace NEO {
|
||||
using RootDeviceEnvironmentTests = ::testing::Test;
|
||||
|
||||
HWTEST2_F(RootDeviceEnvironmentTests, givenRootDeviceEnvironmentWhenAILInitProcessExecutableNameReturnsFailedThenInitAilConfigurationReturnsFail, IsDG1) {
|
||||
MockExecutionEnvironment executionEnvironment;
|
||||
executionEnvironment.rootDeviceEnvironments[0]->setHwInfo(defaultHwInfo.get());
|
||||
MockExecutionEnvironment executionEnvironment{};
|
||||
auto rootDeviceEnvironment = static_cast<MockRootDeviceEnvironment *>(executionEnvironment.rootDeviceEnvironments[0].get());
|
||||
|
||||
class AILDG1 : public AILConfigurationHw<productFamily> {
|
||||
@@ -33,4 +32,4 @@ HWTEST2_F(RootDeviceEnvironmentTests, givenRootDeviceEnvironmentWhenAILInitProce
|
||||
|
||||
EXPECT_EQ(false, rootDeviceEnvironment->initAilConfiguration());
|
||||
}
|
||||
} // namespace NEO
|
||||
} // namespace NEO
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
#include "shared/test/common/fixtures/device_fixture.h"
|
||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||
#include "shared/test/common/helpers/default_hw_info.h"
|
||||
#include "shared/test/common/mocks/mock_aub_center.h"
|
||||
#include "shared/test/common/mocks/mock_aub_manager.h"
|
||||
#include "shared/test/common/mocks/mock_execution_environment.h"
|
||||
#include "shared/test/common/test_macros/header/per_product_test_definitions.h"
|
||||
#include "shared/test/common/test_macros/test.h"
|
||||
@@ -235,4 +237,4 @@ TGLLPTEST_F(TgllpHwInfo, givenHwInfoConfigWhenGetProductConfigThenCorrectMatchIs
|
||||
HardwareInfo hwInfo = *defaultHwInfo;
|
||||
const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily);
|
||||
EXPECT_EQ(hwInfoConfig.getProductConfigFromHwInfo(hwInfo), AOT::TGL);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ HWTEST2_F(HwInfoOverrideTest, givenAnyHwConfigStringWhenPrepareDeviceEnvironment
|
||||
DebugManagerStateRestore stateRestore;
|
||||
DebugManager.flags.HardwareInfoOverride.set("1x2x3");
|
||||
|
||||
MockExecutionEnvironment executionEnvironment(defaultHwInfo.get());
|
||||
MockExecutionEnvironment executionEnvironment{};
|
||||
|
||||
bool success = DeviceFactory::prepareDeviceEnvironmentsForProductFamilyOverride(executionEnvironment);
|
||||
EXPECT_TRUE(success);
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
#include "shared/test/common/libult/linux/drm_mock.h"
|
||||
#include "shared/test/common/mocks/mock_execution_environment.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
namespace NEO {
|
||||
extern Drm **pDrmToReturnFromCreateFunc;
|
||||
}; // namespace NEO
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "shared/source/gmm_helper/resource_info.h"
|
||||
#include "shared/source/helpers/surface_format_info.h"
|
||||
#include "shared/source/memory_manager/compression_selector.h"
|
||||
#include "shared/source/memory_manager/memory_banks.h"
|
||||
#include "shared/source/memory_manager/unified_memory_manager.h"
|
||||
#include "shared/source/os_interface/linux/allocator_helper.h"
|
||||
#include "shared/test/common/fixtures/memory_allocator_multi_device_fixture.h"
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "shared/source/execution_environment/execution_environment.h"
|
||||
#include "shared/source/gmm_helper/gmm_helper.h"
|
||||
#include "shared/source/helpers/heap_assigner.h"
|
||||
#include "shared/source/memory_manager/memory_banks.h"
|
||||
#include "shared/source/os_interface/linux/allocator_helper.h"
|
||||
#include "shared/source/os_interface/linux/drm_allocation.h"
|
||||
#include "shared/source/os_interface/linux/drm_buffer_object.h"
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
#include "shared/source/built_ins/sip.h"
|
||||
#include "shared/source/helpers/surface_format_info.h"
|
||||
#include "shared/source/memory_manager/memory_banks.h"
|
||||
#include "shared/source/os_interface/linux/drm_memory_operations_handler.h"
|
||||
#include "shared/source/os_interface/linux/i915.h"
|
||||
#include "shared/source/os_interface/linux/os_context_linux.h"
|
||||
@@ -5512,4 +5513,4 @@ TEST_F(DrmMemoryManagerTest, givenMakeBosResidentSuccessWhenRegisteringMemoryAll
|
||||
EXPECT_EQ(MemoryManager::AllocationStatus::Success, memoryManager->registerSysMemAlloc(&allocation));
|
||||
|
||||
EXPECT_EQ(MemoryManager::AllocationStatus::Success, memoryManager->registerLocalMemAlloc(&allocation, 0));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,9 @@
|
||||
#include "shared/test/common/fixtures/aub_command_stream_receiver_fixture.h"
|
||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||
#include "shared/test/common/helpers/engine_descriptor_helper.h"
|
||||
#include "shared/test/common/mocks/mock_aub_center.h"
|
||||
#include "shared/test/common/mocks/mock_aub_csr.h"
|
||||
#include "shared/test/common/mocks/mock_aub_manager.h"
|
||||
#include "shared/test/common/mocks/mock_device.h"
|
||||
#include "shared/test/common/mocks/mock_os_context.h"
|
||||
#include "shared/test/common/test_macros/header/per_product_test_definitions.h"
|
||||
|
||||
Reference in New Issue
Block a user