mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-22 10:17:01 +08:00
refactor: add patchtokens fallback AIL
Related-To: HSD-14023878700 Signed-off-by: Jaroslaw Warchulski <jaroslaw.warchulski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
26346af8ed
commit
051cada78b
@@ -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]);
|
||||
|
||||
Reference in New Issue
Block a user