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