[SYCL] Implement sycl_khr_queue_flush#22158
Open
HPS-1 wants to merge 5 commits into
Open
Conversation
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>
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. It seems that there's an existing UR functionurQueueFlush()that achieves the "flushing" functionality, so I'm mostly reusing its code (in a new UR funcurKhrFlush(), 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 callingclFinish()(wait for commands to complete spec here) instead ofclFlush()(doesn't wait for commands to complete spec here),despite it clearly says its analogue is
clFlush()in unified-runtime/source/loader/ur_libapi.cpp:So I changed it in
urKhrFlush()to callclFlush()instead. But not sure if it's a glitch or intended to useclFinish()forurQueueFlush(), can some reviewer from runtime kindly checks this out? If it's a glitch then I think we can just fix it and directly useurQueueFlush()for khr_flush()?