Skip to content

[SYCL] Improve enqueue function host task#21679

Open
KornevNikita wants to merge 5 commits intointel:syclfrom
KornevNikita:use-l0-native-host-task
Open

[SYCL] Improve enqueue function host task#21679
KornevNikita wants to merge 5 commits intointel:syclfrom
KornevNikita:use-l0-native-host-task

Conversation

@KornevNikita
Copy link
Copy Markdown
Contributor

Spec: https://github.com/intel/llvm/blob/sycl/sycl/doc/extensions/experimental/sycl_ext_oneapi_enqueue_functions.asciidoc
SYCL headers patch: #21456

This is the second part of the host_task enqueue function implementation. L0 provides an API to launch host tasks - zeCommandListAppendHostFunction. This is API is used by the urEnqueueHostTaskExp UR function. This patch switches enqueue function host_task to use this API if it's possible.

Spec: https://github.com/intel/llvm/blob/sycl/sycl/doc/extensions/experimental/sycl_ext_oneapi_enqueue_functions.asciidoc
SYCL headers patch: intel#21456

This is the second part of the host_task enqueue function implementation.
L0 provides an API to launch host tasks - zeCommandListAppendHostFunction.
This is API is used by the urEnqueueHostTaskExp UR function.
This patch switch enqueue function host_task to use this API if it's
possible.
@KornevNikita KornevNikita requested a review from a team as a code owner April 2, 2026 13:59
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the SYCL experimental sycl_ext_oneapi_enqueue_functions host_task path to prefer the Unified Runtime urEnqueueHostTaskExp API (backed by Level Zero zeCommandListAppendHostFunction) when supported, and adds an e2e test intended to validate the UR call path via tracing output.

Changes:

  • Route enqueue-functions host_task submissions through a new internal handler entry point that tags host tasks as originating from the enqueue-functions API.
  • In host-task dispatch, query UR_DEVICE_INFO_ENQUEUE_HOST_TASK_SUPPORT_EXP and call urEnqueueHostTaskExp when available.
  • Add an e2e test that checks UR tracing for the device-info query and urEnqueueHostTaskExp.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
sycl/test-e2e/EnqueueFunctions/native_host_task.cpp Adds an e2e trace-based test for urEnqueueHostTaskExp usage.
sycl/source/handler.cpp Adds SetHostTaskFromExtEnqueueFunctions to tag host tasks created by enqueue-functions.
sycl/source/detail/scheduler/commands.cpp Attempts to enqueue ext host tasks via urEnqueueHostTaskExp when supported.
sycl/source/detail/host_task.hpp Tracks host-task origin (core API vs enqueue-functions API).
sycl/include/sycl/handler.hpp Adds internal plumbing (HandlerAccess) for enqueue-functions host task submission.
sycl/include/sycl/ext/oneapi/experimental/enqueue_functions.hpp Switches enqueue-functions host_task to use the new internal handler entry point.

@KornevNikita KornevNikita marked this pull request as draft April 7, 2026 11:30
@KornevNikita KornevNikita marked this pull request as ready for review April 8, 2026 15:01
@KornevNikita
Copy link
Copy Markdown
Contributor Author

@uditagarwal97 out of draft, take a look please

});
}
}
Q.wait();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry, why this change?

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.

3 participants