@@ -365,14 +365,10 @@ ur_result_t ur_queue_handle_legacy_t_::queueGetInfo(
365
365
case UR_QUEUE_INFO_REFERENCE_COUNT:
366
366
return ReturnValue (uint32_t {Queue->RefCount .load ()});
367
367
case UR_QUEUE_INFO_FLAGS:
368
- die (" UR_QUEUE_INFO_FLAGS in urQueueGetInfo not implemented\n " );
369
- break ;
368
+ return ReturnValue (Queue->Properties );
370
369
case UR_QUEUE_INFO_SIZE:
371
- die (" UR_QUEUE_INFO_SIZE in urQueueGetInfo not implemented\n " );
372
- break ;
373
370
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;
376
372
case UR_QUEUE_INFO_EMPTY: {
377
373
// We can exit early if we have in-order queue.
378
374
if (Queue->isInOrderQueue ()) {
@@ -606,8 +602,14 @@ ur_result_t ur_queue_handle_legacy_t_::queueRelease() {
606
602
{
607
603
std::scoped_lock<ur_shared_mutex> Lock (Queue->Mutex );
608
604
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 ();
610
611
return UR_RESULT_SUCCESS;
612
+ }
611
613
612
614
// When external reference count goes to zero it is still possible
613
615
// that internal references still exists, e.g. command-lists that
0 commit comments