diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/hsa.cpp b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/hsa.cpp index c33b78f13f..c8a8a86435 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/hsa.cpp +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/hsa.cpp @@ -489,6 +489,9 @@ hsa_status_t hsa_system_get_major_extension_table(uint16_t extension, uint16_t v ext_table.hsa_ven_amd_aqlprofile_stop = (decltype(::hsa_ven_amd_aqlprofile_stop)*) os::GetExportAddress(lib, "hsa_ven_amd_aqlprofile_stop"); + ext_table.hsa_ven_amd_aqlprofile_read = + (decltype(::hsa_ven_amd_aqlprofile_read)*) + os::GetExportAddress(lib, "hsa_ven_amd_aqlprofile_read"); ext_table.hsa_ven_amd_aqlprofile_legacy_get_pm4 = (decltype(::hsa_ven_amd_aqlprofile_legacy_get_pm4)*) os::GetExportAddress(lib, "hsa_ven_amd_aqlprofile_legacy_get_pm4"); diff --git a/projects/rocr-runtime/runtime/hsa-runtime/inc/hsa_ven_amd_aqlprofile.h b/projects/rocr-runtime/runtime/hsa-runtime/inc/hsa_ven_amd_aqlprofile.h index a433976f41..eee73627da 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/inc/hsa_ven_amd_aqlprofile.h +++ b/projects/rocr-runtime/runtime/hsa-runtime/inc/hsa_ven_amd_aqlprofile.h @@ -203,6 +203,13 @@ hsa_status_t hsa_ven_amd_aqlprofile_stop( const hsa_ven_amd_aqlprofile_profile_t* profile, // [in] profile contex object hsa_ext_amd_aql_pm4_packet_t* aql_stop_packet); // [out] profile stop AQL packet +// Method to populate the provided AQL packet with profiling read commands +// Only 'pm4_command' fields of the packet are set and the application +// is responsible to set Vendor Specific header type and a completion signal +hsa_status_t hsa_ven_amd_aqlprofile_read( + const hsa_ven_amd_aqlprofile_profile_t* profile, // [in] profile contex object + hsa_ext_amd_aql_pm4_packet_t* aql_read_packet); // [out] profile stop AQL packet + // Legacy devices, PM4 profiling packet size const unsigned HSA_VEN_AMD_AQLPROFILE_LEGACY_PM4_PACKET_SIZE = 192; // Legacy devices, converting the profiling AQL packet to PM4 packet blob @@ -299,7 +306,11 @@ typedef struct hsa_ven_amd_aqlprofile_1_00_pfn_s { hsa_status_t (*hsa_ven_amd_aqlprofile_stop)( const hsa_ven_amd_aqlprofile_profile_t* profile, - hsa_ext_amd_aql_pm4_packet_t* aql_start_packet); + hsa_ext_amd_aql_pm4_packet_t* aql_stop_packet); + + hsa_status_t (*hsa_ven_amd_aqlprofile_read)( + const hsa_ven_amd_aqlprofile_profile_t* profile, + hsa_ext_amd_aql_pm4_packet_t* aql_read_packet); hsa_status_t (*hsa_ven_amd_aqlprofile_legacy_get_pm4)( const hsa_ext_amd_aql_pm4_packet_t* aql_packet,