https://github.com/agozillon created https://github.com/llvm/llvm-project/pull/135307
Currently rocm-device-lib-path is not enabled for Flang, so when the compiler warns / requests a user to provide this option in cases where it can't find rocm a user cannot actually set the device libraries using rocm-device-lib-path. The alternative rocm_path that's also mentioned via the warning can be used, but we should enable both mentioned options to not confuse users (and myself). >From d322050a6038ebf3842526b5871254ec34b19164 Mon Sep 17 00:00:00 2001 From: agozillon <andrew.gozil...@amd.com> Date: Thu, 10 Apr 2025 22:03:00 -0500 Subject: [PATCH] [Flang][OpenMP][ROCM] Enable rocm-device-lib-path for flang Currently rocm-device-lib-path is not enabled for Flang, so when the compiler warns / requests a user to provide this option in cases where it can't find rocm a user cannot actually set the device libraries using rocm-device-lib-path. The alternative rocm_path that's also mentioned via the warning can be used, but we should enable both mentioned options to not confuse users (and myself) --- clang/include/clang/Driver/Options.td | 4 ++-- flang/test/Driver/omp-driver-offload.f90 | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td index 2ca5f99e4ca63..5ee43e4cfd91a 100644 --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -1340,8 +1340,8 @@ def hipstdpar_prim_path_EQ : Joined<["--"], "hipstdpar-prim-path=">, HelpText< "rocPrim path, required by the HIP Standard Parallel Algorithm " "Acceleration library, used to implicitly include the rocPrim library">; -def rocm_device_lib_path_EQ : Joined<["--"], "rocm-device-lib-path=">, Group<hip_Group>, - HelpText<"ROCm device library path. Alternative to rocm-path.">; +def rocm_device_lib_path_EQ : Joined<["--"], "rocm-device-lib-path=">, Visibility<[FlangOption]>, + Group<hip_Group>, HelpText<"ROCm device library path. Alternative to rocm-path.">; def : Joined<["--"], "hip-device-lib-path=">, Alias<rocm_device_lib_path_EQ>; def hip_device_lib_EQ : Joined<["--"], "hip-device-lib=">, Group<hip_Group>, HelpText<"HIP device library">; diff --git a/flang/test/Driver/omp-driver-offload.f90 b/flang/test/Driver/omp-driver-offload.f90 index a6e3b87a605d5..335bfad4b1884 100644 --- a/flang/test/Driver/omp-driver-offload.f90 +++ b/flang/test/Driver/omp-driver-offload.f90 @@ -181,6 +181,11 @@ ! RUN: | FileCheck --check-prefix=ROCM-PATH %s ! ROCM-PATH: Found HIP installation: {{.*Inputs.*rocm}}, version 3.6.20214-a2917cd +! RUN: %flang -### -target x86_64-pc-linux-gnu -fopenmp --offload-arch=gfx900 \ +! RUN: --rocm-device-lib-path=%S/Inputs/rocm/amdgcn/bitcode %s 2>&1 | \ +! RUN: FileCheck %s --check-prefix=ROCM-DEVICE-LIB +! ROCM-DEVICE-LIB: "-fc1" {{.*}}ocml.bc"{{.*}}oclc_daz_opt_off.bc"{{.*}}oclc_unsafe_math_off.bc"{{.*}}oclc_finite_only_off.bc"{{.*}}oclc_correctly_rounded_sqrt_on.bc"{{.*}}oclc_wavefrontsize64_on.bc"{{.*}}oclc_isa_version_900.bc" + ! Test -fopenmp-force-usm option without offload ! RUN: %flang -S -### %s -o %t 2>&1 \ ! RUN: -fopenmp -fopenmp-force-usm \ _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits