mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-11 16:45:25 +08:00
Add helper method to get support for MidThread preemption for RT kernels
Move raii hw info config helper to shared Related-To: NEO-7547, NEO-7548 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
be5a1c3d08
commit
b6c51c6793
@@ -10,6 +10,7 @@ target_sources(neo_libult_common PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/batch_buffer_helper.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/gtest_helpers.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/raii_hw_helper.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/raii_hw_info_config.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/static_size3.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/ult_limits.h
|
||||
)
|
||||
|
||||
32
shared/test/common/helpers/raii_hw_info_config.h
Normal file
32
shared/test/common/helpers/raii_hw_info_config.h
Normal file
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright (C) 2021-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "shared/source/os_interface/hw_info_config.h"
|
||||
|
||||
namespace NEO {
|
||||
extern HwInfoConfig *hwInfoConfigFactory[IGFX_MAX_PRODUCT];
|
||||
|
||||
template <typename MockHwInfoConfig>
|
||||
class RAIIHwInfoConfigFactory {
|
||||
public:
|
||||
PRODUCT_FAMILY productFamily;
|
||||
HwInfoConfig *hwInfoConfig;
|
||||
MockHwInfoConfig mockHwInfoConfig{};
|
||||
|
||||
RAIIHwInfoConfigFactory(PRODUCT_FAMILY productFamily) {
|
||||
this->productFamily = productFamily;
|
||||
hwInfoConfig = hwInfoConfigFactory[this->productFamily];
|
||||
hwInfoConfigFactory[this->productFamily] = &mockHwInfoConfig;
|
||||
}
|
||||
|
||||
~RAIIHwInfoConfigFactory() {
|
||||
hwInfoConfigFactory[this->productFamily] = hwInfoConfig;
|
||||
}
|
||||
};
|
||||
} // namespace NEO
|
||||
Reference in New Issue
Block a user