From f2751b7030ffe1f2a4d054e5af4210dfed6c88b4 Mon Sep 17 00:00:00 2001 From: David Yat Sin Date: Mon, 22 Apr 2024 19:00:48 +0000 Subject: [PATCH] Fix queue creation for PC Sampling Fix lazy pointer initialization for dedicated PC Sampling queue. Previous implementation would always create a queue on GPU agent creation instead of creating the queue on first use. Change-Id: Icf300f2b162e59143ba61ba182d9bee6e1308fc1 --- runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp b/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp index 622fa9174a..8273ca2cb5 100644 --- a/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp +++ b/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp @@ -765,7 +765,7 @@ void GpuAgent::InitDma() { // Dedicated compute queue for PC Sampling CP-DMA commands. We need a dedicated queue that runs at // highest priority because we do not want the CP-DMA commands to be delayed/blocked due to // other dispatches/barriers that could be in the other AQL queues. - queues_[QueuePCSampling].reset(queue_lambda(HSA_QUEUE_PRIORITY_MAXIMUM)); + queues_[QueuePCSampling].reset([queue_lambda, this]() { return queue_lambda(HSA_QUEUE_PRIORITY_MAXIMUM); }); // Decide which engine to use for blits. auto blit_lambda = [this](bool use_xgmi, lazy_ptr& queue, bool isHostToDev) {