refactor: add patchtokens fallback AIL

Related-To: HSD-14023878700

Signed-off-by: Jaroslaw Warchulski <jaroslaw.warchulski@intel.com>
This commit is contained in:
Jaroslaw Warchulski
2024-11-20 09:25:25 +00:00
committed by Compute-Runtime-Automation
parent 26346af8ed
commit 051cada78b
9 changed files with 66 additions and 31 deletions

View File

@@ -72,6 +72,10 @@ class MockAILConfiguration : public AILConfiguration {
return true;
}
bool isFallbackToPatchtokensRequired() override {
return false;
}
protected:
void applyExt(RuntimeCapabilityTable &runtimeCapabilityTable) override {}
};

View File

@@ -112,22 +112,28 @@ HWTEST2_F(AILTests, whenModifyKernelIfRequiredIsCalledThenDontChangeKernelSource
EXPECT_STREQ(copyKernel.c_str(), kernelSources.c_str());
}
HWTEST2_F(AILTests, GivenAilWhenCheckingContextSyncFlagRequiredThenExpectFalse, MatchAny) {
HWTEST2_F(AILTests, givenAilWhenCheckingContextSyncFlagRequiredThenExpectFalse, MatchAny) {
AILWhitebox<productFamily> ail;
ail.processName = "other";
EXPECT_FALSE(ail.isContextSyncFlagRequired());
}
HWTEST2_F(AILTests, GivenAilWhenCheckingOverfetchDisableRequiredThenExpectFalse, MatchAny) {
HWTEST2_F(AILTests, givenAilWhenCheckingOverfetchDisableRequiredThenExpectFalse, MatchAny) {
AILWhitebox<productFamily> ail;
ail.processName = "other";
EXPECT_FALSE(ail.is256BPrefetchDisableRequired());
}
HWTEST2_F(AILTests, GivenAilWhenCheckingDrainHostptrsRequiredThenExpectTrue, MatchAny) {
HWTEST2_F(AILTests, givenAilWhenCheckingDrainHostptrsRequiredThenExpectTrue, MatchAny) {
AILWhitebox<productFamily> ail;
ail.processName = "other";
EXPECT_TRUE(ail.drainHostptrs());
}
HWTEST2_F(AILTests, givenAilWhenCheckingIfPatchtokenFallbackIsRequiredThenExpectFalse, MatchAny) {
AILWhitebox<productFamily> ail;
ail.processName = "other";
EXPECT_FALSE(ail.isFallbackToPatchtokensRequired());
}
} // namespace NEO

View File

@@ -1,27 +0,0 @@
/*
* Copyright (C) 2023-2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/ail/ail_configuration.h"
#include "shared/test/common/test_macros/hw_test.h"
namespace NEO {
using AILBaseTests = ::testing::Test;
HWTEST2_F(AILBaseTests, whenKernelSourceIsANGenDummyKernelThenDoEnforcePatchtokensFormat, MatchAny) {
std::string dummyKernelSource{"kernel void _(){}"};
AILConfigurationHw<productFamily> ail;
EXPECT_TRUE(ail.isFallbackToPatchtokensRequired(dummyKernelSource));
}
HWTEST2_F(AILBaseTests, whenKernelSourceIsNotANGenDummyKernelThenDoNotEnforcePatchtokensFormat, MatchAny) {
std::string dummyKernelSource{"kernel void copybuffer(__global int* a, __global int* b){ //some code }"};
AILConfigurationHw<productFamily> ail;
EXPECT_FALSE(ail.isFallbackToPatchtokensRequired(dummyKernelSource));
}
} // namespace NEO