00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043 #ifndef __PCXX_TIMERS_H__
00044 #define __PCXX_TIMERS_H__
00045
00046
00047
00048 # define PCXX_EVENT(c, e, p)
00049 # define PCXX_WTIMER_CLEAR 60199
00050 # define PCXX_WTIMER_START 60100
00051 # define PCXX_WTIMER_STOP 60200
00052 # define PCXX_UTIMER_CLEAR 60399
00053 # define PCXX_UTIMER_START 60300
00054 # define PCXX_UTIMER_STOP 60400
00055
00056 #ifdef __cplusplus
00057 # define LANG "C"
00058 #else
00059 # define LANG
00060 #endif
00061
00062
00063
00064
00065
00066
00067
00068 #ifdef __PARAGON__
00069
00070 extern LANG double pcxxT_dclock ();
00071 extern LANG double pcxxT_start;
00072 # define pcxx_GetUSecL() ((pcxxT_dclock() - pcxxT_start) * 0.1)
00073 # define pcxx_GetUSecD() (pcxxT_dclock() * 0.1)
00074 # define tulip_WallClock() (pcxxT_dclock() * 1.0e-7)
00075 #else
00076 #ifdef __ksr__
00077 # include <ksr/ksr_timers.h>
00078 # define pcxx_GetUSecL() x_all_timer()
00079 # define pcxx_GetUSecD() (all_seconds() * 1.0e6)
00080 # define tulip_WallClock() (all_seconds())
00081 # define tulip_UserClock() (user_seconds())
00082 #else
00083 #if ( defined(_SEQUENT_) || defined(sequent) )
00084
00085 # include <usclkc.h>
00086 # define pcxx_GetUSecL() GETUSCLK()
00087 # define pcxx_GetUSecD() ((double) GETUSCLK())
00088 # define tulip_WallClock() ((double) GETUSCLK() * 1.0e-6)
00089 #else
00090 #ifdef butterfly
00091 extern LANG long getusecclock ();
00092 # define pcxx_GetUSecL() getusecclock()
00093 # define pcxx_GetUSecD() ((double) getusecclock())
00094 # define tulip_WallClock() ((double) getusecclock() * 1.0e-6)
00095 #else
00096
00097 #ifdef __SP1_T__
00098
00099 extern LANG double pcxxT_time;
00100 extern LANG double pcxxT_start;
00101 extern LANG void tb0time(double*);
00102 # define pcxx_GetUSecL() (tb0time(&pcxxT_time),(pcxxT_time-pcxxT_start)*1.0e3)
00103 # define pcxx_GetUSecD() (tb0time(&pcxxT_time),pcxxT_time*1.0e3)
00104 # define tulip_WallClock() (tb0time(&pcxxT_time),pcxxT_time*1.0e-3)
00105 #else
00106 #ifdef __MEIKO__
00107 # define pcxx_GetUSecL()
00108 # define pcxx_GetUSecD()
00109 # define tulip_WallClock()
00110 #else
00111 #ifdef __T3D__
00112
00113 # include <time.h>
00114 # define pcxx_GetUSecL() (rtclock() / 150)
00115 # define pcxx_GetUSecD() ((double) rtclock() * 0.6666666667e-2)
00116 # define tulip_WallClock() ((double) rtclock() * 0.6666666667e-8)
00117 # define tulip_UserClock() ((double) cpused() * 0.6666666667e-8)
00118 # define tulip_InitClocks()
00119 #else
00120 #ifdef _CRAYT3E
00121
00122 # include <time.h>
00123 # define pcxx_GetUSecL() (rtclock() / 300)
00124 # define pcxx_GetUSecD() ((double) rtclock() * 0.3333333333e-2)
00125 # define tulip_WallClock() ((double) rtclock() * 0.3333333333e-8)
00126 # define tulip_UserClock() ((double) cpused() * 0.3333333333e-8)
00127 # define tulip_InitClocks()
00128 #else
00129 extern LANG unsigned long int pcxxT_GetClock ();
00130 # define pcxx_GetUSecL() pcxxT_GetClock()
00131 # define pcxx_GetUSecD() ((double) pcxxT_GetClock())
00132 # define tulip_WallClock() ((double) pcxxT_GetClock() * 1.0e-6)
00133 #endif
00134 #endif
00135 #endif
00136 #endif
00137 #endif
00138 #endif
00139 #endif
00140 #endif
00141
00142
00143
00144
00145 #if ( !defined(__T3D__) && !defined(_CRAYT3E) )
00146 extern LANG void tulip_InitClocks ();
00147 #endif
00148 #if ( !defined(__ksr__) && !defined(__T3D__) && !defined(_CRAYT3E) )
00149 extern LANG double tulip_UserClock();
00150 #endif
00151 extern LANG int tulip_UserTimerClear(int);
00152 extern LANG int tulip_UserTimerStart(int);
00153 extern LANG int tulip_UserTimerStop(int);
00154 extern LANG double tulip_UserTimerElapsed(int);
00155 extern LANG int tulip_WallTimerClear(int);
00156 extern LANG int tulip_WallTimerStart(int);
00157 extern LANG int tulip_WallTimerStop(int);
00158 extern LANG double tulip_WallTimerElapsed(int);
00159
00160 #endif
00161
00162
00163
00164
00165
00166
00167