Skip to content

Commit 4089249

Browse files
lwesierssys_zuul
authored andcommitted
[Autobackout][FuncReg]Revert of change: 22e9c04
Remove support for -cl-feature Change-Id: I64945785d128e52865c3b4d92d81fe5a9f6da5b8
1 parent 8efce41 commit 4089249

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

IGC/OCLFE/igd_fcl_mcl/source/clang_tb.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1519,6 +1519,23 @@ namespace TC
15191519
optionsEx += " " + GetCDefinesFromInternalOptions(pInternalOptions);
15201520
optionsEx += " " + GetCDefinesForEnableList(extensions, oclStd, "-cl-ext=-all,");
15211521

1522+
if (oclStd >= 300) {
1523+
auto featureMacrosFromInternalOptions = GetSubstring(pInternalOptions, "-cl-feature=");
1524+
1525+
// Workaround for Clang issue.
1526+
// For write_imagef with image3d_t OpenCL 3.0 spec says:
1527+
// "Requires support for OpenCL C 2.0, the __opencl_c_3d_image_writes feature macro, or the cl_khr_3d_image_writes extension".
1528+
// In case only cl_khr_3d_image_writes is enabled, Clang triggers error for write_imagef declaration.
1529+
// TODO: remove when Clang is fixed.
1530+
if (extensions.find("+cl_khr_3d_image_writes") != std::string::npos &&
1531+
featureMacrosFromInternalOptions.find("+__opencl_c_3d_image_writes") == std::string::npos) {
1532+
featureMacrosFromInternalOptions += ",+__opencl_c_3d_image_writes";
1533+
}
1534+
1535+
optionsEx += " " + GetCDefinesForEnableList(featureMacrosFromInternalOptions, oclStd, "-cl-feature=");
1536+
optionsEx += " " + featureMacrosFromInternalOptions;
1537+
}
1538+
15221539
optionsEx += " -D__IMAGE_SUPPORT__ -D__ENDIAN_LITTLE__";
15231540

15241541
IOCLFEBinaryResult *pResultPtr = NULL;

0 commit comments

Comments
 (0)