| 204 | } |
| 205 | |
| 206 | void |
| 207 | clsparseHostTimer::Stop( size_t id ) |
| 208 | { |
| 209 | cl_ulong n; |
| 210 | |
| 211 | #if defined( _WIN32 ) |
| 212 | ::QueryPerformanceCounter( reinterpret_cast<LARGE_INTEGER*>( &n ) ); |
| 213 | #else |
| 214 | struct timeval s; |
| 215 | gettimeofday( &s, 0 ); |
| 216 | n = (cl_ulong)s.tv_sec * 1000000 + (cl_ulong)s.tv_usec; |
| 217 | #endif |
| 218 | |
| 219 | n -= clkStart.at( id ); |
| 220 | clkStart.at( id ) = 0; |
| 221 | AddSample( id, n ); |
| 222 | } |
| 223 | |
| 224 | void |
| 225 | clsparseHostTimer::AddSample( const size_t id, const cl_ulong n ) |