feature: Adding support for extending KernerlDescriptor

Related-To: NEO-12747

Signed-off-by: Chodor, Jaroslaw <jaroslaw.chodor@intel.com>
This commit is contained in:
Chodor, Jaroslaw
2025-01-24 12:14:19 +00:00
committed by Compute-Runtime-Automation
parent c265e9bc7a
commit 0938a0eaf9
10 changed files with 64 additions and 11 deletions

View File

@@ -51,7 +51,7 @@ set(CLOC_LIB_SRCS_LIB
${NEO_SHARED_DIRECTORY}/device_binary_format/zebin/zebin_decoder.h
${NEO_SHARED_DIRECTORY}/device_binary_format/zebin/zeinfo_decoder.cpp
${NEO_SHARED_DIRECTORY}/device_binary_format/zebin/zeinfo_decoder.h
${NEO_SHARED_DIRECTORY}/device_binary_format/zebin/${BRANCH_DIR_SUFFIX}zeinfo_extra.cpp
${NEO_SHARED_DIRECTORY}/device_binary_format/zebin/${BRANCH_DIR_SUFFIX}zeinfo_decoder_ext.cpp
${NEO_SHARED_DIRECTORY}/dll/devices${BRANCH_DIR_SUFFIX}devices.inl
${NEO_SHARED_DIRECTORY}/dll/devices/devices_base.inl
${NEO_SHARED_DIRECTORY}/dll/devices${BRANCH_DIR_SUFFIX}/product_config.inl
@@ -76,6 +76,7 @@ set(CLOC_LIB_SRCS_LIB
${NEO_SHARED_DIRECTORY}/helpers/path.h
${NEO_SHARED_DIRECTORY}/helpers/product_config_helper.cpp
${NEO_SHARED_DIRECTORY}/helpers/product_config_helper.h
${NEO_SHARED_DIRECTORY}/kernel/${BRANCH_DIR_SUFFIX}kernel_descriptor_ext.cpp
${NEO_SHARED_DIRECTORY}/os_interface/os_library.cpp
${NEO_SHARED_DIRECTORY}/os_interface/os_library.h
${NEO_SHARED_DIRECTORY}/sku_info/definitions${BRANCH_DIR_SUFFIX}sku_info.cpp

View File

@@ -1,12 +1,12 @@
#
# Copyright (C) 2024 Intel Corporation
# Copyright (C) 2024-2025 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
set(NEO_CORE_ZEINFO_EXTRA
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
${CMAKE_CURRENT_SOURCE_DIR}/${BRANCH_DIR_SUFFIX}zeinfo_extra.cpp
${CMAKE_CURRENT_SOURCE_DIR}/${BRANCH_DIR_SUFFIX}zeinfo_decoder_ext.cpp
)
set_property(GLOBAL APPEND PROPERTY NEO_CORE_ZEINFO_EXTRA ${NEO_CORE_ZEINFO_EXTRA})

View File

@@ -403,9 +403,7 @@ struct ExecutionEnvBaseT final {
execEnvExt = allocateExecEnvExt();
}
~ExecutionEnvBaseT() {
if (execEnvExt) {
freeExecEnvExt(execEnvExt);
}
freeExecEnvExt(execEnvExt);
}
ExecutionEnvExt *execEnvExt = nullptr;

View File

@@ -10,6 +10,7 @@
#include "shared/source/compiler_interface/external_functions.h"
#include "shared/source/debug_settings/debug_settings_manager.h"
#include "shared/source/device_binary_format/zebin/zebin_elf.h"
#include "shared/source/device_binary_format/zebin/zeinfo_decoder_ext.h"
#include "shared/source/device_binary_format/zebin/zeinfo_enum_lookup.h"
#include "shared/source/helpers/aligned_memory.h"
#include "shared/source/helpers/basic_math.h"
@@ -756,6 +757,8 @@ void populateKernelExecutionEnvironment(KernelDescriptor &dst, const KernelExecu
dst.kernelAttributes.threadArbitrationPolicy = ThreadArbitrationPolicy::RoundRobinAfterDependency;
break;
}
populateKernelExecutionEnvironmentExt(dst, execEnv, srcZeInfoVersion);
}
DecodeError decodeZeInfoKernelUserAttributes(KernelDescriptor &dst, Yaml::YamlParser &parser, const ZeInfoKernelSections &kernelSections, std::string &outErrReason, std::string &outWarning) {

View File

@@ -1,10 +1,12 @@
/*
* Copyright (C) 2023-2024 Intel Corporation
* Copyright (C) 2023-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include "shared/source/device_binary_format/device_binary_formats.h"
#include "shared/source/device_binary_format/yaml/yaml_parser.h"
#include "shared/source/device_binary_format/zebin/zeinfo.h"

View File

@@ -25,4 +25,7 @@ void freeExecEnvExt(ExecutionEnvExt *envExt) {
}
} // namespace Types::Kernel::ExecutionEnv
void populateKernelExecutionEnvironmentExt(KernelDescriptor &dst, const KernelExecutionEnvBaseT &execEnv, const Types::Version &srcZeInfoVersion) {
}
} // namespace NEO::Zebin::ZeInfo

View File

@@ -0,0 +1,16 @@
/*
* Copyright (C) 2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include "shared/source/device_binary_format/zebin/zeinfo_decoder.h"
namespace NEO::Zebin::ZeInfo {
void populateKernelExecutionEnvironmentExt(KernelDescriptor &dst, const KernelExecutionEnvBaseT &execEnv, const Types::Version &srcZeInfoVersion);
} // namespace NEO::Zebin::ZeInfo

View File

@@ -1,5 +1,5 @@
#
# Copyright (C) 2019-2023 Intel Corporation
# Copyright (C) 2019-2025 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
@@ -15,6 +15,7 @@ set(NEO_CORE_KERNEL
${CMAKE_CURRENT_SOURCE_DIR}/kernel_arg_descriptor.h
${CMAKE_CURRENT_SOURCE_DIR}/kernel_arg_descriptor_extended_vme.h
${CMAKE_CURRENT_SOURCE_DIR}/kernel_arg_metadata.h
${CMAKE_CURRENT_SOURCE_DIR}/${BRANCH_DIR_SUFFIX}kernel_descriptor_ext.cpp
${CMAKE_CURRENT_SOURCE_DIR}/kernel_descriptor.cpp
${CMAKE_CURRENT_SOURCE_DIR}/kernel_descriptor.h
${CMAKE_CURRENT_SOURCE_DIR}/kernel_descriptor_from_patchtokens.cpp

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2024 Intel Corporation
* Copyright (C) 2020-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -28,6 +28,10 @@ using StringMap = std::unordered_map<uint32_t, std::string>;
using BindlessToSurfaceStateMap = std::unordered_map<CrossThreadDataOffset, uint32_t>;
using InstructionsSegmentOffset = uint16_t;
struct KernelDescriptorExt;
KernelDescriptorExt *allocateKernelDescriptorExt();
void freeKernelDescriptorExt(KernelDescriptorExt *);
struct KernelDescriptor {
static bool isBindlessAddressingKernel(const KernelDescriptor &desc);
@@ -40,8 +44,15 @@ struct KernelDescriptor {
BindlessAndStateless
};
KernelDescriptor() = default;
virtual ~KernelDescriptor() = default;
KernelDescriptor() {
kernelDescriptorExt = allocateKernelDescriptorExt();
}
virtual ~KernelDescriptor() {
freeKernelDescriptorExt(kernelDescriptorExt);
}
KernelDescriptorExt *kernelDescriptorExt = nullptr;
void updateCrossThreadDataSize();
void initBindlessOffsetToSurfaceState();

View File

@@ -0,0 +1,18 @@
/*
* Copyright (C) 2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/kernel/kernel_descriptor.h"
namespace NEO {
KernelDescriptorExt *allocateKernelDescriptorExt() {
return nullptr;
}
void freeKernelDescriptorExt(KernelDescriptorExt *) {
}
} // namespace NEO