This is an archive of the discontinued LLVM Phabricator instance.

[OpenCL] Add support of __opencl_c_images feature macro
ClosedPublic

Authored by azabaznov on Jun 8 2021, 9:45 AM.

Diff Detail

Event Timeline

azabaznov created this revision.Jun 8 2021, 9:45 AM
azabaznov requested review of this revision.Jun 8 2021, 9:45 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 8 2021, 9:45 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
svenvh added inline comments.Jun 9 2021, 4:39 AM
clang/test/SemaOpenCL/unsupported-image.cl
2

Should we add -triple spir, as some of the image types (e.g. msaa) are part of an extension that may not be available for every default triple?

Anastasia added inline comments.Jun 9 2021, 5:07 AM
clang/test/SemaOpenCL/unsupported-image.cl
2

yes, the test might fail in some bots otherwise...

Btw it would be good to test that 3d images work correctly for OpenCL 3. Would it work if we add RUN line with CL3.0 into test/SemaOpenCL/access-qualifier.cl or are we missing some more work to enable the test?

azabaznov added inline comments.Jun 9 2021, 5:12 AM
clang/test/SemaOpenCL/unsupported-image.cl
2

Should we add -triple spir, as some of the image types (e.g. msaa) are part of an extension that may not be available for every default triple?

yes, the test might fail in some bots otherwise...

Yes, that's correct. Thanks. Now it works locally because the default triple I have is x86 which supports all the extensions as well as SPIR.

Btw it would be good to test that 3d images work correctly for OpenCL 3. Would it work if we add RUN line with CL3.0 into test/SemaOpenCL/access-qualifier.cl or are we missing some more work to enable the test?

Yeah, to properly test 3d images actually we need to add __opencl_c_images support first, because __opencl_c_3d_image_writes depends on it

Anastasia added inline comments.Jun 9 2021, 8:24 AM
clang/test/SemaOpenCL/unsupported-image.cl
2

Ok, I see. This can go to separate commits then.

azabaznov updated this revision to Diff 352681.Jun 17 2021, 4:57 AM

Set SPIR target for added test

azabaznov marked 3 inline comments as done.Jun 17 2021, 4:57 AM
svenvh accepted this revision.Jun 17 2021, 6:04 AM

LGTM!

This revision is now accepted and ready to land.Jun 17 2021, 6:04 AM
This revision was automatically updated to reflect the committed changes.