From 06389cededeb6e28a2c716f02d5a5d2c771fb3a7 Mon Sep 17 00:00:00 2001 From: Valentin Clement Date: Fri, 29 Aug 2025 11:26:54 -0700 Subject: [PATCH 1/2] [flang-rt] Set gpu_sources when FLANG_RT_EXPERIMENTAL_OFFLOAD_SUPPORT=CUDA --- flang-rt/lib/runtime/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flang-rt/lib/runtime/CMakeLists.txt b/flang-rt/lib/runtime/CMakeLists.txt index dc2db1d9902cb..0f12b9f3ae9ae 100644 --- a/flang-rt/lib/runtime/CMakeLists.txt +++ b/flang-rt/lib/runtime/CMakeLists.txt @@ -175,7 +175,7 @@ else () set(f128_sources "") endif () -if ("${LLVM_RUNTIMES_TARGET}" MATCHES "^amdgcn|^nvptx") +if ("${LLVM_RUNTIMES_TARGET}" MATCHES "^amdgcn|^nvptx" OR FLANG_RT_EXPERIMENTAL_OFFLOAD_SUPPORT STREQUAL "CUDA") set(sources ${gpu_sources}) else () set(sources ${supported_sources} ${host_sources} ${f128_sources}) From eca0e428de8a1e12556368cb71c08bd7ef026435 Mon Sep 17 00:00:00 2001 From: Valentin Clement Date: Fri, 29 Aug 2025 11:53:43 -0700 Subject: [PATCH 2/2] Set supported_sources for CUDA --- flang-rt/lib/runtime/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/flang-rt/lib/runtime/CMakeLists.txt b/flang-rt/lib/runtime/CMakeLists.txt index 0f12b9f3ae9ae..e8f70bd544e0b 100644 --- a/flang-rt/lib/runtime/CMakeLists.txt +++ b/flang-rt/lib/runtime/CMakeLists.txt @@ -175,8 +175,10 @@ else () set(f128_sources "") endif () -if ("${LLVM_RUNTIMES_TARGET}" MATCHES "^amdgcn|^nvptx" OR FLANG_RT_EXPERIMENTAL_OFFLOAD_SUPPORT STREQUAL "CUDA") +if ("${LLVM_RUNTIMES_TARGET}" MATCHES "^amdgcn|^nvptx") set(sources ${gpu_sources}) +elseif(FLANG_RT_EXPERIMENTAL_OFFLOAD_SUPPORT STREQUAL "CUDA") + set(sources ${supported_sources}) else () set(sources ${supported_sources} ${host_sources} ${f128_sources}) endif ()