diff --git a/projects/rocprofiler/inc/rocprofiler.h b/projects/rocprofiler/inc/rocprofiler.h index 4e265f8b37..91661635dc 100644 --- a/projects/rocprofiler/inc/rocprofiler.h +++ b/projects/rocprofiler/inc/rocprofiler.h @@ -496,6 +496,8 @@ struct rocprofiler_hsa_callback_data_t { const void* packet; // submitted to GPU packet const char* kernel_name; // kernel name, not NULL if dispatch hsa_queue_t* queue; // HSA queue the kernel was submitted to + uint32_t device_type; // type of device the packed is submitted to + uint32_t device_id; // id of device the packed is submitted to } submit; }; }; diff --git a/projects/rocprofiler/src/core/intercept_queue.h b/projects/rocprofiler/src/core/intercept_queue.h index f24bf5b7d0..cfacdc6612 100644 --- a/projects/rocprofiler/src/core/intercept_queue.h +++ b/projects/rocprofiler/src/core/intercept_queue.h @@ -139,6 +139,8 @@ class InterceptQueue { data.submit.kernel_name = (GetHeaderType(packet) == HSA_PACKET_TYPE_KERNEL_DISPATCH) ? GetKernelName(dispatch_packet) : NULL; data.submit.queue = obj->queue_; + data.submit.device_type = obj->agent_info_->dev_type; + data.submit.device_id = obj->agent_info_->dev_index; submit_callback_fun_(ROCPROFILER_HSA_CB_ID_SUBMIT, &data, submit_callback_arg_); } } diff --git a/projects/rocprofiler/test/tool/tool.cpp b/projects/rocprofiler/test/tool/tool.cpp index bda99bf1f2..95cc38ddb9 100644 --- a/projects/rocprofiler/test/tool/tool.cpp +++ b/projects/rocprofiler/test/tool/tool.cpp @@ -859,6 +859,8 @@ hsa_status_t hsa_unified_callback( printf(" packet %p\n", data->submit.packet); if (data->submit.kernel_name != NULL) { printf(" submit kernel \"%s\"\n", data->submit.kernel_name); + printf(" device type = %u\n", data->submit.device_type); + printf(" device id = %u\n", data->submit.device_id); } break; default: