Files
compute-runtime/shared/test/unit_test/ail/ail_tests_base.cpp
Kacper Nowak c504b497d7 refactor: Store AIL in root device environment
Instead of storing AIL configurations in global table, store it
in root device environment.
This also prevents potential scenario with accessing deleted memory due
to symbol collision when application uses both OCL/L0 libraries.
- AIL is now stored in root device environment, and gets initialized
with other helpers
- Minor: corrected naming in ULTs

Signed-off-by: Kacper Nowak <kacper.nowak@intel.com>
Related-To: NEO-9240
2023-11-17 15:18:27 +01:00

40 lines
1.4 KiB
C++

/*
* Copyright (C) 2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/test/common/helpers/default_hw_info.h"
#include "shared/test/common/helpers/variable_backup.h"
#include "shared/test/common/mocks/mock_ail_configuration.h"
#include "shared/test/common/test_macros/hw_test.h"
namespace NEO {
using AILBaseTests = ::testing::Test;
HWTEST2_F(AILBaseTests, whenKernelSourceIsANGenDummyKernelThenDoEnforcePatchtokensFormat, IsAtLeastSkl) {
std::string dummyKernelSource{"kernel void _(){}"};
AILConfigurationHw<productFamily> ail;
EXPECT_TRUE(ail.isFallbackToPatchtokensRequired(dummyKernelSource));
}
HWTEST2_F(AILBaseTests, whenKernelSourceIsNotANGenDummyKernelThenDoNotEnforcePatchtokensFormat, IsAtLeastSkl) {
std::string dummyKernelSource{"kernel void copybuffer(__global int* a, __global int* b){ //some code }"};
AILConfigurationHw<productFamily> ail;
EXPECT_FALSE(ail.isFallbackToPatchtokensRequired(dummyKernelSource));
}
HWTEST2_F(AILBaseTests, givenApplicationNamesThatRequirAILWhenCheckingIfPatchtokenFallbackIsRequiredThenIsCorrectResult, IsAtLeastSkl) {
AILWhitebox<productFamily> ail;
for (const auto &name : {"Resolve",
"ArcControlAssist",
"ArcControl"}) {
ail.processName = name;
EXPECT_TRUE(ail.isFallbackToPatchtokensRequired(""));
}
}
} // namespace NEO