6e972dd3bb
Support performance tests while direct tests commands keep unchanged. To build performance tests, run "make build_perf". To run all performance testis, run "make perf". To run specific tests, for example, run /usr/bin/ctest -C performance -R performance_tests/perfDispatch --verbose To run individual test, for example, run performance_tests/memory/hipPerfMemMallocCpyFree Change-Id: I168c1b9ef1ec21b392d48648d0c71e8fbd37d57b
29 行
380 B
C++
29 行
380 B
C++
#ifndef _TIMER_H_
|
|
#define _TIMER_H_
|
|
|
|
#ifdef _WIN32
|
|
typedef __int64 i64 ;
|
|
#endif
|
|
#ifdef __linux__
|
|
typedef long long i64;
|
|
#endif
|
|
|
|
class CPerfCounter {
|
|
|
|
public:
|
|
CPerfCounter();
|
|
~CPerfCounter();
|
|
void Start(void);
|
|
void Stop(void);
|
|
void Reset(void);
|
|
double GetElapsedTime(void);
|
|
|
|
private:
|
|
|
|
i64 _freq;
|
|
i64 _clocks;
|
|
i64 _start;
|
|
};
|
|
|
|
#endif // _TIMER_H_
|