rusticl/queue: fix clReleaseCommandQueue

we have to flush the queue on every call

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15439>
This commit is contained in:
Karol Herbst 2022-03-16 16:19:48 +01:00 committed by Marge Bot
parent a4c0f59b5f
commit 883b218eff
2 changed files with 9 additions and 1 deletions

View file

@ -534,7 +534,7 @@ extern "C" fn cl_retain_command_queue(command_queue: cl_command_queue) -> cl_int
}
extern "C" fn cl_release_command_queue(command_queue: cl_command_queue) -> cl_int {
match_err!(command_queue.release())
match_err!(release_command_queue(command_queue))
}
extern "C" fn cl_get_command_queue_info(

View file

@ -79,3 +79,11 @@ pub fn finish_queue(command_queue: cl_command_queue) -> CLResult<()> {
// CL_INVALID_COMMAND_QUEUE if command_queue is not a valid host command-queue.
command_queue.get_ref()?.flush(true)
}
pub fn release_command_queue(command_queue: cl_command_queue) -> CLResult<()> {
// clReleaseCommandQueue performs an implicit flush to issue any previously queued OpenCL
// commands in command_queue.
flush_queue(command_queue)?;
command_queue.release()?;
Ok(())
}