diff --git a/projects/clr/hipamd/hipify-clang/src/Cuda2Hip.cpp b/projects/clr/hipamd/hipify-clang/src/Cuda2Hip.cpp index d36e2ba6bf..4a2dc58f4d 100644 --- a/projects/clr/hipamd/hipify-clang/src/Cuda2Hip.cpp +++ b/projects/clr/hipamd/hipify-clang/src/Cuda2Hip.cpp @@ -4225,20 +4225,14 @@ int main(int argc, const char **argv) { } for (const auto & src : fileSources) { if (dst.empty()) { - dst = src; - if (!Inplace) { - size_t pos = dst.rfind("."); - if (pos != std::string::npos && pos + 1 < dst.size()) { - dst = dst.substr(0, pos) + ".hip." + dst.substr(pos + 1, dst.size() - pos - 1); - } else { - dst += ".hip.cu"; - } - } - } else { if (Inplace) { - llvm::errs() << "[HIPIFY] conflict: both -o and -inplace options are specified.\n"; - return 1; + dst = src; + } else { + dst = src + ".hip"; } + } else if (Inplace) { + llvm::errs() << "[HIPIFY] conflict: both -o and -inplace options are specified.\n"; + return 1; } std::string tmpFile = src + ".hipify-tmp";