[GNA] Remove profiler (#1931)

This commit is contained in:
Pavel Rodionov 2020-08-25 19:59:01 +03:00 committed by GitHub
parent 84c7b048db
commit 19570916e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,88 +17,7 @@
#include "gna_lib_ver_selector.hpp"
#ifndef WIN32
#include <profiler.h>
void clearTimeB(timeb & tb) {
tb.time = 0;
tb.dstflag = 0;
tb.millitm = 0;
tb.timezone = 0;
}
// dummy definitions to work around issue with Linux userspace library
void profilerTscStart(intel_gna_profiler_tsc *p) {
if (nullptr == p) return;
p->stop = 0;
p->start = 0;
}
void profilerTscStop(intel_gna_profiler_tsc *p) {
if (nullptr == p) return;
p->stop = 0;
p->start = 0;
}
void profilerTscStartAccumulate(intel_gna_profiler_tsc *p) {
if (nullptr == p) return;
p->stop = 0;
p->start = 0;
}
void profilerTscStopAccumulate(intel_gna_profiler_tsc *p) {
if (nullptr == p) return;
p->stop = 0;
}
void profilerRtcClear(intel_gna_profiler_rtc *p) {
if (nullptr == p) return;
clearTimeB(p->passed);
clearTimeB(p->start);
clearTimeB(p->stop);
}
void profilerRtcStart(intel_gna_profiler_rtc *p) {
if (nullptr == p) return;
clearTimeB(p->passed);
clearTimeB(p->stop);
ftime(&p->start);
}
void profilerRtcStop(intel_gna_profiler_rtc *p) {
if (nullptr == p) return;
ftime(&p->stop);
/*if ((p->stop.tv_nsec - p->start.tv_nsec)<0) {
p->passed.tv_sec = p->stop.tv_sec - p->start.tv_sec - 1;
p->passed.tv_nsec = 1000000000 + p->stop.tv_nsec - p->start.tv_nsec;
}
else {
p->passed.tv_sec = p->stop.tv_sec - p->start.tv_sec;
p->passed.tv_nsec = p->stop.tv_nsec - p->start.tv_nsec;
}*/
}
void profilerRtcStartAccumulate(intel_gna_profiler_rtc *p) {
if (nullptr == p) return;
clearTimeB(p->stop);
// clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &p->start);
}
void profilerRtcStopAccumulate(intel_gna_profiler_rtc *p) {
if (nullptr == p) return;
// TODO: consider removing dead code from this file
// timespec diff;
// clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &p->stop);
// if ((p->stop.tv_nsec - p->start.tv_nsec)<0) {
// diff.tv_sec = p->stop.tv_sec - p->start.tv_sec - 1;
// diff.tv_nsec = 1000000000 + p->stop.tv_nsec - p->start.tv_nsec;
// }
// else {
// diff.tv_sec = p->stop.tv_sec - p->start.tv_sec;
// diff.tv_nsec = p->stop.tv_nsec - p->start.tv_nsec;
// }
// p->passed.tv_sec += diff.tv_sec;
// p->passed.tv_nsec += diff.tv_nsec;
// if (p->passed.tv_nsec > 1000000000) {
// p->passed.tv_sec++;
// p->passed.tv_nsec -= 1000000000;
// }
}
#endif
void PrintMatrixInt16(const char *ptr_name, int16_t *ptr_matrix, int num_rows, int num_cols, int lda, float scale) {
printf("%s: %dx%d lda %d\n", ptr_name, num_rows, num_cols, lda);
for (int i = 0; i < num_rows; i++) {