mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
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:

committed by
Compute-Runtime-Automation

parent
0bc86c83b6
commit
285414e852
@ -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
|
@ -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;
|
||||
};
|
||||
|
@ -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);
|
||||
|
Reference in New Issue
Block a user