feature: Adding support for parsing sip_surface_offset

Adding support for parsing sip_surface_offset in accordance
with zeinfo specification. This field is not used because
surface offset calculations are dynamic and zebin binary can
rely only on sip_surface_bti entry. However, failing to parse
this unused entry blocks NEO from moving to stricter
zebin validation.

Related-To: NEO-11762

Signed-off-by: Chodor, Jaroslaw <jaroslaw.chodor@intel.com>
This commit is contained in:
Chodor, Jaroslaw
2024-10-16 18:58:37 +00:00
committed by Compute-Runtime-Automation
parent 5ab81cb3bb
commit e11ceb4a20
3 changed files with 33 additions and 1 deletions

View File

@@ -2068,7 +2068,7 @@ kernels:
EXPECT_TRUE(equals(attributes.invalidKernel.value(), "invalid_kernel_reason"));
}
TEST(ReadZeInfoDebugEnvironment, givenValidYamlEntryThenSetProperMembers) {
TEST(ReadZeInfoDebugEnvironment, givenSipSurfaceBtiEntryThenSetProperMembers) {
NEO::ConstStringRef yaml = R"===(---
kernels:
- name: some_kernel
@@ -2094,6 +2094,32 @@ kernels:
EXPECT_EQ(0, debugEnv.debugSurfaceBTI);
}
TEST(ReadZeInfoDebugEnvironment, givenSipSurfaceOffsetEntryThenSetProperMembers) {
NEO::ConstStringRef yaml = R"===(---
kernels:
- name: some_kernel
debug_env:
sip_surface_offset: 0
...
)===";
std::string parserErrors;
std::string parserWarnings;
NEO::Yaml::YamlParser parser;
bool success = parser.parse(yaml, parserErrors, parserWarnings);
ASSERT_TRUE(success);
auto &argsNode = *parser.findNodeWithKeyDfs("debug_env");
std::string errors;
std::string warnings;
NEO::Zebin::ZeInfo::Types::Kernel::DebugEnv::DebugEnvBaseT debugEnv;
auto err = NEO::Zebin::ZeInfo::readZeInfoDebugEnvironment(parser, argsNode, debugEnv, "some_kernel", errors, warnings);
EXPECT_EQ(NEO::DecodeError::success, err);
EXPECT_TRUE(errors.empty()) << errors;
EXPECT_TRUE(warnings.empty()) << warnings;
EXPECT_EQ(0, debugEnv.debugSurfaceOffset);
}
TEST(ReadZeInfoDebugEnvironment, givenUnknownEntryThenEmitsWarning) {
NEO::ConstStringRef yaml = R"===(---
kernels: