src/components/rocm/linux-rocm.c
/* Enumerate Native Events.
 *   @param EventCode is the event of interest
 *   @param modifier is one of PAPI_ENUM_FIRST, PAPI_ENUM_EVENTS
 */
Enumerate Native Events.
@param EventCode is the event of interest
@param modifier is one of PAPI_ENUM_FIRST, PAPI_ENUM_EVENTS
Enumerate Native Events . @param EventCode is the event of interest @param modifier is one of PAPI_ENUM_FIRST PAPI_ENUM_EVENTS
static int _rocm_ntv_enum_events(unsigned int *EventCode, int modifier)
{
    switch (modifier) {
    case PAPI_ENUM_FIRST:
        *EventCode = 0;
        return (PAPI_OK);
        break;
    case PAPI_ENUM_EVENTS:
        if(global__rocm_context == NULL) {
            return (PAPI_ENOEVNT);
        } else if(*EventCode < global__rocm_context->availEventSize - 1) {
            *EventCode = *EventCode + 1;
            return (PAPI_OK);
        } else
            return (PAPI_ENOEVNT);
        break;
    default:
        return (PAPI_EINVAL);
    }
    return (PAPI_OK);
}
static int _rocm_ntv_enum_events ( unsigned int * EventCode , int modifier ) { switch ( modifier ) { case PAPI_ENUM_FIRST : * EventCode = 0 ; return ( PAPI_OK ) ; break ; case PAPI_ENUM_EVENTS : if ( global__rocm_context == NULL ) { return ( PAPI_ENOEVNT ) ; } else if ( * EventCode < global__rocm_context -> availEventSize - 1 ) { * EventCode = * EventCode + 1 ; return ( PAPI_OK ) ; } else return ( PAPI_ENOEVNT ) ; break ; default : return ( PAPI_EINVAL ) ; } return ( PAPI_OK ) ; }
Enumerate Native Events.
Enumerate Native Events .
//ROCMDBG("Entering (get next event after %u)\n", *EventCode );