nvc0: fix metric-achieved_occupancy calculation on Kepler
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 16 Dec 2015 20:18:03 +0000 (21:18 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 16 Dec 2015 21:00:57 +0000 (22:00 +0100)
The maximum number of resident warps per multiprocessor is 64 on
Kepler instead of 48 on Fermi.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
src/gallium/drivers/nouveau/nvc0/nvc0_query_hw_metric.c

index 12fb609b62a98800d7933eb7da042a1d336c17de..323bd47731d6854bba9bd362457169a5cc21e031 100644 (file)
@@ -420,7 +420,10 @@ sm30_hw_metric_calc_result(struct nvc0_hw_query *hq, uint64_t res64[8])
 {
    switch (hq->base.type - NVE4_HW_METRIC_QUERY(0)) {
    case NVE4_HW_METRIC_QUERY_ACHIEVED_OCCUPANCY:
-      return sm20_hw_metric_calc_result(hq, res64);
+      /* (active_warps / active_cycles) / max. number of warps on a MP */
+      if (res64[1])
+         return (res64[0] / (double)res64[1]) / 64;
+      break;
    case NVE4_HW_METRIC_QUERY_BRANCH_EFFICIENCY:
       return sm20_hw_metric_calc_result(hq, res64);
    case NVE4_HW_METRIC_QUERY_INST_ISSUED: