Skip to content

Commit

Permalink
Remove maxPassCount from calculate_num_passes. Add further documentat…
Browse files Browse the repository at this point in the history
…ion for maxPassCount behavior.
  • Loading branch information
Treece Burgess committed Jan 23, 2025
1 parent ac09128 commit a0959c1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/components/cuda/cupti_profiler.c
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,8 @@ static int calculate_num_passes(struct NVPA_RawMetricsConfig *pRawMetricsConfig,
int numNestingLevels = 1, numIsolatedPasses, numPipelinedPasses;
NVPA_Status nvpa_err;

/* NOTE: maxPassCount is not set here as we want to properly show the number of passes for
metrics that require multiple passes in papi_native_avail. */
/* instantiate a new struct to be passed to NVPW_RawMetricsConfig_BeginPassGroup_Params */
NVPW_RawMetricsConfig_BeginPassGroup_Params beginPassGroupParams = {
// [in]
Expand Down Expand Up @@ -832,10 +834,15 @@ static int metric_get_config_image(cuptip_gpu_state_t *gpu_ctl)
nvpwCheckErrors( NVPW_RawMetricsConfig_SetCounterAvailabilityPtr(&setCounterAvailabilityParams), goto fn_fail );
};

/* NOTE: maxPassCount is being set to 1 as a final safety net to limit metric collection to a single pass.
Metrics that require multiple passes would fail further down at AddMetrics due to this.
This failure should never occur as we filter for metrics with multiple passes at check_multipass,
which occurs before the metric_get_config_image call. */
NVPW_RawMetricsConfig_BeginPassGroup_Params beginPassGroupParams = {
.structSize = NVPW_RawMetricsConfig_BeginPassGroup_Params_STRUCT_SIZE,
.pPriv = NULL,
.pRawMetricsConfig = nvpw_metricsConfigCreateParams.pRawMetricsConfig,
.maxPassCount = 1,
};
nvpwCheckErrors( NVPW_RawMetricsConfig_BeginPassGroupPtr(&beginPassGroupParams), goto fn_fail );

Expand Down

0 comments on commit a0959c1

Please sign in to comment.