From e0d91acfae4c413b5aa3ad24bf1d3660efde6539 Mon Sep 17 00:00:00 2001 From: Jihoon Lee Date: Fri, 12 Mar 2021 16:45:26 +0900 Subject: [PATCH] [Clean] Delete overlapping profiler Delete overlapping profiler got into from merge order **Self evaluation:** 1. Build test: [X]Passed [ ]Failed [ ]Skipped 2. Run test: [X]Passed [ ]Failed [ ]Skipped Signed-off-by: Jihoon Lee --- nntrainer/models/neuralnet.h | 65 ------------------------------------ 1 file changed, 65 deletions(-) diff --git a/nntrainer/models/neuralnet.h b/nntrainer/models/neuralnet.h index e8ed7e76..f9bac736 100644 --- a/nntrainer/models/neuralnet.h +++ b/nntrainer/models/neuralnet.h @@ -443,71 +443,6 @@ public: */ void disableDynamicFineTuning() { dynamic_training_opt.disable(); } -/// @todo Make a more common class have this -/// Maybe appcontext can have this? -#ifdef PROFILE - class Profiler { - public: - // Designated key. - enum { FORWARD = 0 }; - - /** - * @brief query profile result - * - * @return std::chrono::time_point profile result - */ - std::chrono::milliseconds result(const int &key) { return time_taken[key]; } - - /** - * @brief start profile - * - * @param key to record the profile result. Either designated key from enum - * or arbitrary key can be used - */ - void start(const int &key) { - /// @todo: check if key is being reused with time_taken - start_time[key] = std::chrono::steady_clock::now(); - } - - /** - * @brief end profile - * - * @param key to record the profile result. Either designated key from enum - * or arbitrary key can be used - */ - void end(const int &key) { - auto end = std::chrono::steady_clock::now(); - auto iter = start_time.find(key); - - if (iter == start_time.end()) { - throw std::invalid_argument("profiler hasn't started with the key"); - } - - time_taken[key] = std::chrono::duration_cast( - end - iter->second); - } - - private: - std::unordered_map> - start_time; /**< start_time of the clock */ - std::unordered_map time_taken; - }; - -public: - /** - * @brief Get the Profile Result - * - * @param key key to recorder the profile - * @return std::chrono::time_point - */ - std::chrono::milliseconds getProfileResult(const int &key) { - return profiler.result(key); - } - -private: - Profiler profiler; -#endif - private: /** * @brief Print Options when printing layer info -- 2.34.1