add profiler

This commit is contained in:
chen68
2020-07-28 16:40:48 +08:00
parent 229538a1db
commit 0ff3f1e177
8 changed files with 445 additions and 80 deletions
+9
View File
@@ -21,8 +21,13 @@
#include <stdio.h>
#include <time.h>
#include <sys/time.h>
#include <dirent.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <cstddef>
#define INFO_LOG(fmt, args...) fprintf(stdout, "[INFO] " fmt "\n", ##args)
#define DEBUG_LOG(fmt, args...) fprintf(stdout, "[DEBUG] " fmt "\n", ##args)
#define WARN_LOG(fmt, args...) fprintf(stdout, "[WARN] " fmt "\n", ##args)
#define ERROR_LOG(fmt, args...) fprintf(stdout, "[ERROR] " fmt "\n", ##args)
@@ -72,6 +77,10 @@ public:
static double InferenceTimeAverage(double *x, int len);
static double InferenceTimeAverageWithoutFirst(double *x, int len);
static void ProfilerJson(bool isprof, map<char,string>& params);
static void DumpJson(bool isdump, map<char,string>& params);
};
#pragma once