mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 09:09:04 +08:00
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:
committed by
Compute-Runtime-Automation
parent
2a262b22e1
commit
55f6b142cd
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user