Skip to content

[SYCL] Implement sycl_khr_queue_flush#22158

Open
HPS-1 wants to merge 5 commits into
intel:syclfrom
HPS-1:khr_flush_ext
Open

[SYCL] Implement sycl_khr_queue_flush#22158
HPS-1 wants to merge 5 commits into
intel:syclfrom
HPS-1:khr_flush_ext

Conversation

@HPS-1
Copy link
Copy Markdown
Contributor

@HPS-1 HPS-1 commented May 28, 2026

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. It seems that there's an existing UR function urQueueFlush() that achieves the "flushing" functionality, so I'm mostly reusing its code (in a new UR func urKhrFlush(), and I'm not directly using it due to the issue stated below).

However there's an issue that, for the OpenCL backend, urQueueFlush() is calling clFinish() (wait for commands to complete spec here) instead of clFlush() (doesn't wait for commands to complete spec here),
image
despite it clearly says its analogue is clFlush() in unified-runtime/source/loader/ur_libapi.cpp:
image
So I changed it in urKhrFlush() to call clFlush() instead. But not sure if it's a glitch or intended to use clFinish() for urQueueFlush(), can some reviewer from runtime kindly checks this out? If it's a glitch then I think we can just fix it and directly use urQueueFlush() for khr_flush()?

HPS-1 added 5 commits May 28, 2026 07:36
Signed-off-by: Hu, Peisen <peisen.hu@intel.com>
Signed-off-by: Hu, Peisen <peisen.hu@intel.com>
Signed-off-by: Hu, Peisen <peisen.hu@intel.com>
Signed-off-by: Hu, Peisen <peisen.hu@intel.com>
Signed-off-by: Hu, Peisen <peisen.hu@intel.com>
@HPS-1 HPS-1 changed the title [WIP] [Do not merge] Implement sycl_khr_queue_flush [SYCL] Implement sycl_khr_queue_flush Jun 2, 2026
@HPS-1 HPS-1 marked this pull request as ready for review June 2, 2026 14:48
@HPS-1 HPS-1 requested review from a team as code owners June 2, 2026 14:48
@HPS-1 HPS-1 requested review from kweronsx and uditagarwal97 June 2, 2026 14:48
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