@@ -364,14 +364,10 @@ UR_APIEXPORT ur_result_t UR_APICALL urQueueGetInfo(
364364 case UR_QUEUE_INFO_REFERENCE_COUNT:
365365 return ReturnValue (uint32_t {Queue->RefCount .load ()});
366366 case UR_QUEUE_INFO_FLAGS:
367- die (" UR_QUEUE_INFO_FLAGS in urQueueGetInfo not implemented\n " );
368- break ;
367+ return ReturnValue (Queue->Properties );
369368 case UR_QUEUE_INFO_SIZE:
370- die (" UR_QUEUE_INFO_SIZE in urQueueGetInfo not implemented\n " );
371- break ;
372369 case UR_QUEUE_INFO_DEVICE_DEFAULT:
373- die (" UR_QUEUE_INFO_DEVICE_DEFAULT in urQueueGetInfo not implemented\n " );
374- break ;
370+ return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION;
375371 case UR_QUEUE_INFO_EMPTY: {
376372 // We can exit early if we have in-order queue.
377373 if (Queue->isInOrderQueue ()) {
@@ -602,8 +598,14 @@ UR_APIEXPORT ur_result_t UR_APICALL urQueueRelease(
602598 {
603599 std::scoped_lock<ur_shared_mutex> Lock (Queue->Mutex );
604600
605- if ((--Queue->RefCountExternal ) != 0 )
601+ if ((--Queue->RefCountExternal ) != 0 ) {
602+ // When an External Reference exists one still needs to decrement the
603+ // internal reference count. When the External Reference count == 0, then
604+ // cleanup of the queue begins and the final decrement of the internal
605+ // reference count is completed.
606+ Queue->RefCount .decrementAndTest ();
606607 return UR_RESULT_SUCCESS;
608+ }
607609
608610 // When external reference count goes to zero it is still possible
609611 // that internal references still exists, e.g. command-lists that
0 commit comments