contrctor/destructor changes, OnLoad/OnUnload functions, removed hsa_init()/hsa_shutdown()
[ROCm/rocprofiler commit: a9a5119399]
Este commit está contenido en:
1 padre
1621e666da
commit
6eef0003a5
11 files changed
+97
-58
No files matched your search
@@ -13,6 +13,6 @@ int main(int argc, char** argv) {
|
||||
const int diter = (diter_s != NULL) ? atol(diter_s) : 1;
|
||||
TestHsa::HsaInstantiate();
|
||||
for (int i = 0; i < kiter; ++i) RunKernel<SimpleConvolution, TestAql>(argc, argv, diter);
|
||||
//TestHsa::HsaShutdown();
|
||||
TestHsa::HsaShutdown();
|
||||
return 0;
|
||||
}
|
||||
@@ -69,7 +69,10 @@ HsaRsrcFactory* TestHsa::HsaInstantiate(const uint32_t agent_ind) {
|
||||
}
|
||||
|
||||
void TestHsa::HsaShutdown() {
|
||||
if (hsa_queue_ != NULL) hsa_queue_destroy(hsa_queue_);
|
||||
if (hsa_queue_ != NULL) {
|
||||
hsa_queue_destroy(hsa_queue_);
|
||||
hsa_queue_ = NULL;
|
||||
}
|
||||
if (hsa_rsrc_) hsa_rsrc_->Destroy();
|
||||
}
|
||||
|
||||
|
||||
@@ -338,7 +338,7 @@ static hsa_status_t info_callback(const rocprofiler_info_data_t info, void * arg
|
||||
}
|
||||
|
||||
// Tool constructor
|
||||
CONSTRUCTOR_API void constructor()
|
||||
extern "C" PUBLIC_API void OnLoadTool()
|
||||
{
|
||||
std::map<std::string, hsa_ven_amd_aqlprofile_parameter_name_t> parameters_dict;
|
||||
parameters_dict["HSA_VEN_AMD_AQLPROFILE_PARAMETER_NAME_COMPUTE_UNIT_TARGET"] =
|
||||
@@ -487,23 +487,21 @@ CONSTRUCTOR_API void constructor()
|
||||
}
|
||||
|
||||
// Tool destructor
|
||||
DESTRUCTOR_API void destructor() {
|
||||
const bool result_file_opened = (result_prefix != NULL) && (result_file_handle != NULL);
|
||||
extern "C" PUBLIC_API void OnUnloadTool() {
|
||||
// Unregister dispatch callback
|
||||
rocprofiler_remove_dispatch_callback();
|
||||
|
||||
// Dump stored profiling output data
|
||||
const bool result_file_opened = (result_prefix != NULL) && (result_file_handle != NULL);
|
||||
printf("\nROCPRofiler: %u contexts collected", context_count);
|
||||
if (result_file_opened) printf(", output directory %s", result_prefix);
|
||||
printf("\n");
|
||||
|
||||
// Dump stored profiling output data
|
||||
dump_context_array();
|
||||
if (result_file_opened) fclose(result_file_handle);
|
||||
|
||||
// Unregister dispatch callback and free callback data
|
||||
rocprofiler_remove_dispatch_callback();
|
||||
// Cleanup
|
||||
if (dispatch_data != NULL) {
|
||||
delete[] dispatch_data->features;
|
||||
delete dispatch_data;
|
||||
}
|
||||
|
||||
// Close output file
|
||||
if (result_file_opened) fclose(result_file_handle);
|
||||
}
|
||||
@@ -213,14 +213,14 @@
|
||||
# VALUBusy The percentage of GPUTime vector ALU instructions are processed. Value range: 0% (bad) to 100% (optimal).
|
||||
<metric
|
||||
name="VALUBusy"
|
||||
expr=100*SQ_ACTIVE_INST_VALU*4/NUM_SIMDS/GRBM_GUI_ACTIVE
|
||||
expr=100*SQ_ACTIVE_INST_VALU*4/SIMD_NUM/GRBM_GUI_ACTIVE
|
||||
descr="The percentage of GPUTime vector ALU instructions are processed. Value range: 0% (bad) to 100% (optimal)."
|
||||
></metric>
|
||||
|
||||
# SALUBusy The percentage of GPUTime scalar ALU instructions are processed. Value range: 0% (bad) to 100% (optimal).
|
||||
<metric
|
||||
name="SALUBusy"
|
||||
expr=100*SQ_INST_CYCLES_SALU*4/NUM_SIMDS/GRBM_GUI_ACTIVE
|
||||
expr=100*SQ_INST_CYCLES_SALU*4/SIMD_NUM/GRBM_GUI_ACTIVE
|
||||
descr="The percentage of GPUTime scalar ALU instructions are processed. Value range: 0% (bad) to 100% (optimal)."
|
||||
></metric>
|
||||
|
||||
@@ -248,14 +248,14 @@
|
||||
# MemUnitBusy The percentage of GPUTime the memory unit is active. The result includes the stall time (MemUnitStalled). This is measured with all extra fetches and writes and any cache or memory effects taken into account. Value range: 0% to 100% (fetch-bound).
|
||||
<metric
|
||||
name="MemUnitBusy"
|
||||
expr=100*max(TA_BUSY,16)/GRBM_GUI_ACTIVE/NUM_SHADER_ENGINES
|
||||
expr=100*max(TA_BUSY,16)/GRBM_GUI_ACTIVE/SE_NUM
|
||||
descr="The percentage of GPUTime the memory unit is active. The result includes the stall time (MemUnitStalled). This is measured with all extra fetches and writes and any cache or memory effects taken into account. Value range: 0% to 100% (fetch-bound)."
|
||||
></metric>
|
||||
|
||||
# MemUnitStalled The percentage of GPUTime the memory unit is stalled. Try reducing the number or size of fetches and writes if possible. Value range: 0% (optimal) to 100% (bad).
|
||||
<metric
|
||||
name="MemUnitStalled"
|
||||
expr=100*max(TCP_TA_DATA_STALL_CYCLES,16)/GRBM_GUI_ACTIVE/NUM_SHADER_ENGINES
|
||||
expr=100*max(TCP_TA_DATA_STALL_CYCLES,16)/GRBM_GUI_ACTIVE/SE_NUM
|
||||
descr="The percentage of GPUTime the memory unit is stalled. Try reducing the number or size of fetches and writes if possible. Value range: 0% (optimal) to 100% (bad)."
|
||||
></metric>
|
||||
|
||||
@@ -276,7 +276,7 @@
|
||||
# LDSBankConflict The percentage of GPUTime LDS is stalled by bank conflicts. Value range: 0% (optimal) to 100% (bad).
|
||||
<metric
|
||||
name="LDSBankConflict"
|
||||
expr=100*SQ_LDS_BANK_CONFLICT/GRBM_GUI_ACTIVE/NUM_SIMDS
|
||||
expr=100*SQ_LDS_BANK_CONFLICT/GRBM_GUI_ACTIVE/CU_NUM
|
||||
descr="The percentage of GPUTime LDS is stalled by bank conflicts. Value range: 0% (optimal) to 100% (bad)."
|
||||
></metric>
|
||||
|
||||
|
||||
Reference in new issue
Block a user