This is an archive of the discontinued LLVM Phabricator instance.

[OpenCL] Supports optional image types in C++ for OpenCL 2021
ClosedPublic

Authored by Topotuna on Aug 31 2021, 8:55 AM.

Details

Summary

Adds support for a feature macro __opencl_c_images in C++ for
OpenCL 2021 enabling a respective optional core feature from
OpenCL 3.0.

This change aims to achieve compatibility between C++ for OpenCL
2021 and OpenCL 3.0.

Diff Detail

Event Timeline

Topotuna created this revision.Aug 31 2021, 8:55 AM
Topotuna requested review of this revision.Aug 31 2021, 8:55 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 31 2021, 8:55 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
Anastasia added inline comments.Sep 1 2021, 2:33 AM
clang/lib/Sema/SemaType.cpp
1739

I think we should just replace IsOpenCLC30 as it is when only used in the diagnostic that we should report the same as for OpenCL 3.0.

Also I would suggest changing name to IsOpenCLC30Compatible to make it clearer.

Topotuna added inline comments.Sep 1 2021, 2:45 AM
clang/lib/Sema/SemaType.cpp
1739

That diagnostic is responsible for __opencl_c_3d_image_writes feature while current commit addresses __opencl_c_images. I wanted to keep commits separate and was planning to finish transitioning from IsOpenCLC30 to IsOpenCLC30Compatible in a future commit.

I agree that IsOpenCLC30Compatible would be clearer. Thank you.

Anastasia added inline comments.Sep 1 2021, 10:20 AM
clang/lib/Sema/SemaType.cpp
1739

Ok, let's just only rename it for now and add a FIXME comment explaining that the variables should be unified later on.

I suspect your subsequent commits would include the unification?

Topotuna updated this revision to Diff 370237.Sep 2 2021, 5:26 AM

Boolean variable renamed to IsOpenCLC30Compatible. FIXME comment added.

Topotuna marked an inline comment as done.Sep 2 2021, 5:29 AM
Topotuna added inline comments.
clang/lib/Sema/SemaType.cpp
1739

Yes, I will perform unification when adding support for __opencl_c_3d_image_writes optional core feature.

Anastasia accepted this revision.Sep 6 2021, 2:55 AM

LGTM! Thanks

This revision is now accepted and ready to land.Sep 6 2021, 2:55 AM
This revision was landed with ongoing or failed builds.Sep 15 2021, 2:04 AM
This revision was automatically updated to reflect the committed changes.
Topotuna marked an inline comment as done.
Topotuna added inline comments.Sep 21 2021, 7:44 AM
clang/lib/Sema/SemaType.cpp
1739

Change rGca3bebd8440f performs mentioned variable unification.