Skip to content

[SYCL] Implement sycl_khr_queue_flush#22214

Open
HPS-1 wants to merge 4 commits into
intel:syclfrom
HPS-1:khr_flush
Open

[SYCL] Implement sycl_khr_queue_flush#22214
HPS-1 wants to merge 4 commits into
intel:syclfrom
HPS-1:khr_flush

Conversation

@HPS-1

@HPS-1 HPS-1 commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Implement khr_flush() as per spec https://registry.khronos.org/SYCL/specs/sycl-2020/html/sycl-2020.html#sec:khr-queue-flush, which essentially issues all command in the queue to the device without waiting for them to complete.

Signed-off-by: Hu, Peisen <peisen.hu@intel.com>
@HPS-1 HPS-1 marked this pull request as ready for review June 4, 2026 14:44
@HPS-1 HPS-1 requested review from a team as code owners June 4, 2026 14:44
@HPS-1 HPS-1 requested a review from slawekptak June 4, 2026 14:44
HPS-1 added 2 commits June 9, 2026 02:01
Signed-off-by: Hu, Peisen <peisen.hu@intel.com>
Signed-off-by: Hu, Peisen <peisen.hu@intel.com>
@HPS-1

HPS-1 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

@intel/llvm-reviewers-runtime Hi can you take a look at this PR and approve it if applicable? Thanks in advance!

@koparasy koparasy left a comment

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.

LGTM, a nit.

Comment on lines +36 to +37
while (SingleTaskEv.get_info<sycl::info::event::command_execution_status>() !=
sycl::info::event_command_status::complete) {

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.

Can we have here a time bound? e.g.:

#include <chrono>
#include <thread>

....

auto Deadline = std::chrono::steady_clock::now() + std::chrono::seconds(2);
while (SingleTaskEv.get_info<sycl::info::event::command_execution_status>() !=
       sycl::info::event_command_status::complete) {
  if (std::chrono::steady_clock::now() > Deadline) {
    assert(false && "khr_flush did not progress within 30s");
    break;
  }
  std::this_thread::sleep_for(std::chrono::milliseconds(10));
}

Or something among these lines?

Signed-off-by: Hu, Peisen <peisen.hu@intel.com>
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