================ @@ -6405,7 +6424,12 @@ const ToolChain &Driver::getToolChain(const ArgList &Args, TC = std::make_unique<toolchains::NVPTXToolChain>(*this, Target, Args); break; case llvm::Triple::AMDHSA: - TC = std::make_unique<toolchains::ROCMToolChain>(*this, Target, Args); + TC = + llvm::any_of(Inputs, + [](auto &Input) { return types::isOpenCL(Input.first); }) + ? std::make_unique<toolchains::ROCMToolChain>(*this, Target, Args) ---------------- yxsamliu wrote:
If input files have mixed OpenCL and C/C++ programs, ROCMToolChain will be chosen. Is ROCmToolChain is able to compile C/C++ programs like AMDGPUToolChain, or it will cause errors? Should we emit diagnostic message that mixed OpenCL and C/C++ programs are not supported? https://github.com/llvm/llvm-project/pull/99687 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits