Mesa (master): nvc0: compute a percentage for metric-achieved_occupancy

Samuel Pitoiset hakzsam at kemper.freedesktop.org
Tue May 3 21:22:45 UTC 2016


Module: Mesa
Branch: master
Commit: 5658ddc7fe828813f8e10de06a830d8a4cdb576d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=5658ddc7fe828813f8e10de06a830d8a4cdb576d

Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date:   Mon May  2 22:12:44 2016 +0200

nvc0: compute a percentage for metric-achieved_occupancy

metric-issue_slot_utilization and metric-branch_efficiency are already
computed as percentages.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>

---

 src/gallium/drivers/nouveau/nvc0/nvc0_query_hw_metric.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_query_hw_metric.c b/src/gallium/drivers/nouveau/nvc0/nvc0_query_hw_metric.c
index 0b63397..7ea9871 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_query_hw_metric.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_query_hw_metric.c
@@ -437,9 +437,9 @@ sm20_hw_metric_calc_result(struct nvc0_hw_query *hq, uint64_t res64[8])
 {
    switch (hq->base.type - NVC0_HW_METRIC_QUERY(0)) {
    case NVC0_HW_METRIC_QUERY_ACHIEVED_OCCUPANCY:
-      /* (active_warps / active_cycles) / max. number of warps on a MP */
+      /* ((active_warps / active_cycles) / max. number of warps on a MP) * 100 */
       if (res64[1])
-         return (res64[0] / (double)res64[1]) / 48;
+         return ((res64[0] / (double)res64[1]) / 48) * 100;
       break;
    case NVC0_HW_METRIC_QUERY_BRANCH_EFFICIENCY:
       /* (branch / (branch + divergent_branch)) * 100 */
@@ -530,9 +530,9 @@ sm30_hw_metric_calc_result(struct nvc0_hw_query *hq, uint64_t res64[8])
 {
    switch (hq->base.type - NVC0_HW_METRIC_QUERY(0)) {
    case NVC0_HW_METRIC_QUERY_ACHIEVED_OCCUPANCY:
-      /* (active_warps / active_cycles) / max. number of warps on a MP */
+      /* ((active_warps / active_cycles) / max. number of warps on a MP) * 100 */
       if (res64[1])
-         return (res64[0] / (double)res64[1]) / 64;
+         return ((res64[0] / (double)res64[1]) / 64) * 100;
       break;
    case NVC0_HW_METRIC_QUERY_BRANCH_EFFICIENCY:
       return sm20_hw_metric_calc_result(hq, res64);




More information about the mesa-commit mailing list