fix: handle dot character in kernel name when parsing zebin

Related-To: NEO-7934
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2023-04-28 11:07:59 +00:00
committed by Compute-Runtime-Automation
parent 2a262b22e1
commit 55f6b142cd
3 changed files with 5 additions and 4 deletions

View File

@@ -54,7 +54,7 @@ constexpr bool isAlphaNumeric(char c) {
}
constexpr bool isNameIdentifierCharacter(char c) {
return isAlphaNumeric(c) || ('_' == c) || ('-' == c);
return isAlphaNumeric(c) || ('_' == c) || ('-' == c) || ('.' == c);
}
constexpr bool isNameIdentifierBeginningCharacter(char c) {

View File

@@ -87,6 +87,7 @@ TEST(YamlIsNameIdentifierCharacter, GivenCharThenReturnsTrueOnlyWhenCharIsNumber
validChars.insert(It{'0'}, ++It{'9'});
validChars.insert('_');
validChars.insert('-');
validChars.insert('.');
for (int c = std::numeric_limits<char>::min(); c <= std::numeric_limits<char>::max(); ++c) {
bool expected = validChars.count(static_cast<char>(c)) > 0;
EXPECT_EQ(expected, NEO::Yaml::isNameIdentifierCharacter(static_cast<char>(c))) << static_cast<char>(c);

View File

@@ -806,7 +806,7 @@ kernels_misc_info:
TEST(DecodeKernelMiscInfo, givenUnrecognizedEntryInKernelsMiscInfoSectionWhenDecodingItThenEmitWarning) {
NEO::ConstStringRef kernelMiscInfoUnrecognized = R"===(---
kernels_misc_info:
- name: some_kernel
- name: some_kernel.0
args_info:
- index: 0
name: a
@@ -818,7 +818,7 @@ kernels_misc_info:
...
)===";
auto kernelInfo = new KernelInfo();
kernelInfo->kernelDescriptor.kernelMetadata.kernelName = "some_kernel";
kernelInfo->kernelDescriptor.kernelMetadata.kernelName = "some_kernel.0";
NEO::ProgramInfo programInfo;
programInfo.kernelMiscInfoPos = 0u;
@@ -827,7 +827,7 @@ kernels_misc_info:
std::string outWarnings, outErrors;
auto res = NEO::Zebin::ZeInfo::decodeAndPopulateKernelMiscInfo(programInfo.kernelMiscInfoPos, programInfo.kernelInfos, kernelMiscInfoUnrecognized, outErrors, outWarnings);
EXPECT_EQ(DecodeError::Success, res);
EXPECT_TRUE(outErrors.empty());
EXPECT_TRUE(outErrors.empty()) << outErrors;
auto expectedWarning = "DeviceBinaryFormat::Zebin : Unrecognized entry: pickle in kernels_misc_info zeInfo's section.\n";
EXPECT_STREQ(outWarnings.c_str(), expectedWarning);