From cbc3c97252f7082c198cbf98f2355c79d970db19 Mon Sep 17 00:00:00 2001 From: Evgeny Date: Tue, 24 Apr 2018 21:48:23 -0500 Subject: [PATCH] aqlprofile: read API Change-Id: I896b1fbf1c19608197ac0a99b9d467d8c1bee775 [ROCm/ROCR-Runtime commit: b37027e347202efe90ac2136f52a6b08803970c6] --- .../runtime/hsa-runtime/core/runtime/hsa.cpp | 3 +++ .../hsa-runtime/inc/hsa_ven_amd_aqlprofile.h | 13 ++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) 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,