diff --git a/projects/hip/hipify-clang/src/Cuda2Hip.cpp b/projects/hip/hipify-clang/src/Cuda2Hip.cpp index af44f84ba2..5c3e41d58d 100644 --- a/projects/hip/hipify-clang/src/Cuda2Hip.cpp +++ b/projects/hip/hipify-clang/src/Cuda2Hip.cpp @@ -174,24 +174,16 @@ protected: llvm::errs() << "[HIPIFY] " << getMsgType(msgType) << ": " << mainFileName << ":" << fullSL.getExpansionLineNumber() << ":" << fullSL.getExpansionColumnNumber() << ": " << message << "\n"; } - void updateCountersExt(const hipCounter &counter, const std::string &cudaName) { + virtual void updateCounters(const hipCounter &counter, const std::string &cudaName) { + if (!PrintStats) { + return; + } + std::map& map = cuda2hipConverted; std::map& mapTotal = cuda2hipConvertedTotal; if (counter.unsupported) { map = cuda2hipUnconverted; mapTotal = cuda2hipUnconvertedTotal; - } - - map[cudaName]++; - mapTotal[cudaName]++; - } - - virtual void updateCounters(const hipCounter &counter, const std::string &cudaName) { - if (!PrintStats) { - return; - } - updateCountersExt(counter, cudaName); - if (counter.unsupported) { countRepsUnsupported[counter.countType]++; countRepsTotalUnsupported[counter.countType]++; countApiRepsUnsupported[counter.countApiType]++; @@ -202,6 +194,9 @@ protected: countApiReps[counter.countApiType]++; countApiRepsTotal[counter.countApiType]++; } + + map[cudaName]++; + mapTotal[cudaName]++; } void processString(StringRef s, SourceManager &SM, SourceLocation start) {