Read _options.txt in ocloc also for non-standard kernel file extensions

Related-To: NEO-3776

Change-Id: I139cab31cddc1f02ac40e5c06cca0c24a1180cf2
Signed-off-by: Pawel Wilma <pawel.wilma@intel.com>
This commit is contained in:
Pawel Wilma
2020-07-01 11:21:04 +02:00
committed by sys_ocldev
parent 7fa7654d47
commit 1543fd6103
4 changed files with 25 additions and 1 deletions

View File

@ -1135,4 +1135,25 @@ TEST(OfflineCompilerTest, givenCompilerWhenBuildSourceCodeFailsThenGenerateElfBi
EXPECT_EQ(1u, compiler.writeOutAllFilesCalled);
}
TEST(OfflineCompilerTest, givenDeviceSpecificKernelFileWhenCompilerIsInitializedThenOptionsAreReadFromFile) {
auto mockOfflineCompiler = std::unique_ptr<MockOfflineCompiler>(new MockOfflineCompiler());
ASSERT_NE(nullptr, mockOfflineCompiler);
const char *kernelFileName = "test_files/kernel_for_specific_device.skl";
const char *optionsFileName = "test_files/kernel_for_specific_device_options.txt";
ASSERT_TRUE(fileExists(kernelFileName));
ASSERT_TRUE(fileExists(optionsFileName));
std::vector<std::string> argv = {
"ocloc",
"-q",
"-file",
kernelFileName,
"-device",
"skl"};
int retVal = mockOfflineCompiler->initialize(argv.size(), argv);
EXPECT_EQ(SUCCESS, retVal);
EXPECT_STREQ("-cl-opt-disable", mockOfflineCompiler->options.c_str());
}
} // namespace NEO