mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 14:55:24 +08:00
Refactor L0 mock enablers
- add l0_libult target that groups all enablers - enhance aub fixture - add debugging mode Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
9bc364e7a7
commit
a73d3612ce
@@ -129,10 +129,10 @@ class DebuggerL0Hw : public DebuggerL0 {
|
||||
DebuggerL0Hw(NEO::Device *device) : DebuggerL0(device){};
|
||||
};
|
||||
|
||||
template <uint32_t productFamily, typename GfxFamily>
|
||||
template <uint32_t coreFamily, typename GfxFamily>
|
||||
struct DebuggerL0PopulateFactory {
|
||||
DebuggerL0PopulateFactory() {
|
||||
debuggerL0Factory[productFamily] = DebuggerL0Hw<GfxFamily>::allocate;
|
||||
debuggerL0Factory[coreFamily] = DebuggerL0Hw<GfxFamily>::allocate;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (C) 2021 Intel Corporation
|
||||
# Copyright (C) 2021-2022 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
@@ -55,6 +55,7 @@ target_sources(${TARGET_NAME} PRIVATE
|
||||
$<TARGET_OBJECTS:${BUILTINS_BINARIES_BINDFUL_LIB_NAME}>
|
||||
$<TARGET_OBJECTS:${BUILTINS_BINARIES_BINDLESS_LIB_NAME}>
|
||||
$<TARGET_OBJECTS:neo_aub_tests_config>
|
||||
$<TARGET_OBJECTS:l0_libult>
|
||||
)
|
||||
if(TARGET ${BUILTINS_SPIRV_LIB_NAME})
|
||||
target_sources(${TARGET_NAME} PRIVATE
|
||||
|
||||
@@ -32,9 +32,9 @@ void AUBFixtureL0::prepareCopyEngines(NEO::MockDevice &device, const std::string
|
||||
}
|
||||
|
||||
void AUBFixtureL0::SetUp() {
|
||||
SetUp(NEO::defaultHwInfo.get());
|
||||
SetUp(NEO::defaultHwInfo.get(), false);
|
||||
}
|
||||
void AUBFixtureL0::SetUp(const NEO::HardwareInfo *hardwareInfo) {
|
||||
void AUBFixtureL0::SetUp(const NEO::HardwareInfo *hardwareInfo, bool debuggingEnabled) {
|
||||
ASSERT_NE(nullptr, hardwareInfo);
|
||||
const auto &hwInfo = *hardwareInfo;
|
||||
|
||||
@@ -51,6 +51,9 @@ void AUBFixtureL0::SetUp(const NEO::HardwareInfo *hardwareInfo) {
|
||||
executionEnvironment->prepareRootDeviceEnvironments(1u);
|
||||
executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(&hwInfo);
|
||||
|
||||
if (debuggingEnabled) {
|
||||
executionEnvironment->setDebuggingEnabled();
|
||||
}
|
||||
neoDevice = NEO::MockDevice::createWithExecutionEnvironment<NEO::MockDevice>(&hwInfo, executionEnvironment, 0u);
|
||||
|
||||
if (NEO::testMode == NEO::TestMode::AubTestsWithTbx) {
|
||||
@@ -65,6 +68,9 @@ void AUBFixtureL0::SetUp(const NEO::HardwareInfo *hardwareInfo) {
|
||||
NEO::DeviceVector devices;
|
||||
devices.push_back(std::unique_ptr<NEO::Device>(neoDevice));
|
||||
driverHandle = std::make_unique<ult::Mock<DriverHandleImp>>();
|
||||
|
||||
driverHandle->enableProgramDebugging = debuggingEnabled;
|
||||
|
||||
driverHandle->initialize(std::move(devices));
|
||||
|
||||
device = driverHandle->devices[0];
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
* Copyright (C) 2021-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -41,7 +41,7 @@ class AUBFixtureL0 {
|
||||
AUBFixtureL0();
|
||||
virtual ~AUBFixtureL0();
|
||||
void SetUp();
|
||||
void SetUp(const NEO::HardwareInfo *hardwareInfo);
|
||||
void SetUp(const NEO::HardwareInfo *hardwareInfo, bool debuggingEnabled);
|
||||
void TearDown();
|
||||
static void prepareCopyEngines(NEO::MockDevice &device, const std::string &filename);
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (C) 2021 Intel Corporation
|
||||
# Copyright (C) 2021-2022 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
@@ -43,3 +43,24 @@ add_custom_target(l0_common_test_kernels DEPENDS ${l0_test_kernel_outputs} ${l0_
|
||||
set_target_properties(l0_common_test_kernels PROPERTIES FOLDER ${TARGET_NAME_L0})
|
||||
add_dependencies(prepare_test_kernels_for_l0 l0_common_test_kernels)
|
||||
|
||||
macro(macro_for_each_core_type)
|
||||
foreach(BRANCH_DIR ${BRANCH_DIR_LIST})
|
||||
set(ENABLE_L0_MOCKS_CPP ${NEO_SOURCE_DIR}/level_zero/core/test/unit_tests${BRANCH_DIR}${CORE_TYPE_LOWER}/enable_l0_mocks_${CORE_TYPE_LOWER}.cpp)
|
||||
if(EXISTS ${ENABLE_L0_MOCKS_CPP})
|
||||
list(APPEND LIBULT_L0_SOURCES ${ENABLE_L0_MOCKS_CPP})
|
||||
endif()
|
||||
endforeach()
|
||||
endmacro()
|
||||
|
||||
apply_macro_for_each_core_type("TESTED")
|
||||
|
||||
add_library(l0_libult OBJECT EXCLUDE_FROM_ALL
|
||||
${LIBULT_L0_SOURCES}
|
||||
)
|
||||
|
||||
set_target_properties(l0_libult PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
||||
set_target_properties(l0_libult PROPERTIES FOLDER ${TARGET_NAME_L0})
|
||||
set_property(TARGET l0_libult APPEND_STRING PROPERTY COMPILE_FLAGS ${ASAN_FLAGS} ${TSAN_FLAGS})
|
||||
target_include_directories(l0_libult PRIVATE $<TARGET_PROPERTY:${L0_MOCKABLE_LIB_NAME},INTERFACE_INCLUDE_DIRECTORIES>)
|
||||
target_compile_definitions(l0_libult PRIVATE $<TARGET_PROPERTY:${L0_MOCKABLE_LIB_NAME},INTERFACE_COMPILE_DEFINITIONS>)
|
||||
create_project_source_tree(l0_libult)
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (C) 2020-2021 Intel Corporation
|
||||
# Copyright (C) 2020-2022 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
@@ -39,6 +39,7 @@ target_sources(${TARGET_NAME} PRIVATE
|
||||
$<TARGET_OBJECTS:neo_libult>
|
||||
$<TARGET_OBJECTS:neo_shared_mocks>
|
||||
$<TARGET_OBJECTS:neo_unit_tests_config>
|
||||
$<TARGET_OBJECTS:l0_libult>
|
||||
)
|
||||
|
||||
set_property(TARGET ${TARGET_NAME} APPEND_STRING PROPERTY COMPILE_FLAGS ${ASAN_FLAGS})
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (C) 2020-2021 Intel Corporation
|
||||
# Copyright (C) 2020-2022 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
@@ -7,7 +7,6 @@
|
||||
if(TESTS_GEN11)
|
||||
target_sources(${TARGET_NAME} PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/enable_l0_mocks_gen11.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_cmdqueue_thread_arbitration_policy_gen11.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_module_gen11.cpp
|
||||
)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (C) 2020-2021 Intel Corporation
|
||||
# Copyright (C) 2020-2022 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
@@ -7,7 +7,6 @@
|
||||
if(TESTS_GEN12LP)
|
||||
target_sources(${TARGET_NAME} PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/enable_l0_mocks_gen12lp.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_cache_flush.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_cmdlist_gen12lp.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_device_gen12lp.cpp
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (C) 2020-2021 Intel Corporation
|
||||
# Copyright (C) 2020-2022 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
@@ -7,7 +7,6 @@
|
||||
if(TESTS_GEN9)
|
||||
target_sources(${TARGET_NAME} PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/enable_l0_mocks_gen9.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_cmdlist_gen9.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_cmdlist_append_launch_kernel_gen9.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_cmdqueue_enqueuecommandlist_gen9.cpp
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (C) 2021 Intel Corporation
|
||||
# Copyright (C) 2021-2022 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
@@ -7,7 +7,6 @@
|
||||
if(TESTS_XE_HP_CORE)
|
||||
target_sources(${TARGET_NAME} PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/enable_l0_mocks_xe_hp_core.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_cmdlist_xe_hp_core.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_cmdqueue_debugger_xe_hp_core.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_cmdqueue_enqueuecommandlist_xe_hp_core.cpp
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (C) 2021 Intel Corporation
|
||||
# Copyright (C) 2021-2022 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
@@ -8,7 +8,6 @@ if(TESTS_XE_HPC_CORE)
|
||||
target_sources(${TARGET_NAME} PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/built_in_xe_hpc_core_tests_l0.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/enable_l0_mocks_xe_hpc_core.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_cmdlist_xe_hpc_core.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_cmdqueue_xe_hpc_core.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_device_xe_hpc_core.cpp
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (C) 2021 Intel Corporation
|
||||
# Copyright (C) 2021-2022 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
@@ -7,7 +7,6 @@
|
||||
if(TESTS_XE_HPG_CORE)
|
||||
target_sources(${TARGET_NAME} PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/enable_l0_mocks_xe_hpg_core.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_cmdlist_xe_hpg_core.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_cmdqueue_enqueuecommandlist_xe_hpg_core.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_device_xe_hpg_core.cpp
|
||||
|
||||
Reference in New Issue
Block a user