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_identity_template.cpp

    r1721 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//      int Events[NUM_EVENTS] = {PAPI_TOT_CYC};
     14#ifdef L1_PERF
     15        int Events[NUM_EVENTS] = {PAPI_L2_DCM};
     16#elif L2_PERF
     17        int Events[NUM_EVENTS] = {PAPI_L1_DCM};
     18#else
     19        int Events[NUM_EVENTS] = {PAPI_BR_MSP};
     20#endif
    1621        int cal_size = 20;
    1722        CC * parser_timer = new CC(Events,NUM_EVENTS,cal_size);
     
    258263      if (allow_performance_check)
    259264      {
    260         PERF_SEC_END(parser_timer, chars_avail);
     265#ifndef CACHE_PERF
     266         PERF_SEC_END(parser_timer, chars_avail);
     267#else
     268         PERF_SEC_END(parser_timer, 1);
     269#endif
    261270      }
    262271      int bytes_left = chars_read - chars_avail;
     
    296305    if (allow_performance_check)
    297306    {
    298         PERF_SEC_END(parser_timer, chars_avail);
    299     }
    300 }
     307#ifndef CACHE_PERF
     308         PERF_SEC_END(parser_timer, chars_avail);
     309#else
     310         PERF_SEC_END(parser_timer, 1);
     311#endif
     312    }
     313}
Note: See TracChangeset for help on using the changeset viewer.