This is an archive of the discontinued LLVM Phabricator instance.

[OpenCL] Define CLK_NULL_EVENT without cast
ClosedPublic

Authored by svenvh on Jun 27 2019, 6:36 AM.

Details

Summary

Defining CLK_NULL_EVENT with a (void*) cast has the (unintended?)
side-effect that the address space will be fixed (as generic in OpenCL
2.0 mode). The consequence is that any target specific address space
for the clk_event_t type will not be applied.

It is not clear why the void pointer cast was needed in the first
place, and it seems we can do without it.

Diff Detail

Repository
rL LLVM

Event Timeline

svenvh created this revision.Jun 27 2019, 6:36 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 27 2019, 6:36 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript

btw, there seems to be the same issue with reserve_id_t?

lib/Headers/opencl-c-base.h
416 ↗(On Diff #206850)

Also I don't quite get why we are not just using value 0. I can't see anything relevant in the commit history. Not sure if @yaxunl can help.

Although it doesn't really block this change.

svenvh added a comment.Jul 3 2019, 3:32 AM

btw, there seems to be the same issue with reserve_id_t?

Yes, CLK_NULL_RESERVE_ID has the same cast. I don't have any use case that is affected by it at the moment, so I left it out of this patch. But I can also update it if you prefer.

Anastasia accepted this revision.Jul 3 2019, 10:43 AM

LGTM! Thanks!

If you like you can also change reserve_id_t. :)

This revision is now accepted and ready to land.Jul 3 2019, 10:43 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJul 19 2019, 2:11 AM