Skip to content

Prototype: Disable event creation and tweak enqueue path #386

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

Draft
wants to merge 1 commit into
base: sycl
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ inline void partial_barrier(queue Q, const std::vector<event> &Events,
inline void execute_graph(queue Q, command_graph<graph_state::executable> &G,
const sycl::detail::code_location &CodeLoc =
sycl::detail::code_location::current()) {
Q.ext_oneapi_graph(G, CodeLoc);
submit(std::move(Q), [&](handler &CGH) { CGH.ext_oneapi_graph(G); }, CodeLoc);
}

inline void execute_graph(handler &CGH,
Expand Down
8 changes: 8 additions & 0 deletions sycl/source/detail/graph_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1015,6 +1015,7 @@ exec_graph_impl::enqueue(const std::shared_ptr<sycl::detail::queue_impl> &Queue,
auto CommandBuffer = CurrentPartition->MCommandBuffers[Queue->get_device()];

if (CommandBuffer) {
#if 0
for (std::vector<sycl::detail::EventImplPtr>::iterator It =
MExecutionEvents.begin();
It != MExecutionEvents.end();) {
Expand All @@ -1036,6 +1037,7 @@ exec_graph_impl::enqueue(const std::shared_ptr<sycl::detail::queue_impl> &Queue,
}

NewEvent = CreateNewEvent();
#endif
ur_event_handle_t UREvent = nullptr;
// Merge requirements from the nodes into requirements (if any) from the
// handler.
Expand All @@ -1047,14 +1049,20 @@ exec_graph_impl::enqueue(const std::shared_ptr<sycl::detail::queue_impl> &Queue,
// If we have no requirements or dependent events for the command buffer,
// enqueue it directly
if (CGData.MRequirements.empty() && CGData.MEvents.empty()) {
#if 0
NewEvent->setSubmissionTime();
NewEvent->setHostEnqueueTime();
#endif
ur_result_t Res =
Queue->getAdapter()
->call_nocheck<
sycl::detail::UrApiKind::urEnqueueCommandBufferExp>(
Queue->getHandleRef(), CommandBuffer, 0, nullptr, &UREvent);
#if 0
NewEvent->setHandle(UREvent);
#else
return sycl::event{};
#endif
if (Res == UR_RESULT_ERROR_INVALID_QUEUE_PROPERTIES) {
throw sycl::exception(
make_error_code(errc::invalid),
Expand Down
Loading