提交 fe8a1fae 编写于 作者: G gineshidalgo99

Profiler slightly changed

上级 d781f832
...@@ -64,7 +64,7 @@ namespace op ...@@ -64,7 +64,7 @@ namespace op
tDatum.inputNetData = spCvMatToOpInput->format(tDatum.cvInputData); tDatum.inputNetData = spCvMatToOpInput->format(tDatum.cvInputData);
// Profiling speed // Profiling speed
Profiler::timerEnd(profilerKey); Profiler::timerEnd(profilerKey);
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, 1000); Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, Profiler::DEFAULT_X);
// Debugging log // Debugging log
dLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__); dLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__);
} }
......
...@@ -66,7 +66,7 @@ namespace op ...@@ -66,7 +66,7 @@ namespace op
std::tie(tDatum.scaleInputToOutput, tDatum.outputData) = spCvMatToOpOutput->format(tDatum.cvInputData); std::tie(tDatum.scaleInputToOutput, tDatum.outputData) = spCvMatToOpOutput->format(tDatum.cvInputData);
// Profiling speed // Profiling speed
Profiler::timerEnd(profilerKey); Profiler::timerEnd(profilerKey);
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, 1000); Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, Profiler::DEFAULT_X);
// Debugging log // Debugging log
dLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__); dLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__);
} }
......
...@@ -63,7 +63,7 @@ namespace op ...@@ -63,7 +63,7 @@ namespace op
} }
// Profiling speed // Profiling speed
Profiler::timerEnd(profilerKey); Profiler::timerEnd(profilerKey);
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, 1000); Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, Profiler::DEFAULT_X);
// Debugging log // Debugging log
dLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__); dLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__);
} }
......
...@@ -64,7 +64,7 @@ namespace op ...@@ -64,7 +64,7 @@ namespace op
tDatum.cvOutputData = spOpOutputToCvMat->formatToCvMat(tDatum.outputData); tDatum.cvOutputData = spOpOutputToCvMat->formatToCvMat(tDatum.outputData);
// Profiling speed // Profiling speed
Profiler::timerEnd(profilerKey); Profiler::timerEnd(profilerKey);
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, 1000); Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, Profiler::DEFAULT_X);
// Debugging log // Debugging log
dLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__); dLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__);
} }
......
...@@ -71,7 +71,7 @@ namespace op ...@@ -71,7 +71,7 @@ namespace op
} }
// Profiling speed // Profiling speed
Profiler::timerEnd(profilerKey); Profiler::timerEnd(profilerKey);
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, 1000); Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, Profiler::DEFAULT_X);
// Debugging log // Debugging log
dLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__); dLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__);
} }
......
...@@ -68,7 +68,7 @@ namespace op ...@@ -68,7 +68,7 @@ namespace op
spFaceRenderer->renderFace(tDatum.outputData, tDatum.faceKeyPoints); spFaceRenderer->renderFace(tDatum.outputData, tDatum.faceKeyPoints);
// Profiling speed // Profiling speed
Profiler::timerEnd(profilerKey); Profiler::timerEnd(profilerKey);
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, 1000); Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, Profiler::DEFAULT_X);
// Debugging log // Debugging log
dLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__); dLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__);
} }
......
...@@ -81,7 +81,7 @@ namespace op ...@@ -81,7 +81,7 @@ namespace op
spPoseJsonCocoSaver->record(tDatum.poseKeyPoints, imageId); spPoseJsonCocoSaver->record(tDatum.poseKeyPoints, imageId);
// Profiling speed // Profiling speed
Profiler::timerEnd(profilerKey); Profiler::timerEnd(profilerKey);
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, 1000); Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, Profiler::DEFAULT_X);
} }
else else
{ {
......
...@@ -71,7 +71,7 @@ namespace op ...@@ -71,7 +71,7 @@ namespace op
} }
// Profiling speed // Profiling speed
Profiler::timerEnd(profilerKey); Profiler::timerEnd(profilerKey);
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, 1000); Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, Profiler::DEFAULT_X);
// Debugging log // Debugging log
dLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__); dLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__);
} }
......
...@@ -68,7 +68,7 @@ namespace op ...@@ -68,7 +68,7 @@ namespace op
spHandRenderer->renderHands(tDatum.outputData, tDatum.handKeyPoints); spHandRenderer->renderHands(tDatum.outputData, tDatum.handKeyPoints);
// Profiling speed // Profiling speed
Profiler::timerEnd(profilerKey); Profiler::timerEnd(profilerKey);
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, 1000); Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, Profiler::DEFAULT_X);
// Debugging log // Debugging log
dLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__); dLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__);
} }
......
...@@ -70,7 +70,7 @@ namespace op ...@@ -70,7 +70,7 @@ namespace op
spHeatMapSaver->saveHeatMaps(poseHeatMaps, fileName); spHeatMapSaver->saveHeatMaps(poseHeatMaps, fileName);
// Profiling speed // Profiling speed
Profiler::timerEnd(profilerKey); Profiler::timerEnd(profilerKey);
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, 1000); Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, Profiler::DEFAULT_X);
// Debugging log // Debugging log
dLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__); dLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__);
} }
......
...@@ -70,7 +70,7 @@ namespace op ...@@ -70,7 +70,7 @@ namespace op
spImageSaver->saveImages(cvOutputDatas, fileName); spImageSaver->saveImages(cvOutputDatas, fileName);
// Profiling speed // Profiling speed
Profiler::timerEnd(profilerKey); Profiler::timerEnd(profilerKey);
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, 1000); Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, Profiler::DEFAULT_X);
// Debugging log // Debugging log
dLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__); dLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__);
} }
......
...@@ -68,7 +68,7 @@ namespace op ...@@ -68,7 +68,7 @@ namespace op
spPoseJsonSaver->savePoseKeyPoints(poseKeyPointsVector, fileName); spPoseJsonSaver->savePoseKeyPoints(poseKeyPointsVector, fileName);
// Profiling speed // Profiling speed
Profiler::timerEnd(profilerKey); Profiler::timerEnd(profilerKey);
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, 1000); Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, Profiler::DEFAULT_X);
// Debugging log // Debugging log
dLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__); dLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__);
} }
......
...@@ -69,7 +69,7 @@ namespace op ...@@ -69,7 +69,7 @@ namespace op
spPoseSaver->savePoseKeyPoints(poseKeyPointsVector, fileName); spPoseSaver->savePoseKeyPoints(poseKeyPointsVector, fileName);
// Profiling speed // Profiling speed
Profiler::timerEnd(profilerKey); Profiler::timerEnd(profilerKey);
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, 1000); Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, Profiler::DEFAULT_X);
// Debugging log // Debugging log
dLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__); dLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__);
} }
......
...@@ -69,7 +69,7 @@ namespace op ...@@ -69,7 +69,7 @@ namespace op
spVideoSaver->write(cvOutputDatas); spVideoSaver->write(cvOutputDatas);
// Profiling speed // Profiling speed
Profiler::timerEnd(profilerKey); Profiler::timerEnd(profilerKey);
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, 1000); Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, Profiler::DEFAULT_X);
// Debugging log // Debugging log
dLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__); dLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__);
} }
......
...@@ -71,7 +71,7 @@ namespace op ...@@ -71,7 +71,7 @@ namespace op
if (!tDatumsNoPtr.empty()) if (!tDatumsNoPtr.empty())
{ {
Profiler::timerEnd(profilerKey); Profiler::timerEnd(profilerKey);
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, 1000); Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, Profiler::DEFAULT_X);
} }
// Debugging log // Debugging log
dLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__); dLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__);
......
...@@ -61,7 +61,7 @@ namespace op ...@@ -61,7 +61,7 @@ namespace op
spGuiInfoAdder->addInfo(tDatum.cvOutputData, tDatum.poseKeyPoints, tDatum.id, tDatum.elementRendered.second); spGuiInfoAdder->addInfo(tDatum.cvOutputData, tDatum.poseKeyPoints, tDatum.id, tDatum.elementRendered.second);
// Profiling speed // Profiling speed
Profiler::timerEnd(profilerKey); Profiler::timerEnd(profilerKey);
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, 1000); Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, Profiler::DEFAULT_X);
// Debugging log // Debugging log
dLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__); dLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__);
} }
......
...@@ -68,7 +68,7 @@ namespace op ...@@ -68,7 +68,7 @@ namespace op
} }
// Profiling speed // Profiling speed
Profiler::timerEnd(profilerKey); Profiler::timerEnd(profilerKey);
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, 1000); Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, Profiler::DEFAULT_X);
// Debugging log // Debugging log
dLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__); dLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__);
} }
......
...@@ -63,7 +63,7 @@ namespace op ...@@ -63,7 +63,7 @@ namespace op
tDatum.elementRendered = spPoseRenderer->renderPose(tDatum.outputData, tDatum.poseKeyPoints, tDatum.scaleNetToOutput); tDatum.elementRendered = spPoseRenderer->renderPose(tDatum.outputData, tDatum.poseKeyPoints, tDatum.scaleNetToOutput);
// Profiling speed // Profiling speed
Profiler::timerEnd(profilerKey); Profiler::timerEnd(profilerKey);
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, 1000); Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, Profiler::DEFAULT_X);
// Debugging log // Debugging log
dLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__); dLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__);
} }
......
...@@ -64,7 +64,7 @@ namespace op ...@@ -64,7 +64,7 @@ namespace op
this->stop(); this->stop();
// Profiling speed // Profiling speed
Profiler::timerEnd(profilerKey); Profiler::timerEnd(profilerKey);
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, 1000); Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, Profiler::DEFAULT_X);
// Debugging log // Debugging log
dLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__); dLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__);
// Return TDatums // Return TDatums
......
...@@ -108,7 +108,7 @@ namespace op ...@@ -108,7 +108,7 @@ namespace op
{ {
// Profiling speed // Profiling speed
Profiler::timerEnd(profilerKey); Profiler::timerEnd(profilerKey);
Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, 1000); Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, Profiler::DEFAULT_X);
// Debugging log // Debugging log
dLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__); dLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__);
} }
......
...@@ -13,20 +13,22 @@ ...@@ -13,20 +13,22 @@
// const auto profilerKey = Profiler::timerInit(__LINE__, __FUNCTION__, __FILE__); // const auto profilerKey = Profiler::timerInit(__LINE__, __FUNCTION__, __FILE__);
// // functions to do... // // functions to do...
// Profiler::timerEnd(profilerKey); // Profiler::timerEnd(profilerKey);
// Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, 1000); // Profiler::printAveragedTimeMsOnIterationX(profilerKey, __LINE__, __FUNCTION__, __FILE__, Profiler::DEFAULT_X);
namespace op namespace op
{ {
class Profiler class Profiler
{ {
public: public:
static const unsigned long long DEFAULT_X;
static const std::string timerInit(const int line, const std::string& function, const std::string& file); static const std::string timerInit(const int line, const std::string& function, const std::string& file);
static void timerEnd(const std::string& key); static void timerEnd(const std::string& key);
static void printAveragedTimeMsOnIterationX(const std::string& key, const int line, const std::string& function, const std::string& file, const unsigned long long x); static void printAveragedTimeMsOnIterationX(const std::string& key, const int line, const std::string& function, const std::string& file, const unsigned long long x = DEFAULT_X);
static void printAveragedTimeMsEveryXIterations(const std::string& key, const int line, const std::string& function, const std::string& file, const unsigned long long x); static void printAveragedTimeMsEveryXIterations(const std::string& key, const int line, const std::string& function, const std::string& file, const unsigned long long x = DEFAULT_X);
static void profileGpuMemory(const int line, const std::string& function, const std::string& file); static void profileGpuMemory(const int line, const std::string& function, const std::string& file);
}; };
......
...@@ -11,7 +11,10 @@ ...@@ -11,7 +11,10 @@
namespace op namespace op
{ {
const unsigned long long Profiler::DEFAULT_X = 1000;
#ifdef PROFILER_ENABLED #ifdef PROFILER_ENABLED
std::map<std::string, std::tuple<double, unsigned long long, std::chrono::high_resolution_clock::time_point>> sProfilerTuple{ std::map<std::string, std::tuple<double, unsigned long long, std::chrono::high_resolution_clock::time_point>> sProfilerTuple{
std::map<std::string, std::tuple<double, unsigned long long, std::chrono::high_resolution_clock::time_point>>() std::map<std::string, std::tuple<double, unsigned long long, std::chrono::high_resolution_clock::time_point>>()
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册