aco: move statistics enum to aco_shader_info.h

to make it accessible from the driver.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19721>
This commit is contained in:
Daniel Schürmann
2022-07-01 11:19:19 +02:00
committed by Marge Bot
parent 4306897979
commit efc0835787
6 changed files with 41 additions and 42 deletions

View File

@@ -34,32 +34,31 @@
#include <iostream>
#include <vector>
static const std::array<aco_compiler_statistic_info, aco::num_statistics> statistic_infos = []()
static const std::array<aco_compiler_statistic_info, aco_num_statistics> statistic_infos = []()
{
std::array<aco_compiler_statistic_info, aco::num_statistics> ret{};
ret[aco::statistic_hash] =
std::array<aco_compiler_statistic_info, aco_num_statistics> ret{};
ret[aco_statistic_hash] =
aco_compiler_statistic_info{"Hash", "CRC32 hash of code and constant data"};
ret[aco::statistic_instructions] =
ret[aco_statistic_instructions] =
aco_compiler_statistic_info{"Instructions", "Instruction count"};
ret[aco::statistic_copies] =
ret[aco_statistic_copies] =
aco_compiler_statistic_info{"Copies", "Copy instructions created for pseudo-instructions"};
ret[aco::statistic_branches] = aco_compiler_statistic_info{"Branches", "Branch instructions"};
ret[aco::statistic_latency] =
ret[aco_statistic_branches] = aco_compiler_statistic_info{"Branches", "Branch instructions"};
ret[aco_statistic_latency] =
aco_compiler_statistic_info{"Latency", "Issue cycles plus stall cycles"};
ret[aco::statistic_inv_throughput] = aco_compiler_statistic_info{
ret[aco_statistic_inv_throughput] = aco_compiler_statistic_info{
"Inverse Throughput", "Estimated busy cycles to execute one wave"};
ret[aco::statistic_vmem_clauses] = aco_compiler_statistic_info{
ret[aco_statistic_vmem_clauses] = aco_compiler_statistic_info{
"VMEM Clause", "Number of VMEM clauses (includes 1-sized clauses)"};
ret[aco::statistic_smem_clauses] = aco_compiler_statistic_info{
ret[aco_statistic_smem_clauses] = aco_compiler_statistic_info{
"SMEM Clause", "Number of SMEM clauses (includes 1-sized clauses)"};
ret[aco::statistic_sgpr_presched] =
ret[aco_statistic_sgpr_presched] =
aco_compiler_statistic_info{"Pre-Sched SGPRs", "SGPR usage before scheduling"};
ret[aco::statistic_vgpr_presched] =
ret[aco_statistic_vgpr_presched] =
aco_compiler_statistic_info{"Pre-Sched VGPRs", "VGPR usage before scheduling"};
return ret;
}();
const unsigned aco_num_statistics = aco::num_statistics;
const aco_compiler_statistic_info* aco_statistic_infos = statistic_infos.data();
uint64_t
@@ -255,7 +254,7 @@ aco_compile_shader(const struct aco_compiler_options* options,
size_t stats_size = 0;
if (program->collect_statistics)
stats_size = aco::num_statistics * sizeof(uint32_t);
stats_size = aco_num_statistics * sizeof(uint32_t);
(*build_binary)(binary,
shaders[shader_count - 1]->info.stage,