Ignore:
Timestamp:
Dec 17, 2011, 3:23:46 PM (8 years ago)
Author:
vla24
Message:

Added some macro for easy PAPI performance testing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • proto/SymbolTable/wcd_pbgs_identity_template.cpp

    r1741 r1791  
    1111#elif CODE_CLOCKER
    1212        #define NUM_EVENTS 1
    13         int Events[NUM_EVENTS] = {PAPI_TOT_CYC};
    14         //int Events[NUM_EVENTS] = {PAPI_L2_DCM};
    15         //int Events[NUM_EVENTS] = {PAPI_TOT_CYC, PAPI_BR_MSP};
     13#ifdef L1_PERF
     14        int Events[NUM_EVENTS] = {PAPI_L2_DCM};
     15#elif L2_PERF
     16        int Events[NUM_EVENTS] = {PAPI_L1_DCM};
     17#else
     18        int Events[NUM_EVENTS] = {PAPI_BR_MSP};
     19#endif
    1620        int cal_size = 20;
    1721        CC * parser_timer = new CC(Events,NUM_EVENTS,cal_size);
     
    303307      if (allow_performance_check)
    304308      {
    305         PERF_SEC_END(parser_timer, chars_avail);
     309#ifndef CACHE_PERF
     310         PERF_SEC_END(parser_timer, chars_avail);
     311#else
     312         PERF_SEC_END(parser_timer, 1);
     313#endif
    306314      }
    307315      int bytes_left = chars_read - chars_avail;
     
    341349    if (allow_performance_check)
    342350    {
    343         PERF_SEC_END(parser_timer, chars_avail);
    344     }
    345 }
     351#ifndef CACHE_PERF
     352         PERF_SEC_END(parser_timer, chars_avail);
     353#else
     354         PERF_SEC_END(parser_timer, 1);
     355#endif
     356    }
     357}
Note: See TracChangeset for help on using the changeset viewer.