This is an archive of the discontinued LLVM Phabricator instance.

[OpenCL] Make -cl-ext a driver option
ClosedPublic

Authored by Anastasia on May 9 2022, 9:54 AM.

Details

Summary

For generic targets such as SPIR-V clang sets all OpenCL extensions/features as supported by default. However targets are unlikely to support all extensions/features which creates a problem when such generic SPIR-V binary is compiled for a specific target later on.

For SPIR-V we will likely provide control of extensions via vendor components in the target triple: https://discourse.llvm.org/t/setting-version-environment-and-extensions-for-spir-v-target, however this doesn't eliminate the need of finer-grained control of extensions for example to support some specific or emerging target architectures.

Therefore this patch exposes -cl-ext flag for finer-grained control of extensions and features being targeted in the OpenCL kernels to improve error reporting and control of features generated in generic binaries like SPIR-V.

Diff Detail

Event Timeline

Anastasia created this revision.May 9 2022, 9:54 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 9 2022, 9:54 AM
Anastasia requested review of this revision.May 9 2022, 9:54 AM
svenvh accepted this revision.May 11 2022, 4:28 AM

LGTM; just a few minor suggestions that you can address at commit time.

clang/docs/UsersManual.rst
3144–3145

Was this meant to go after the command example?

3214
This revision is now accepted and ready to land.May 11 2022, 4:28 AM
Anastasia added inline comments.May 16 2022, 3:09 AM
clang/docs/UsersManual.rst
3144–3145

true, will fix this in the final commit! Thanks!

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMay 24 2022, 3:36 AM
Herald added a subscriber: ldrumm. · View Herald Transcript