@@ -365,14 +365,10 @@ ur_result_t ur_queue_handle_legacy_t_::queueGetInfo(
365365 case UR_QUEUE_INFO_REFERENCE_COUNT:
366366 return ReturnValue (uint32_t {Queue->RefCount .load ()});
367367 case UR_QUEUE_INFO_FLAGS:
368- die (" UR_QUEUE_INFO_FLAGS in urQueueGetInfo not implemented\n " );
369- break ;
368+ return ReturnValue (Queue->Properties );
370369 case UR_QUEUE_INFO_SIZE:
371- die (" UR_QUEUE_INFO_SIZE in urQueueGetInfo not implemented\n " );
372- break ;
373370 case UR_QUEUE_INFO_DEVICE_DEFAULT:
374- die (" UR_QUEUE_INFO_DEVICE_DEFAULT in urQueueGetInfo not implemented\n " );
375- break ;
371+ return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION;
376372 case UR_QUEUE_INFO_EMPTY: {
377373 // We can exit early if we have in-order queue.
378374 if (Queue->isInOrderQueue ()) {
@@ -606,8 +602,14 @@ ur_result_t ur_queue_handle_legacy_t_::queueRelease() {
606602 {
607603 std::scoped_lock<ur_shared_mutex> Lock (Queue->Mutex );
608604
609- if ((--Queue->RefCountExternal ) != 0 )
605+ if ((--Queue->RefCountExternal ) != 0 ) {
606+ // When an External Reference exists one still needs to decrement the
607+ // internal reference count. When the External Reference count == 0, then
608+ // cleanup of the queue begins and the final decrement of the internal
609+ // reference count is completed.
610+ Queue->RefCount .decrementAndTest ();
610611 return UR_RESULT_SUCCESS;
612+ }
611613
612614 // When external reference count goes to zero it is still possible
613615 // that internal references still exists, e.g. command-lists that
0 commit comments