src/components/rocm_smi/linux-rocm-smi.c
// Triggered by eventset operations like add or remove.
// Note: NativeInfo_t is defined in papi_internal.h
// We parse the list of events given; find the corresponding
// AllEvents[] entries, and set up flags.
Triggered by eventset operations like add or remove.
Note: NativeInfo_t is defined in papi_internal.h
We parse the list of events given; find the corresponding
AllEvents[] entries, and set up flags.
Triggered by eventset operations like add or remove . Note : NativeInfo_t is defined in papi_internal . h We parse the list of events given ; find the corresponding AllEvents [] entries and set up flags .
static int _rocm_smi_update_control_state(hwd_control_state_t * ctrl, NativeInfo_t * nativeInfo, int nativeCount, hwd_context_t * ctx)
{
    SUBDBG("Entering _rocm_smi_update_control_state with nativeCount %d\n", nativeCount);
    (void) ctrl;
    (void) ctx;
    int i, idx;
    if(nativeCount == 0) return (PAPI_OK);      
    for (i=0; i<TotalEvents; i++) {             
        AllEvents[i].read=0;                    
    }
    for (i=0; i<nativeCount; i++) {             
        idx = nativeInfo[i].ni_event;           
        CurrentIdx[i] = idx;                    
        nativeInfo[i].ni_position = i;          
    }
    ActiveEvents=nativeCount;                   
    return (PAPI_OK);
}
static int _rocm_smi_update_control_state ( hwd_control_state_t * ctrl , NativeInfo_t * nativeInfo , int nativeCount , hwd_context_t * ctx ) { SUBDBG ( " \n " , nativeCount ) ; ( void ) ctrl ; ( void ) ctx ; int i , idx ; if ( nativeCount == 0 ) return ( PAPI_OK ) ; for ( i = 0 ; i < TotalEvents ; i ++ ) { AllEvents [ i ] . read = 0 ; } for ( i = 0 ; i < nativeCount ; i ++ ) { idx = nativeInfo [ i ] . ni_event ; CurrentIdx [ i ] = idx ; nativeInfo [ i ] . ni_position = i ; } ActiveEvents = nativeCount ; return ( PAPI_OK ) ; }
Triggered by eventset operations like add or remove.
Triggered by eventset operations like add or remove .
// If no events provided, success! // Clear the event list. // Not read yet. // For each user event provided; // Get the event index, // Remember events, in order, for reporting later. // Which event it was. // Remember how many we have.