mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
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:
@ -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
|
||||
|
Reference in New Issue
Block a user