mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-21 09:14:47 +08:00
fix make resident dependent multi root device tags
Signed-off-by: Maciej Plewka <maciej.plewka@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
1c63753ebe
commit
b1e8ca5d59
@@ -15,6 +15,9 @@ void CsrDependencies::makeResident(CommandStreamReceiver &commandStreamReceiver)
|
|||||||
for (auto ×tampPacketContainer : timestampPacketContainer) {
|
for (auto ×tampPacketContainer : timestampPacketContainer) {
|
||||||
timestampPacketContainer->makeResident(commandStreamReceiver);
|
timestampPacketContainer->makeResident(commandStreamReceiver);
|
||||||
}
|
}
|
||||||
|
for (auto ×tampPacketContainer : multiRootTimeStampSyncContainer) {
|
||||||
|
timestampPacketContainer->makeResident(commandStreamReceiver);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CsrDependencies::copyNodesToNewContainer(TimestampPacketContainer &newTimestampPacketContainer) {
|
void CsrDependencies::copyNodesToNewContainer(TimestampPacketContainer &newTimestampPacketContainer) {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (C) 2021-2022 Intel Corporation
|
# Copyright (C) 2021-2023 Intel Corporation
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: MIT
|
# SPDX-License-Identifier: MIT
|
||||||
#
|
#
|
||||||
@@ -16,6 +16,7 @@ target_sources(neo_shared_tests PRIVATE
|
|||||||
${CMAKE_CURRENT_SOURCE_DIR}/command_stream_receiver_tests.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/command_stream_receiver_tests.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/command_stream_receiver_with_aub_dump_tests.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/command_stream_receiver_with_aub_dump_tests.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/compute_mode_tests.h
|
${CMAKE_CURRENT_SOURCE_DIR}/compute_mode_tests.h
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/csr_deps_tests.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/get_devices_tests.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/get_devices_tests.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/linear_stream_tests.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/linear_stream_tests.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/stream_properties_tests_common.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/stream_properties_tests_common.cpp
|
||||||
|
|||||||
33
shared/test/unit_test/command_stream/csr_deps_tests.cpp
Normal file
33
shared/test/unit_test/command_stream/csr_deps_tests.cpp
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2023 Intel Corporation
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "shared/source/command_stream/csr_deps.h"
|
||||||
|
#include "shared/source/utilities/hw_timestamps.h"
|
||||||
|
#include "shared/test/common/mocks/mock_command_stream_receiver.h"
|
||||||
|
#include "shared/test/common/mocks/mock_execution_environment.h"
|
||||||
|
#include "shared/test/common/mocks/mock_memory_manager.h"
|
||||||
|
#include "shared/test/common/mocks/mock_timestamp_container.h"
|
||||||
|
#include "shared/test/common/test_macros/test.h"
|
||||||
|
|
||||||
|
using namespace NEO;
|
||||||
|
|
||||||
|
TEST(CsrDepsTests, givenCsrDepsWhenMakeResidentCalledThenMultiRootSyncNodeAreMadeResident) {
|
||||||
|
MockExecutionEnvironment executionEnvironment;
|
||||||
|
executionEnvironment.memoryManager = std::make_unique<MockMemoryManager>();
|
||||||
|
MockCommandStreamReceiver csr(executionEnvironment, 0, 0);
|
||||||
|
CsrDependencies csrDeps;
|
||||||
|
MockTagAllocator<HwTimeStamps> timeStampAllocator(0u, executionEnvironment.memoryManager.get(), 10,
|
||||||
|
MemoryConstants::cacheLineSize, sizeof(HwTimeStamps), false, 0);
|
||||||
|
auto timestampPacketContainer = std::make_unique<TimestampPacketContainer>();
|
||||||
|
|
||||||
|
auto node = timeStampAllocator.getTag();
|
||||||
|
timestampPacketContainer->add(node);
|
||||||
|
|
||||||
|
csrDeps.multiRootTimeStampSyncContainer.push_back(timestampPacketContainer.get());
|
||||||
|
csrDeps.makeResident(csr);
|
||||||
|
EXPECT_EQ(csr.makeResidentCalledTimes, 1u);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user