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

@@ -681,7 +681,7 @@ void MinimumProgramFixture::TearDown() {
NEO::PlatformFixture::tearDown();
}
HWTEST2_F(MinimumProgramFixture, givenEmptyAilWhenCreateProgramWithSourcesThenSourcesDoNotChange, IsDG2) {
TEST_F(MinimumProgramFixture, givenEmptyAilWhenCreateProgramWithSourcesThenSourcesDoNotChange) {
auto pDevice = pContext->getDevice(0);
auto rootDeviceEnvironment = pDevice->getExecutionEnvironment()->rootDeviceEnvironments[rootDeviceIndex].get();
rootDeviceEnvironment->ailConfiguration.reset(nullptr);
@@ -702,6 +702,38 @@ HWTEST2_F(MinimumProgramFixture, givenEmptyAilWhenCreateProgramWithSourcesThenSo
pProgram->release();
}
TEST_F(MinimumProgramFixture, givenAILReturningTrueForFallbackRequirementWhenBuildingProgramThenMarkContextAsNonZebin) {
class MockAIL : public MockAILConfiguration {
public:
bool isFallbackToPatchtokensRequired() override {
return true;
}
};
auto pDevice = pContext->getDevice(0);
auto rootDeviceEnvironment = pDevice->getExecutionEnvironment()->rootDeviceEnvironments[rootDeviceIndex].get();
rootDeviceEnvironment->ailConfiguration.reset(new MockAIL());
ASSERT_FALSE(pContext->checkIfContextIsNonZebin());
const char *kernelSources[] = {"some source code"};
size_t knownSourceSize = strlen(kernelSources[0]);
MockProgram *pProgram = nullptr;
pProgram = Program::create<SucceedingGenBinaryProgram>(
pContext,
1,
kernelSources,
&knownSourceSize,
retVal);
ASSERT_NE(nullptr, pProgram);
ASSERT_EQ(CL_SUCCESS, retVal);
retVal = pProgram->build(pProgram->getDevices(), "");
EXPECT_EQ(CL_SUCCESS, retVal);
EXPECT_TRUE(pContext->checkIfContextIsNonZebin());
pProgram->release();
}
TEST_F(MinimumProgramFixture, givenApplicationContextMarkedAsNonZebinWhenBuildingProgramThenInternalOptionsShouldContainDisableZebinOption) {
const char *kernelSources[] = {"some source code"};
size_t knownSourceSize = strlen(kernelSources[0]);