8000 [NFCI][SYCL] Refactor `HandlerAccess::postProcess` by aelovikov-intel · Pull Request #19203 · intel/llvm · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[NFCI][SYCL] Refactor HandlerAccess::postProcess #19203

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

Open
wants to merge 3 commits into
base: sycl
Choose a base branch
from

Conversation

aelovikov-intel
Copy link
Contributor

Implements the idea from the earlier TODO comment. Instead of having a hacky handler::MLastEvent just swap original and post-processing handler, so that "natural" finalize will work on the latest task in the chain.

Implements the idea from the earlier TODO comment. Instead of having a
hacky `handler::MLastEvent` just `swap` original and post-processing
`handler`, so that "natural" `finalize` will work on the latest task in
the chain.
// Reductions implementation need access to private members of handler. Those
// are limited to those below.
inline void finalizeHandler(handler &CGH);
template <class FunctorTy> void withAuxHandler(handler &CGH, FunctorTy Func);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

withAuxHandler declaration should have been removed earlier when postProcess was introduced instead of it.

@@ -488,6 +488,9 @@ class __SYCL_EXPORT handler {
/// \param Graph is a SYCL command_graph
handler(std::shared_ptr<ext::oneapi::experimental::detail::graph_impl> Graph);
#endif
handler(std::unique_ptr<detail::handler_impl> &&HandlerImpl);

~handler();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

std::unique_ptr<T> dtor needs a complete T, so move the definition to the handler.cpp.

@@ -577,11 +571,10 @@ event handler::finalize() {
DiscardEvent = !KernelUsesAssert;
}

#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
if (!DiscardEvent) {
LastEventImpl = detail::event_impl::create_completed_host_event();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

No idea why we were using create_completed_host_event before. @slawekptak , any thoughts?

@@ -635,29 +627,32 @@ event handler::finalize() {

if (DiscardEvent) {
EnqueueKernel();
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
LastEventImpl->setStateDiscarded();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Line 654 on the right does create_discarded_event instead, which, IMO, is even more readable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0