2023-01-11 16:46:43 +00:00
|
|
|
/*
|
2024-08-19 12:36:07 +00:00
|
|
|
* Copyright (C) 2023-2024 Intel Corporation
|
2023-01-11 16:46:43 +00:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
2023-02-17 15:40:18 +00:00
|
|
|
#include "shared/test/common/helpers/default_hw_info.h"
|
|
|
|
|
#include "shared/test/common/helpers/variable_backup.h"
|
2023-10-31 02:33:24 +00:00
|
|
|
#include "shared/test/common/mocks/mock_ail_configuration.h"
|
2023-01-11 16:46:43 +00:00
|
|
|
#include "shared/test/common/test_macros/hw_test.h"
|
|
|
|
|
|
|
|
|
|
namespace NEO {
|
|
|
|
|
|
2023-02-10 15:05:50 +00:00
|
|
|
using AILBaseTests = ::testing::Test;
|
2023-01-11 16:46:43 +00:00
|
|
|
|
2023-02-10 15:05:50 +00:00
|
|
|
HWTEST2_F(AILBaseTests, whenKernelSourceIsANGenDummyKernelThenDoEnforcePatchtokensFormat, IsAtLeastSkl) {
|
2023-01-11 16:46:43 +00:00
|
|
|
std::string dummyKernelSource{"kernel void _(){}"};
|
2023-02-10 15:05:50 +00:00
|
|
|
AILConfigurationHw<productFamily> ail;
|
2023-03-03 13:23:24 +00:00
|
|
|
EXPECT_TRUE(ail.isFallbackToPatchtokensRequired(dummyKernelSource));
|
2023-01-11 16:46:43 +00:00
|
|
|
}
|
|
|
|
|
|
2023-02-10 15:05:50 +00:00
|
|
|
HWTEST2_F(AILBaseTests, whenKernelSourceIsNotANGenDummyKernelThenDoNotEnforcePatchtokensFormat, IsAtLeastSkl) {
|
2023-01-11 16:46:43 +00:00
|
|
|
std::string dummyKernelSource{"kernel void copybuffer(__global int* a, __global int* b){ //some code }"};
|
2023-02-10 15:05:50 +00:00
|
|
|
AILConfigurationHw<productFamily> ail;
|
2023-03-03 13:23:24 +00:00
|
|
|
EXPECT_FALSE(ail.isFallbackToPatchtokensRequired(dummyKernelSource));
|
2023-01-11 16:46:43 +00:00
|
|
|
}
|
|
|
|
|
|
2024-08-19 12:36:07 +00:00
|
|
|
HWTEST2_F(AILBaseTests, givenApplicationNamesThatRequireAILWhenCheckingIfPatchtokenFallbackIsRequiredThenIsCorrectResult, IsAtLeastSkl) {
|
2023-10-31 02:33:24 +00:00
|
|
|
AILWhitebox<productFamily> ail;
|
2024-08-19 12:36:07 +00:00
|
|
|
for (const auto &name : {"ArcControlAssist",
|
2023-02-17 15:40:18 +00:00
|
|
|
"ArcControl"}) {
|
|
|
|
|
ail.processName = name;
|
2023-03-03 13:23:24 +00:00
|
|
|
EXPECT_TRUE(ail.isFallbackToPatchtokensRequired(""));
|
2023-02-17 15:40:18 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace NEO
|