-
Notifications
You must be signed in to change notification settings - Fork 123
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
Conversation
898c382
to
55425b3
Compare
// 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}; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
55425b3
to
a14e712
Compare
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.
a14e712
to
599a28e
Compare
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.