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 Feb 13, 2025
1 parent 2efc5af commit 2bcf72e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/cuda/cupti_profiler.c
Original file line number Diff line number Diff line change
Expand Up @@ -551,13 +551,14 @@ 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]
.structSize = NVPW_RawMetricsConfig_BeginPassGroup_Params_STRUCT_SIZE,
.pPriv = NULL, // assign to NULL
.pRawMetricsConfig = pRawMetricsConfig,
.maxPassCount = 1,
};
nvpa_err = NVPW_RawMetricsConfig_BeginPassGroupPtr(&beginPassGroupParams);
if (nvpa_err != NVPA_STATUS_SUCCESS) {
Expand Down Expand Up @@ -833,6 +834,10 @@ 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,
Expand Down

0 comments on commit 2bcf72e

Please sign in to comment.