src/components/sde/sde.c
// The following function works only for counters created using papi_sde_create_counter().
The following function works only for counters created using papi_sde_create_counter().
The following function works only for counters created using papi_sde_create_counter () .
int 
__attribute__((visibility("default")))
papi_sde_reset_counter( void *cntr_handle )
{
    long long int *ptr;
    sde_counter_t *tmp_cntr;
    papi_sde_lock();
    tmp_cntr = (sde_counter_t *)cntr_handle;
    if( NULL == tmp_cntr ){
        papi_sde_unlock();
        PAPIERROR("papi_sde_reset_counter(): 'cntr_handle' is clobbered. Unable to reset value of counter.\n");
        return PAPI_EINVAL;
    }
    ptr = (long long int *)(tmp_cntr->data);
    if( NULL == ptr ){
        papi_sde_unlock();
        PAPIERROR("papi_sde_reset_counter(): Counter structure is clobbered. Unable to reset value of counter.\n");
        return PAPI_EINVAL;
    }
    if( tmp_cntr->is_created ){
        papi_sde_unlock();
        PAPIERROR("papi_sde_reset_counter(): Counter is not created by PAPI, so it cannot be reset.\n");
        return PAPI_EINVAL;
    }
    *ptr = 0; 
    papi_sde_unlock();
    return PAPI_OK;
}
int __attribute__ ( ( visibility ( " " ) ) ) papi_sde_reset_counter ( void * cntr_handle ) { long long int * ptr ; sde_counter_t * tmp_cntr ; papi_sde_lock ( ) ; tmp_cntr = ( sde_counter_t * ) cntr_handle ; if ( NULL == tmp_cntr ) { papi_sde_unlock ( ) ; PAPIERROR ( " \n " ) ; return PAPI_EINVAL ; } ptr = ( long long int * ) ( tmp_cntr -> data ) ; if ( NULL == ptr ) { papi_sde_unlock ( ) ; PAPIERROR ( " \n " ) ; return PAPI_EINVAL ; } if ( tmp_cntr -> is_created ) { papi_sde_unlock ( ) ; PAPIERROR ( " \n " ) ; return PAPI_EINVAL ; } * ptr = 0 ; papi_sde_unlock ( ) ; return PAPI_OK ; }
The following function works only for counters created using papi_sde_create_counter().
The following function works only for counters created using papi_sde_create_counter () .
// Reset the counter.