@@ -208,7 +208,7 @@ Error initPlugins(OffloadContext &Context) {
208208}
209209
210210Error olInit_impl () {
211- std::lock_guard<std::mutex> Lock{ OffloadContextValMutex} ;
211+ std::lock_guard<std::mutex> Lock ( OffloadContextValMutex) ;
212212
213213 if (isOffloadInitialized ()) {
214214 OffloadContext::get ().RefCount ++;
@@ -226,7 +226,7 @@ Error olInit_impl() {
226226}
227227
228228Error olShutDown_impl () {
229- std::lock_guard<std::mutex> Lock{ OffloadContextValMutex} ;
229+ std::lock_guard<std::mutex> Lock ( OffloadContextValMutex) ;
230230
231231 if (--OffloadContext::get ().RefCount != 0 )
232232 return Error::success ();
@@ -487,6 +487,8 @@ Error olSyncQueue_impl(ol_queue_handle_t Queue) {
487487 // Host plugin doesn't have a queue set so it's not safe to call synchronize
488488 // on it, but we have nothing to synchronize in that situation anyway.
489489 if (Queue->AsyncInfo ->Queue ) {
490+ // We don't need to release the queue and we would like the ability for
491+ // other offload threads to submit work concurrently, so pass "false" here.
490492 if (auto Err = Queue->Device ->Device ->synchronize (Queue->AsyncInfo , false ))
491493 return Err;
492494 }
@@ -735,7 +737,7 @@ Error olGetSymbol_impl(ol_program_handle_t Program, const char *Name,
735737 ol_symbol_kind_t Kind, ol_symbol_handle_t *Symbol) {
736738 auto &Device = Program->Image ->getDevice ();
737739
738- std::lock_guard<std::mutex> Lock{ Program->SymbolListMutex } ;
740+ std::lock_guard<std::mutex> Lock ( Program->SymbolListMutex ) ;
739741
740742 switch (Kind) {
741743 case OL_SYMBOL_KIND_KERNEL: {
0 commit comments