This is an archive of the discontinued LLVM Phabricator instance.

[OpenCL] Add support of __opencl_c_3d_image_writes feature macro
ClosedPublic

Authored by azabaznov on Jul 19 2021, 3:23 AM.

Details

Summary

This feature requires support of __opencl_c_images, so diagnostics for that is provided as well.
Also, ensure that cl_khr_3d_image_writes feature macro is set to the same value.

Diff Detail

Event Timeline

azabaznov created this revision.Jul 19 2021, 3:23 AM
azabaznov requested review of this revision.Jul 19 2021, 3:23 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 19 2021, 3:23 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
azabaznov added inline comments.Jul 19 2021, 3:26 AM
clang/lib/Sema/SemaType.cpp
1732–1734

Note this. Is it OK to refer to API spec here?

azabaznov updated this revision to Diff 359734.Jul 19 2021, 3:51 AM

Change diagnostic output

Anastasia added inline comments.Jul 20 2021, 7:49 AM
clang/include/clang/Basic/DiagnosticSemaKinds.td
10092

it seems like we keep expanding similar diagnostics which flows against the design policy. Could you try to unify with err_opencl_double_requires_extension or even with err_opencl_requires_extension?

Perhaps we could create a mechanism to print custom strings for extensions that alias features or it can be done in the follow-up patches too?

clang/lib/Sema/SemaType.cpp
1732–1734

I am guessing you want to explain that corresponding features and extensions must be in sync?

It makes sense, but it feels like we are missing something in the kernel language spec then...

azabaznov updated this revision to Diff 361155.Jul 23 2021, 4:25 AM

Unify with err_opencl_requires_extension. Infrastructure for getting aliased extensions seems to messy and doesn't seem worth it yet since there are only two cases of such functionality (fp64 and 3d image writes) :(

Anastasia accepted this revision.Jul 23 2021, 4:39 PM

LGTM! Thanks

This revision is now accepted and ready to land.Jul 23 2021, 4:39 PM
This revision was landed with ongoing or failed builds.Jul 29 2021, 6:54 PM
This revision was automatically updated to reflect the committed changes.