Skip to content

Commit 5d922ee

Browse files
Add __IMAGE_SUPPORT__ option when compiling without device
Signed-off-by: Filip Hazubski <[email protected]>
1 parent 4c50a9e commit 5d922ee

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

opencl/test/unit_test/offline_compiler/offline_compiler_tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1437,7 +1437,7 @@ TEST(OclocCompile, givenCommandLineWithoutDeviceWhenCompilingToSpirvThenSucceeds
14371437
ASSERT_EQ(0, retVal);
14381438
retVal = ocloc.build();
14391439
EXPECT_EQ(0, retVal);
1440-
EXPECT_THAT(ocloc.internalOptions.c_str(), testing::HasSubstr("-ocl-version=300 -cl-ext=-all,+cl_khr_3d_image_writes"));
1440+
EXPECT_THAT(ocloc.internalOptions.c_str(), testing::HasSubstr("-ocl-version=300 -cl-ext=-all,+cl_khr_3d_image_writes -D__IMAGE_SUPPORT__=1"));
14411441
}
14421442

14431443
TEST(OclocCompile, givenDeviceAndInternalOptionsOptionWhenCompilingToSpirvThenInternalOptionsAreSetCorrectly) {

shared/offline_compiler/source/offline_compiler.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,7 @@ int OfflineCompiler::initialize(size_t numArgs, const std::vector<std::string> &
393393
}
394394
if (deviceName.empty()) {
395395
internalOptions = CompilerOptions::concatenate("-ocl-version=300 -cl-ext=-all,+cl_khr_3d_image_writes", internalOptions);
396+
CompilerOptions::concatenateAppend(internalOptions, CompilerOptions::enableImageSupport);
396397
} else {
397398
std::string extensionsList = getExtensionsList(hwInfo);
398399
if (requiresAdditionalExtensions(options)) {

0 commit comments

Comments
 (0)