Skip to content

Commit 39f1190

Browse files
authored
[Flang][OpenMP][ROCM] Enable rocm-device-lib-path for flang (llvm#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).
1 parent cbba960 commit 39f1190

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

clang/include/clang/Driver/Options.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1341,8 +1341,8 @@ def hipstdpar_prim_path_EQ : Joined<["--"], "hipstdpar-prim-path=">,
13411341
HelpText<
13421342
"rocPrim path, required by the HIP Standard Parallel Algorithm "
13431343
"Acceleration library, used to implicitly include the rocPrim library">;
1344-
def rocm_device_lib_path_EQ : Joined<["--"], "rocm-device-lib-path=">, Group<hip_Group>,
1345-
HelpText<"ROCm device library path. Alternative to rocm-path.">;
1344+
def rocm_device_lib_path_EQ : Joined<["--"], "rocm-device-lib-path=">, Visibility<[FlangOption]>,
1345+
Group<hip_Group>, HelpText<"ROCm device library path. Alternative to rocm-path.">;
13461346
def : Joined<["--"], "hip-device-lib-path=">, Alias<rocm_device_lib_path_EQ>;
13471347
def hip_device_lib_EQ : Joined<["--"], "hip-device-lib=">, Group<hip_Group>,
13481348
HelpText<"HIP device library">;

flang/test/Driver/omp-driver-offload.f90

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,11 @@
181181
! RUN: | FileCheck --check-prefix=ROCM-PATH %s
182182
! ROCM-PATH: Found HIP installation: {{.*Inputs.*rocm}}, version 3.6.20214-a2917cd
183183

184+
! RUN: %flang -### -target x86_64-pc-linux-gnu -fopenmp --offload-arch=gfx900 \
185+
! RUN: --rocm-device-lib-path=%S/Inputs/rocm/amdgcn/bitcode %s 2>&1 | \
186+
! RUN: FileCheck %s --check-prefix=ROCM-DEVICE-LIB
187+
! 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"
188+
184189
! Test -fopenmp-force-usm option without offload
185190
! RUN: %flang -S -### %s -o %t 2>&1 \
186191
! RUN: -fopenmp -fopenmp-force-usm \

0 commit comments

Comments
 (0)