From 9e4513914ff8993325a047500fe238fa6ed52c13 Mon Sep 17 00:00:00 2001 From: "Chodor, Jaroslaw" Date: Fri, 24 Jan 2025 19:32:19 +0000 Subject: [PATCH] feature: Adding support for extending ExecutionEnvironment Related-To: NEO-12747 Signed-off-by: Chodor, Jaroslaw --- .../source/device_binary_format/zebin/zeinfo.h | 16 +++++++++++++++- .../device_binary_format/zebin/zeinfo_extra.cpp | 10 +++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/shared/source/device_binary_format/zebin/zeinfo.h b/shared/source/device_binary_format/zebin/zeinfo.h index 4f7585d75b..0205701d35 100644 --- a/shared/source/device_binary_format/zebin/zeinfo.h +++ b/shared/source/device_binary_format/zebin/zeinfo.h @@ -394,7 +394,21 @@ inline constexpr ConstStringRef required[] = { Tags::Kernel::ExecutionEnv::grfCount, Tags::Kernel::ExecutionEnv::simdSize}; -struct ExecutionEnvBaseT { +struct ExecutionEnvExt; +ExecutionEnvExt *allocateExecEnvExt(); +void freeExecEnvExt(ExecutionEnvExt *); + +struct ExecutionEnvBaseT final { + ExecutionEnvBaseT() { + execEnvExt = allocateExecEnvExt(); + } + ~ExecutionEnvBaseT() { + if (execEnvExt) { + freeExecEnvExt(execEnvExt); + } + } + ExecutionEnvExt *execEnvExt = nullptr; + BarrierCountT barrierCount = Defaults::barrierCount; DisableMidThreadPreemptionT disableMidThreadPreemption = Defaults::disableMidThreadPreemption; EuThreadCountT euThreadCount = Defaults::euThreadCount; diff --git a/shared/source/device_binary_format/zebin/zeinfo_extra.cpp b/shared/source/device_binary_format/zebin/zeinfo_extra.cpp index 8675d4dbee..5e2907b1e4 100644 --- a/shared/source/device_binary_format/zebin/zeinfo_extra.cpp +++ b/shared/source/device_binary_format/zebin/zeinfo_extra.cpp @@ -8,7 +8,6 @@ #include "shared/source/device_binary_format/zebin/zeinfo_decoder.h" #include - namespace NEO::Zebin::ZeInfo { void readZeInfoValueCheckedExtra(const NEO::Yaml::YamlParser &parser, const NEO::Yaml::Node &execEnvMetadataNd, KernelExecutionEnvBaseT &kernelExecEnv, ConstStringRef context, ConstStringRef key, std::string &outErrReason, std::string &outWarning, bool &validExecEnv, DecodeError &error) { @@ -17,4 +16,13 @@ void readZeInfoValueCheckedExtra(const NEO::Yaml::YamlParser &parser, const NEO: entry << "\"" << key.str() << "\" in context of " << context.str(); encounterUnknownZeInfoAttribute(entry.str(), outErrReason, outWarning, error); } + +namespace Types::Kernel::ExecutionEnv { +ExecutionEnvExt *allocateExecEnvExt() { + return nullptr; +} +void freeExecEnvExt(ExecutionEnvExt *envExt) { +} +} // namespace Types::Kernel::ExecutionEnv + } // namespace NEO::Zebin::ZeInfo