Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
HectorSVC committed Nov 27, 2023
1 parent 04bebe1 commit 6beeab5
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions onnxruntime/core/providers/qnn/builder/qnn_backend_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -959,25 +959,24 @@ Status QnnBackendManager::ExtractProfilingEventExtended(
}

const std::string& QnnBackendManager::GetUnitString(QnnProfile_EventUnit_t unitType) {
const auto& unitStringMap = GetUnitStringMap();
auto it = unitStringMap.find(unitType);
if (it != unitStringMap.end()) {
return it->second;
}
static const std::string unknown = "UNKNOWN";
return unknown;
const auto& unitStringMap = GetUnitStringMap();
auto it = unitStringMap.find(unitType);
if (it != unitStringMap.end()) {
return it->second;
}
static const std::string unknown = "UNKNOWN";
return unknown;
}

const std::unordered_map<QnnProfile_EventUnit_t, std::string>& QnnBackendManager::GetUnitStringMap() {
static const std::unordered_map<QnnProfile_EventUnit_t, std::string> unitStringMap = {
{QNN_PROFILE_EVENTUNIT_MICROSEC, "US"},
{QNN_PROFILE_EVENTUNIT_BYTES, "BYTES"},
{QNN_PROFILE_EVENTUNIT_CYCLES, "CYCLES"},
{QNN_PROFILE_EVENTUNIT_COUNT, "COUNT"},
{QNN_PROFILE_EVENTUNIT_OBJECT, "OBJECT"},
{QNN_PROFILE_EVENTUNIT_BACKEND, "BACKEND"}
};
return unitStringMap;
static const std::unordered_map<QnnProfile_EventUnit_t, std::string> unitStringMap = {

Check warning on line 972 in onnxruntime/core/providers/qnn/builder/qnn_backend_manager.cc

View workflow job for this annotation

GitHub Actions / Lint C++

[cpplint] reported by reviewdog 🐶 Add #include <unordered_map> for unordered_map<> [build/include_what_you_use] [4] Raw Output: onnxruntime/core/providers/qnn/builder/qnn_backend_manager.cc:972: Add #include <unordered_map> for unordered_map<> [build/include_what_you_use] [4]
{QNN_PROFILE_EVENTUNIT_MICROSEC, "US"},
{QNN_PROFILE_EVENTUNIT_BYTES, "BYTES"},
{QNN_PROFILE_EVENTUNIT_CYCLES, "CYCLES"},
{QNN_PROFILE_EVENTUNIT_COUNT, "COUNT"},
{QNN_PROFILE_EVENTUNIT_OBJECT, "OBJECT"},
{QNN_PROFILE_EVENTUNIT_BACKEND, "BACKEND"}};
return unitStringMap;
}

const std::string QnnBackendManager::GetEventTypeString(QnnProfile_EventType_t eventType) {
Expand Down

0 comments on commit 6beeab5

Please sign in to comment.