Update counter maps sanely

operator[] default-constructs the map value if no value exists
for that key. Default-construction of int yields a zero. So all
the manual faffing around is just unnecessary.


[ROCm/clr commit: cecc0782ef]
이 커밋은 다음에 포함됨:
Chris Kitching가 2017-10-27 20:12:32 +01:00를 커밋했습니다
1 부모 b89133c2d4
커밋 0b45e8d905
1 파일이 변경됨
+3 -12
+3 -12
파일 보기
@@ -181,18 +181,9 @@ protected:
map = cuda2hipUnconverted;
mapTotal = cuda2hipUnconvertedTotal;
}
auto found = map.find(cudaName);
if (found == map.end()) {
map.insert(std::pair<std::string, uint64_t>(cudaName, 1));
} else {
found->second++;
}
auto foundT = mapTotal.find(cudaName);
if (foundT == mapTotal.end()) {
mapTotal.insert(std::pair<std::string, uint64_t>(cudaName, 1));
} else {
foundT->second++;
}
map[cudaName]++;
mapTotal[cudaName]++;
}
virtual void updateCounters(const hipCounter &counter, const std::string &cudaName) {