[SYCL] Implement sycl_khr_queue_flush#22214
Open
HPS-1 wants to merge 4 commits into
Open
Conversation
Signed-off-by: Hu, Peisen <peisen.hu@intel.com>
gmlueck
approved these changes
Jun 4, 2026
Signed-off-by: Hu, Peisen <peisen.hu@intel.com>
Signed-off-by: Hu, Peisen <peisen.hu@intel.com>
Contributor
Author
|
@intel/llvm-reviewers-runtime Hi can you take a look at this PR and approve it if applicable? Thanks in advance! |
koparasy
approved these changes
Jun 9, 2026
Comment on lines
+36
to
+37
| while (SingleTaskEv.get_info<sycl::info::event::command_execution_status>() != | ||
| sycl::info::event_command_status::complete) { |
Contributor
There was a problem hiding this comment.
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.