From bd59789f0b0fbef25e191ab95a3dabd74e51d274 Mon Sep 17 00:00:00 2001 From: Sean Keely Date: Thu, 3 Jun 2021 18:23:28 -0500 Subject: [PATCH] Add debugging checks for packet type in the scratch handler. Change-Id: I84a6f18548ac39349595e3a1c8a5a9ff27d4e178 --- runtime/hsa-runtime/core/runtime/amd_aql_queue.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/runtime/hsa-runtime/core/runtime/amd_aql_queue.cpp b/runtime/hsa-runtime/core/runtime/amd_aql_queue.cpp index 466afe2beb..8263741278 100644 --- a/runtime/hsa-runtime/core/runtime/amd_aql_queue.cpp +++ b/runtime/hsa-runtime/core/runtime/amd_aql_queue.cpp @@ -782,6 +782,10 @@ bool AqlQueue::DynamicScratchHandler(hsa_signal_value_t error_code, void* arg) { core::AqlPacket& pkt = ((core::AqlPacket*)queue->amd_queue_.hsa_queue.base_address)[pkt_slot_idx]; + assert(pkt.IsValid() && "Invalid packet in dynamic scratch handler."); + assert(pkt.type() == HSA_PACKET_TYPE_KERNEL_DISPATCH && + "Invalid packet in dynamic scratch handler."); + uint32_t scratch_request = pkt.dispatch.private_segment_size; const uint32_t MaxScratchSlots =