Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrap urEventSetCallback when ran through loader #2527

Merged
merged 1 commit into from
Jan 14, 2025

Conversation

RossBrunton
Copy link
Contributor

The events returned by the loader do not match the events returned by
openCL (or other backends), which causes issues when adding a callback
handler. This adds an intermediate wrapper to replace the event with the
loader event.

@github-actions github-actions bot added ci/cd Continuous integration/devliery loader Loader related feature/bug conformance Conformance test suite issues. labels Jan 7, 2025
// Replace the callback with a wrapper function that gives the callback the loader event rather than a
// backend-specific event
auto wrapper_data =
new event_callback_wrapper_data_t{pfnNotify, hEvent, pUserData};
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I know. Manual memory management.

But I'm not sure if there's a better C++-y way of doing this, does anyone have any ideas?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it possible to use a smart pointer instead maybe?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so. It needs to survive a roundtrip to and from a bare pointer to be used in the API.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, i don't think we can rely on raii here, unless you'd like to manually play around with constructing/destroying unique pointers, but I don't see much point.

@RossBrunton RossBrunton changed the title RFC: Wrap urEventSetCallback when ran through loader Wrap urEventSetCallback when ran through loader Jan 9, 2025
@RossBrunton RossBrunton marked this pull request as ready for review January 9, 2025 12:39
@RossBrunton RossBrunton requested a review from a team as a code owner January 9, 2025 12:39
RossBrunton added a commit to RossBrunton/intel-llvm that referenced this pull request Jan 9, 2025
@RossBrunton RossBrunton requested review from a team as code owners January 10, 2025 17:21
@RossBrunton RossBrunton marked this pull request as draft January 10, 2025 17:21
@github-actions github-actions bot added specification Changes or additions to the specification hip HIP adapter specific issues labels Jan 10, 2025
The events returned by the loader do not match the events returned by
openCL (or other backends), which causes issues when adding a callback
handler. This adds an intermediate wrapper to replace the event with the
loader event.
@RossBrunton RossBrunton removed specification Changes or additions to the specification hip HIP adapter specific issues labels Jan 13, 2025
@RossBrunton RossBrunton removed request for a team and jchlanda January 13, 2025 11:12
@RossBrunton RossBrunton removed the request for review from konradkusiak97 January 13, 2025 11:12
RossBrunton added a commit to RossBrunton/intel-llvm that referenced this pull request Jan 13, 2025
@RossBrunton RossBrunton marked this pull request as ready for review January 13, 2025 14:43
@RossBrunton RossBrunton merged commit ad88f0a into oneapi-src:main Jan 14, 2025
73 checks passed
RossBrunton added a commit to RossBrunton/intel-llvm that referenced this pull request Jan 14, 2025
RossBrunton added a commit to RossBrunton/intel-llvm that referenced this pull request Jan 14, 2025
martygrant pushed a commit to intel/llvm that referenced this pull request Jan 15, 2025
@RossBrunton RossBrunton deleted the ross/wrapper branch January 16, 2025 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci/cd Continuous integration/devliery conformance Conformance test suite issues. loader Loader related feature/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants