Changeset 5268


Ignore:
Timestamp:
Jan 19, 2017, 3:36:42 PM (8 months ago)
Author:
nmedfort
Message:

Removed generate_predefined_ucd_functions.cpp. No longer used with the kernel system.

Location:
icGREP/icgrep-devel/icgrep
Files:
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/hrtime.h

    r4937 r5268  
    33
    44//Downloaded from code.Google.com
    5 
    6 #include <stdio.h>
    7 #include <string.h>
    8 #include <assert.h>
    9 
    10 // get the number of CPU cycles per microsecond from Linux /proc filesystem
    11 // return < 0 on error
    12 inline double getMHZ(void) {
    13   double mhz = -1;
    14   char line[1024], *s, search_str[] = "cpu MHz";
    15   FILE* fp;
    16 
    17   // open proc/cpuinfo
    18   if ((fp = fopen("/proc/cpuinfo", "r")) == nullptr)
    19     return -1;
    20 
    21   // ignore all lines until we reach MHz information
    22   while (fgets(line, 1024, fp) != nullptr) {
    23     if (strstr(line, search_str) != nullptr) {
    24       // ignore all characters in line up to :
    25       for (s = line; *s && (*s != ':'); ++s)
    26         ;
    27       // get MHz number
    28       if (*s && (sscanf(s+1, "%lf", &mhz) == 1))
    29         break;
    30     }
    31   }
    32 
    33   if (fp != nullptr)
    34     fclose(fp);
    35   return mhz;
    36 }
    375
    386typedef uint64_t timestamp_t;
     
    5624}
    5725
    58 // get the elapsed time (in milliseconds) since startup
    59 inline double getElapsedTime() {
    60   static double CPU_HZ = 0;
    61   if (CPU_HZ == 0)
    62     CPU_HZ = getMHZ() * 1000000;
    63   return (read_cycle_counter() / CPU_HZ);
    64 }
    65 
    6626#endif // __HRTIME_H__
    6727
  • icGREP/icgrep-devel/icgrep/icgrep-devel.files

    r5267 r5268  
    202202array-test.cpp
    203203base64.cpp
    204 generate_predefined_ucd_functions.cpp
    205204grep_engine.cpp
    206205grep_engine.h
Note: See TracChangeset for help on using the changeset viewer.