fix: cl_cache - add cm header includes to whitelist

This patch adds following includes to the whitelist:
<cm/cm.h>
<cm/cmtl.h>

Related-To: NEO-13641
Signed-off-by: Fabian Zwoliński <fabian.zwolinski@intel.com>
This commit is contained in:
Fabian Zwoliński
2025-01-20 15:39:41 +00:00
committed by Compute-Runtime-Automation
parent 0bc86c83b6
commit 285414e852
3 changed files with 7 additions and 3 deletions

View File

@ -764,6 +764,8 @@ bool CompilerCacheHelper::validateIncludes(const ArrayRef<const char> source, co
return true;
}
CompilerCacheHelper::WhitelistedIncludesVec CompilerCacheHelper::whitelistedIncludes{};
CompilerCacheHelper::WhitelistedIncludesVec CompilerCacheHelper::whitelistedIncludes{
"#include <cm/cm.h>",
"#include <cm/cmtl.h>"};
} // namespace NEO

View File

@ -257,7 +257,7 @@ class CompilerCacheHelper {
protected:
static bool processPackedCacheBinary(ArrayRef<const uint8_t> archive, TranslationOutput &output, const NEO::Device &device);
using WhitelistedIncludesVec = StackVec<std::string_view, 1>;
using WhitelistedIncludesVec = StackVec<std::string_view, 2>;
static bool validateIncludes(const ArrayRef<const char> source, const WhitelistedIncludesVec &whitelistedIncludes);
static WhitelistedIncludesVec whitelistedIncludes;
};

View File

@ -860,7 +860,9 @@ TEST_F(CompilerCacheHelperWhitelistedTest, GivenWhitelistedIncludesWhenCheckingF
}
TEST_F(CompilerCacheHelperWhitelistedTest, GivenWhitelistedIncludesWhenCheckingContentsThenExpectCorrectEntries) {
std::vector<std::string_view> expectedEntries;
std::vector<std::string_view> expectedEntries{
"#include <cm/cm.h>",
"#include <cm/cmtl.h>"};
for (const auto &expectedEntry : expectedEntries) {
auto it = std::find(whitelistedIncludes.begin(), whitelistedIncludes.end(), expectedEntry);