Skip to content

Commit c84e8ae

Browse files
jchodorCompute-Runtime-Automation
authored andcommitted
feature: Parse actual_kernel_start_offset zeinfo entry
This is a deprecated and redundant entry but needs to be preserved for compatibility reasons. Related-To: GSD-10402 Signed-off-by: Chodor, Jaroslaw <[email protected]> Source: 49e904d
1 parent d994bcf commit c84e8ae

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

shared/source/device_binary_format/zebin/zeinfo.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ inline constexpr ConstStringRef subgroupIndependentForwardProgress("subgroup_ind
6060
inline constexpr ConstStringRef workGroupWalkOrderDimensions("work_group_walk_order_dimensions");
6161
inline constexpr ConstStringRef threadSchedulingMode("thread_scheduling_mode");
6262
inline constexpr ConstStringRef hasSample("has_sample");
63+
inline constexpr ConstStringRef actualKernelStartOffset("actual_kernel_start_offset");
6364
namespace ThreadSchedulingMode {
6465
inline constexpr ConstStringRef ageBased("age_based");
6566
inline constexpr ConstStringRef roundRobin("round_robin");

shared/source/device_binary_format/zebin/zeinfo_decoder.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -673,6 +673,8 @@ DecodeError readZeInfoExecutionEnvironment(const Yaml::YamlParser &parser, const
673673
validExecEnv &= readZeInfoValueChecked(parser, execEnvMetadataNd, outExecEnv.privateSize, context, outErrReason);
674674
} else if (Tags::Kernel::ExecutionEnv::spillSize == key) {
675675
validExecEnv &= readZeInfoValueChecked(parser, execEnvMetadataNd, outExecEnv.spillSize, context, outErrReason);
676+
} else if (Tags::Kernel::ExecutionEnv::actualKernelStartOffset == key) {
677+
// ignore intentionally - deprecated and redundant key
676678
} else {
677679
readZeInfoValueCheckedExtra(parser, execEnvMetadataNd, outExecEnv, context, key, outErrReason, outWarning, validExecEnv, err);
678680
}

shared/test/unit_test/device_binary_format/zebin_decoder_tests.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1983,6 +1983,31 @@ TEST(ReadZeInfoExecutionEnvironment, GivenUnknownEntryThenEmitsError) {
19831983
EXPECT_STREQ("DeviceBinaryFormat::zebin::.ze_info : Unknown entry \"something_new\" in context of some_kernel\n", errors.c_str());
19841984
}
19851985

1986+
TEST(ReadZeInfoExecutionEnvironment, GivenActualKernelStartOffsetThenDontTreatItAsInvalidEntry) {
1987+
NEO::ConstStringRef yaml = R"===(---
1988+
kernels:
1989+
- name: some_kernel
1990+
execution_env:
1991+
simd_size : 8
1992+
actual_kernel_start_offset: 240
1993+
...
1994+
)===";
1995+
1996+
std::string parserErrors;
1997+
std::string parserWarnings;
1998+
NEO::Yaml::YamlParser parser;
1999+
bool success = parser.parse(yaml, parserErrors, parserWarnings);
2000+
ASSERT_TRUE(success);
2001+
auto &argsNode = *parser.findNodeWithKeyDfs("execution_env");
2002+
std::string errors;
2003+
std::string warnings;
2004+
NEO::Zebin::ZeInfo::Types::Kernel::ExecutionEnv::ExecutionEnvBaseT execEnv;
2005+
auto err = NEO::Zebin::ZeInfo::readZeInfoExecutionEnvironment(parser, argsNode, execEnv, "some_kernel", errors, warnings);
2006+
EXPECT_EQ(NEO::DecodeError::success, err);
2007+
EXPECT_TRUE(errors.empty()) << errors;
2008+
EXPECT_TRUE(warnings.empty()) << warnings;
2009+
}
2010+
19862011
TEST(ReadZeInfoExecutionEnvironment, GivenInvalidValueForKnownEntryThenFails) {
19872012
NEO::ConstStringRef yaml = R"===(---
19882013
kernels:

0 commit comments

Comments
 (0)