Add mutex when reserving scratch

This prevents race condition when creating queues concurrently.

Change-Id: I5ea9714926fe06e1719fcb2559cb485063355e4f


[ROCm/ROCR-Runtime commit: a1f3b619a7]
Цей коміт міститься в:
David Yat Sin
2023-05-18 16:51:30 +00:00
джерело 14052ab9d0
коміт 255a645c3b
+1
Переглянути файл
@@ -504,6 +504,7 @@ void GpuAgent::InitScratchPool() {
void GpuAgent::ReserveScratch()
{
size_t reserved_sz = core::Runtime::runtime_singleton_->flag().scratch_single_limit();
ScopedAcquire<KernelMutex> lock(&scratch_lock_);
if (!scratch_cache_.reserved_bytes() && reserved_sz) {
HSAuint64 alt_va;
void* reserved_base = scratch_pool_.alloc(reserved_sz);