Reuse old build options if new ones are NULL

Change-Id: I435e7ec8554b0429dcf4f6f8d9d4fd80e70b68c6
This commit is contained in:
Jaroslaw Chodor
2020-10-04 11:43:24 +02:00
committed by sys_ocldev
parent cd85bcffdb
commit 746cf7fd33
6 changed files with 47 additions and 4 deletions

View File

@@ -970,8 +970,17 @@ TEST_P(ProgramFromSourceTest, GivenDifferentCommpilerOptionsWhenBuildingProgramT
auto hash4 = pProgram->getCachedFileName();
auto kernel4 = pProgram->getKernelInfo("CopyBuffer");
EXPECT_NE(nullptr, kernel4);
EXPECT_EQ(hash1, hash4);
EXPECT_EQ(hash3, hash4);
Callback::unwatch(kernel3);
Callback::watch(kernel4);
retVal = pProgram->build(0, nullptr, "", nullptr, nullptr, true);
EXPECT_EQ(CL_SUCCESS, retVal);
auto hash5 = pProgram->getCachedFileName();
auto kernel5 = pProgram->getKernelInfo("CopyBuffer");
EXPECT_NE(nullptr, kernel5);
EXPECT_EQ(hash1, hash5);
Callback::unwatch(kernel4);
}
TEST_P(ProgramFromSourceTest, GivenEmptyProgramWhenCreatingProgramThenInvalidValueErrorIsReturned) {