[clang] [clang-repl] Initialized HIP environment for clang-repl (PR #217582)

Yaxun Liu via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 28 12:45:56 PDT 2026


================
@@ -303,19 +303,16 @@ IncrementalCompilerBuilder::CreateCpp() {
 }
 
 llvm::Expected<std::unique_ptr<CompilerInstance>>
-IncrementalCompilerBuilder::createCuda(bool device) {
+IncrementalCompilerBuilder::createOffload(bool HipEnabled, bool device) {
   std::vector<const char *> Argv;
   Argv.reserve(5 + 4 + UserArgs.size());
+  Argv.push_back(HipEnabled ? "-xhip" : "-xcuda");
+  Argv.push_back(device ? "--cuda-device-only" : "--cuda-host-only");
----------------
yxsamliu wrote:

The host-only and device-only driver calls have different arguments, so they may generate different CUIDs. HIP uses the CUID in some host and device symbol names, which must match. Could we generate one session CUID and pass the same `-cuid=` value to both compiler instances?

https://github.com/llvm/llvm-project/pull/217582


More information about the cfe-commits mailing list