fix: truncated invalid kernel reason message

IGC will add "invalid_kernel: uses-fp64-math" into kernel binary for fp64
unsupported platform. "uses-fp64-math" will be truncated to "uses" due to "-"
is not a valid identifier. It makes application can't get "uses-fp64-math"
through zeKernelGetSourceAttributes.

Related-To: NEO-7794

Signed-off-by: Pan Zhenjie <zhenjie.pan@intel.com>
This commit is contained in:
Pan, Zhenjie
2023-03-09 02:03:34 +00:00
committed by Compute-Runtime-Automation
parent 57e68624f3
commit ad49a6e3b0
2 changed files with 4 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2022 Intel Corporation
* Copyright (C) 2020-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -79,13 +79,14 @@ TEST(YamlIsAlphaNumeric, GivenCharThenReturnsTrueOnlyWhenCharIsNumberOrLetter) {
}
}
TEST(YamlIsNameIdentifierCharacter, GivenCharThenReturnsTrueOnlyWhenCharIsNumberOrLetterOrUnderscore) {
TEST(YamlIsNameIdentifierCharacter, GivenCharThenReturnsTrueOnlyWhenCharIsNumberOrLetterOrUnderscoreOrHyphen) {
std::set<char> validChars{};
using It = IteratorAsValue<char>;
validChars.insert(It{'a'}, ++It{'z'});
validChars.insert(It{'A'}, ++It{'Z'});
validChars.insert(It{'0'}, ++It{'9'});
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);