mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-12 17:33:00 +08:00
Add State Sip end WA
Related-To: NEO-5479 Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
7e27ebe70b
commit
0ca1cdc565
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (C) 2018-2020 Intel Corporation
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
@@ -8,6 +8,7 @@ set(IGDRCL_SRCS_tests_source_level_debugger
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/source_level_debugger_device_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/source_level_debugger_csr_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/source_level_debugger_csr_tests.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/source_level_debugger_tests.cpp
|
||||
)
|
||||
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2020 Intel Corporation
|
||||
* Copyright (C) 2018-2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opencl/test/unit_test/source_level_debugger/source_level_debugger_csr_tests.h"
|
||||
|
||||
#include "shared/source/source_level_debugger/source_level_debugger.h"
|
||||
#include "shared/test/unit_test/cmd_parse/hw_parse.h"
|
||||
#include "shared/test/unit_test/helpers/dispatch_flags_helper.h"
|
||||
@@ -13,47 +15,10 @@
|
||||
#include "shared/test/unit_test/mocks/mock_os_library.h"
|
||||
|
||||
#include "opencl/source/command_queue/command_queue_hw.h"
|
||||
#include "opencl/test/unit_test/helpers/execution_environment_helper.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_builtins.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_cl_device.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_csr.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_memory_manager.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_source_level_debugger.h"
|
||||
#include "test.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
class CommandStreamReceiverWithActiveDebuggerTest : public ::testing::Test {
|
||||
protected:
|
||||
template <typename FamilyType>
|
||||
auto createCSR() {
|
||||
hwInfo = nullptr;
|
||||
EnvironmentWithCsrWrapper environment;
|
||||
environment.setCsrType<MockCsrHw2<FamilyType>>();
|
||||
executionEnvironment = getExecutionEnvironmentImpl(hwInfo, 1);
|
||||
hwInfo->capabilityTable = defaultHwInfo->capabilityTable;
|
||||
hwInfo->capabilityTable.debuggerSupported = true;
|
||||
|
||||
auto mockMemoryManager = new MockMemoryManager(*executionEnvironment);
|
||||
executionEnvironment->memoryManager.reset(mockMemoryManager);
|
||||
|
||||
executionEnvironment->rootDeviceEnvironments[0]->debugger.reset(new MockActiveSourceLevelDebugger(new MockOsLibrary));
|
||||
|
||||
device = std::make_unique<MockClDevice>(Device::create<MockDevice>(executionEnvironment, 0));
|
||||
device->setSourceLevelDebuggerActive(true);
|
||||
|
||||
return static_cast<MockCsrHw2<FamilyType> *>(device->getDefaultEngine().commandStreamReceiver);
|
||||
}
|
||||
|
||||
void TearDown() override {
|
||||
device->setSourceLevelDebuggerActive(false);
|
||||
}
|
||||
|
||||
std::unique_ptr<MockClDevice> device;
|
||||
ExecutionEnvironment *executionEnvironment = nullptr;
|
||||
HardwareInfo *hwInfo = nullptr;
|
||||
};
|
||||
|
||||
HWTEST_F(CommandStreamReceiverWithActiveDebuggerTest, givenCsrWithActiveDebuggerAndDisabledPreemptionWhenFlushTaskIsCalledThenSipKernelIsMadeResident) {
|
||||
|
||||
auto mockCsr = createCSR<FamilyType>();
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/test/unit_test/mocks/mock_os_library.h"
|
||||
|
||||
#include "opencl/test/unit_test/helpers/execution_environment_helper.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_builtins.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_cl_device.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_csr.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_memory_manager.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_source_level_debugger.h"
|
||||
#include "test.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
class CommandStreamReceiverWithActiveDebuggerTest : public ::testing::Test {
|
||||
protected:
|
||||
template <typename FamilyType>
|
||||
auto createCSR() {
|
||||
hwInfo = nullptr;
|
||||
EnvironmentWithCsrWrapper environment;
|
||||
environment.setCsrType<MockCsrHw2<FamilyType>>();
|
||||
executionEnvironment = getExecutionEnvironmentImpl(hwInfo, 1);
|
||||
hwInfo->capabilityTable = defaultHwInfo->capabilityTable;
|
||||
hwInfo->capabilityTable.debuggerSupported = true;
|
||||
|
||||
auto mockMemoryManager = new MockMemoryManager(*executionEnvironment);
|
||||
executionEnvironment->memoryManager.reset(mockMemoryManager);
|
||||
|
||||
executionEnvironment->rootDeviceEnvironments[0]->debugger.reset(new MockActiveSourceLevelDebugger(new MockOsLibrary));
|
||||
|
||||
device = std::make_unique<MockClDevice>(Device::create<MockDevice>(executionEnvironment, 0));
|
||||
device->setSourceLevelDebuggerActive(true);
|
||||
|
||||
return static_cast<MockCsrHw2<FamilyType> *>(device->getDefaultEngine().commandStreamReceiver);
|
||||
}
|
||||
|
||||
void TearDown() override {
|
||||
device->setSourceLevelDebuggerActive(false);
|
||||
}
|
||||
|
||||
std::unique_ptr<MockClDevice> device;
|
||||
ExecutionEnvironment *executionEnvironment = nullptr;
|
||||
HardwareInfo *hwInfo = nullptr;
|
||||
};
|
||||
Reference in New Issue
Block a user