mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-10 07:08:04 +08:00
feature: Enabling debug variables reader in ocloc
This allows for using debug variables in ocloc with a few by-design limitations : * debug var needs to be prefixed with NEO_OCLOC_ (when setting-up at runtime as environment variable or using .config file) * debug var needs to be tagged with S_OCLOC scope (at compile time, in debug_variable .inl files) Related-To: NEO-14473 Signed-off-by: Chodor, Jaroslaw <jaroslaw.chodor@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
09c9b555f9
commit
72ae27d51e
@@ -123,6 +123,10 @@ set(CLOC_LIB_SRCS_LIB
|
||||
${OCLOC_DIRECTORY}/source/offline_compiler.cpp
|
||||
${OCLOC_DIRECTORY}/source/offline_compiler.h
|
||||
${OCLOC_DIRECTORY}/source/offline_compiler_helper.cpp
|
||||
${NEO_SOURCE_DIR}/shared/source/debug_settings/debug_settings_manager.cpp
|
||||
${NEO_SOURCE_DIR}/shared/source/utilities/debug_settings_reader.cpp
|
||||
${NEO_SOURCE_DIR}/shared/source/utilities/debug_file_reader.cpp
|
||||
${NEO_SOURCE_DIR}/shared/source/os_interface/debug_env_reader.cpp
|
||||
${OCLOC_DIRECTORY}/source/offline_compiler_options.cpp
|
||||
${OCLOC_DIRECTORY}/source/offline_linker.cpp
|
||||
${OCLOC_DIRECTORY}/source/offline_linker.h
|
||||
@@ -157,7 +161,9 @@ if(WIN32)
|
||||
${NEO_SHARED_DIRECTORY}/os_interface/windows/sys_calls.cpp
|
||||
${NEO_SHARED_DIRECTORY}/utilities/windows/directory.cpp
|
||||
${NEO_SHARED_DIRECTORY}/ail/windows${BRANCH_DIR_SUFFIX}/ail_ov_comp_wa_windows.cpp
|
||||
${NEO_SHARED_DIRECTORY}/os_interface/windows/debug_registry_reader.cpp
|
||||
${OCLOC_DIRECTORY}/source/windows/ocloc_supported_devices_helper_windows.cpp
|
||||
${OCLOC_DIRECTORY}/source/windows/ocloc_reg_path.cpp
|
||||
)
|
||||
else()
|
||||
list(APPEND CLOC_LIB_SRCS_LIB
|
||||
@@ -173,8 +179,10 @@ else()
|
||||
${NEO_SHARED_DIRECTORY}/os_interface/linux/sys_calls_linux.cpp
|
||||
${NEO_SHARED_DIRECTORY}/utilities/linux/directory.cpp
|
||||
${NEO_SHARED_DIRECTORY}/ail/linux/ail_ov_comp_wa_linux.cpp
|
||||
${NEO_SHARED_DIRECTORY}/os_interface/linux/settings_reader_create.cpp
|
||||
${OCLOC_DIRECTORY}/source/linux/os_library_ocloc_helper.cpp
|
||||
${OCLOC_DIRECTORY}/source/linux/ocloc_supported_devices_helper_linux.cpp
|
||||
${OCLOC_DIRECTORY}/source/linux/ocloc_reg_path.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
@@ -338,7 +346,9 @@ set(CLOC_LIB_SRCS
|
||||
${NEO_SHARED_DIRECTORY}/helpers/file_io.cpp
|
||||
${NEO_SHARED_DIRECTORY}/helpers/file_io_load.cpp
|
||||
)
|
||||
add_library(${OCLOC_NAME}_lib SHARED ${CLOC_LIB_SRCS})
|
||||
add_library(${OCLOC_NAME}_lib SHARED ${CLOC_LIB_SRCS}
|
||||
${NEO_SOURCE_DIR}/shared/source/utilities/debug_settings_reader_creator.cpp
|
||||
)
|
||||
add_subdirectories()
|
||||
|
||||
create_project_source_tree(${OCLOC_NAME}_lib)
|
||||
|
||||
10
shared/offline_compiler/source/linux/ocloc_reg_path.cpp
Normal file
10
shared/offline_compiler/source/linux/ocloc_reg_path.cpp
Normal file
@@ -0,0 +1,10 @@
|
||||
/*
|
||||
* Copyright (C) 2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
namespace Ocloc {
|
||||
const char *oclocRegPath = "";
|
||||
}
|
||||
11
shared/offline_compiler/source/ocloc_reg_path.h
Normal file
11
shared/offline_compiler/source/ocloc_reg_path.h
Normal file
@@ -0,0 +1,11 @@
|
||||
/*
|
||||
* Copyright (C) 2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
namespace Ocloc {
|
||||
extern const char *oclocRegPath;
|
||||
} // namespace Ocloc
|
||||
@@ -1,24 +1,40 @@
|
||||
/*
|
||||
* Copyright (C) 2019-2023 Intel Corporation
|
||||
* Copyright (C) 2019-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/offline_compiler/source/ocloc_reg_path.h"
|
||||
#include "shared/source/debug_settings/debug_settings_manager.h"
|
||||
#include "shared/source/helpers/api_specific_config.h"
|
||||
#include "shared/source/utilities/debug_settings_reader_creator.h"
|
||||
#include "shared/source/utilities/stackvec.h"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
template <DebugFunctionalityLevel debugLevel>
|
||||
DebugSettingsManager<debugLevel>::DebugSettingsManager(const char *registryPath) {
|
||||
StackVec<const char *, 4> validOclocPrefixes;
|
||||
StackVec<NEO::DebugVarPrefix, 4> validOclocPrefixTypes;
|
||||
|
||||
void translateDebugSettings(DebugVariables &debugVariables) {
|
||||
}
|
||||
|
||||
template <DebugFunctionalityLevel debugLevel>
|
||||
DebugSettingsManager<debugLevel>::~DebugSettingsManager() {
|
||||
readerImpl.reset();
|
||||
};
|
||||
void ApiSpecificConfig::initPrefixes() {
|
||||
validOclocPrefixes = {"NEO_OCLOC_"};
|
||||
validOclocPrefixTypes = {DebugVarPrefix::neoOcloc};
|
||||
}
|
||||
|
||||
// Global Debug Settings Manager
|
||||
DebugSettingsManager<globalDebugFunctionalityLevel> debugManager("");
|
||||
const StackVec<const char *, 4> &ApiSpecificConfig::getPrefixStrings() {
|
||||
return validOclocPrefixes;
|
||||
}
|
||||
|
||||
const StackVec<DebugVarPrefix, 4> &ApiSpecificConfig::getPrefixTypes() {
|
||||
return validOclocPrefixTypes;
|
||||
}
|
||||
|
||||
bool isDebugKeysReadEnabled() {
|
||||
return false;
|
||||
}
|
||||
|
||||
DebugSettingsManager<globalDebugFunctionalityLevel> debugManager(Ocloc::oclocRegPath);
|
||||
} // namespace NEO
|
||||
|
||||
10
shared/offline_compiler/source/windows/ocloc_reg_path.cpp
Normal file
10
shared/offline_compiler/source/windows/ocloc_reg_path.cpp
Normal file
@@ -0,0 +1,10 @@
|
||||
/*
|
||||
* Copyright (C) 2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
namespace Ocloc {
|
||||
const char *oclocRegPath = "Software\\Intel\\IGFX\\OCLOC\\";
|
||||
}
|
||||
Reference in New Issue
Block a user