diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_aql_queue.cpp b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_aql_queue.cpp index 466afe2beb..8263741278 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_aql_queue.cpp +++ b/projects/rocr-runtime/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 =