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]
Tá an tiomantas seo le fáil i:
1 tuismitheoir
b89133c2d4
tiomantas
0b45e8d905
1 comhad athraithe
+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) {
|
||||
|
||||
Tagairt in Eagrán Nua
Cuir bac ar úsáideoir