Skip to content

Commit a27ab3f

Browse files
[Flang][AMDGPU] Add rocm-path flag (#88190)
ROCm installation path is used for finding and automatically linking required bitcode libraries for OpenMP AMDGPU offload. Reported issue: #82553
1 parent 986d0db commit a27ab3f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+22
-1
lines changed

clang/include/clang/Driver/Options.td

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1341,7 +1341,8 @@ def hip_link : Flag<["--"], "hip-link">, Group<opencl_Group>,
13411341
HelpText<"Link clang-offload-bundler bundles for HIP">;
13421342
def no_hip_rt: Flag<["-"], "no-hip-rt">, Group<hip_Group>,
13431343
HelpText<"Do not link against HIP runtime libraries">;
1344-
def rocm_path_EQ : Joined<["--"], "rocm-path=">, Group<hip_Group>,
1344+
def rocm_path_EQ : Joined<["--"], "rocm-path=">,
1345+
Visibility<[FlangOption]>, Group<hip_Group>,
13451346
HelpText<"ROCm installation path, used for finding and automatically linking required bitcode libraries.">;
13461347
def hip_path_EQ : Joined<["--"], "hip-path=">, Group<hip_Group>,
13471348
HelpText<"HIP runtime installation path, used for finding HIP version and adding HIP include path.">;

flang/test/Driver/Inputs/rocm/amdgcn/bitcode-no-abi-ver/asanrtl.bc

Whitespace-only changes.

flang/test/Driver/Inputs/rocm/amdgcn/bitcode-no-abi-ver/hip.bc

Whitespace-only changes.

flang/test/Driver/Inputs/rocm/amdgcn/bitcode-no-abi-ver/ockl.bc

Whitespace-only changes.

flang/test/Driver/Inputs/rocm/amdgcn/bitcode-no-abi-ver/oclc_correctly_rounded_sqrt_off.bc

Whitespace-only changes.

flang/test/Driver/Inputs/rocm/amdgcn/bitcode-no-abi-ver/oclc_correctly_rounded_sqrt_on.bc

Whitespace-only changes.

flang/test/Driver/Inputs/rocm/amdgcn/bitcode-no-abi-ver/oclc_daz_opt_off.bc

Whitespace-only changes.

flang/test/Driver/Inputs/rocm/amdgcn/bitcode-no-abi-ver/oclc_daz_opt_on.bc

Whitespace-only changes.

flang/test/Driver/Inputs/rocm/amdgcn/bitcode-no-abi-ver/oclc_finite_only_off.bc

Whitespace-only changes.

flang/test/Driver/Inputs/rocm/amdgcn/bitcode-no-abi-ver/oclc_finite_only_on.bc

Whitespace-only changes.

flang/test/Driver/Inputs/rocm/amdgcn/bitcode-no-abi-ver/oclc_isa_version_1010.bc

Whitespace-only changes.

flang/test/Driver/Inputs/rocm/amdgcn/bitcode-no-abi-ver/oclc_isa_version_1011.bc

Whitespace-only changes.

flang/test/Driver/Inputs/rocm/amdgcn/bitcode-no-abi-ver/oclc_isa_version_1012.bc

Whitespace-only changes.

flang/test/Driver/Inputs/rocm/amdgcn/bitcode-no-abi-ver/oclc_isa_version_803.bc

Whitespace-only changes.

flang/test/Driver/Inputs/rocm/amdgcn/bitcode-no-abi-ver/oclc_isa_version_900.bc

Whitespace-only changes.

flang/test/Driver/Inputs/rocm/amdgcn/bitcode-no-abi-ver/oclc_isa_version_908.bc

Whitespace-only changes.

flang/test/Driver/Inputs/rocm/amdgcn/bitcode-no-abi-ver/oclc_unsafe_math_off.bc

Whitespace-only changes.

flang/test/Driver/Inputs/rocm/amdgcn/bitcode-no-abi-ver/oclc_unsafe_math_on.bc

Whitespace-only changes.

flang/test/Driver/Inputs/rocm/amdgcn/bitcode-no-abi-ver/oclc_wavefrontsize64_off.bc

Whitespace-only changes.

flang/test/Driver/Inputs/rocm/amdgcn/bitcode-no-abi-ver/oclc_wavefrontsize64_on.bc

Whitespace-only changes.

flang/test/Driver/Inputs/rocm/amdgcn/bitcode-no-abi-ver/ocml.bc

Whitespace-only changes.

flang/test/Driver/Inputs/rocm/amdgcn/bitcode-no-abi-ver/opencl.bc

Whitespace-only changes.

flang/test/Driver/Inputs/rocm/amdgcn/bitcode/asanrtl.bc

Whitespace-only changes.

flang/test/Driver/Inputs/rocm/amdgcn/bitcode/hip.bc

Whitespace-only changes.

flang/test/Driver/Inputs/rocm/amdgcn/bitcode/ockl.bc

Whitespace-only changes.

flang/test/Driver/Inputs/rocm/amdgcn/bitcode/oclc_abi_version_400.bc

Whitespace-only changes.

flang/test/Driver/Inputs/rocm/amdgcn/bitcode/oclc_abi_version_500.bc

Whitespace-only changes.

flang/test/Driver/Inputs/rocm/amdgcn/bitcode/oclc_abi_version_600.bc

Whitespace-only changes.

flang/test/Driver/Inputs/rocm/amdgcn/bitcode/oclc_correctly_rounded_sqrt_off.bc

Whitespace-only changes.

flang/test/Driver/Inputs/rocm/amdgcn/bitcode/oclc_correctly_rounded_sqrt_on.bc

Whitespace-only changes.

flang/test/Driver/Inputs/rocm/amdgcn/bitcode/oclc_daz_opt_off.bc

Whitespace-only changes.

flang/test/Driver/Inputs/rocm/amdgcn/bitcode/oclc_daz_opt_on.bc

Whitespace-only changes.

flang/test/Driver/Inputs/rocm/amdgcn/bitcode/oclc_finite_only_off.bc

Whitespace-only changes.

flang/test/Driver/Inputs/rocm/amdgcn/bitcode/oclc_finite_only_on.bc

Whitespace-only changes.

flang/test/Driver/Inputs/rocm/amdgcn/bitcode/oclc_isa_version_1010.bc

Whitespace-only changes.

flang/test/Driver/Inputs/rocm/amdgcn/bitcode/oclc_isa_version_1011.bc

Whitespace-only changes.

flang/test/Driver/Inputs/rocm/amdgcn/bitcode/oclc_isa_version_1012.bc

Whitespace-only changes.

flang/test/Driver/Inputs/rocm/amdgcn/bitcode/oclc_isa_version_803.bc

Whitespace-only changes.

flang/test/Driver/Inputs/rocm/amdgcn/bitcode/oclc_isa_version_900.bc

Whitespace-only changes.

flang/test/Driver/Inputs/rocm/amdgcn/bitcode/oclc_isa_version_908.bc

Whitespace-only changes.

flang/test/Driver/Inputs/rocm/amdgcn/bitcode/oclc_unsafe_math_off.bc

Whitespace-only changes.

flang/test/Driver/Inputs/rocm/amdgcn/bitcode/oclc_unsafe_math_on.bc

Whitespace-only changes.

flang/test/Driver/Inputs/rocm/amdgcn/bitcode/oclc_wavefrontsize64_off.bc

Whitespace-only changes.

flang/test/Driver/Inputs/rocm/amdgcn/bitcode/oclc_wavefrontsize64_on.bc

Whitespace-only changes.

flang/test/Driver/Inputs/rocm/amdgcn/bitcode/ocml.bc

Whitespace-only changes.

flang/test/Driver/Inputs/rocm/amdgcn/bitcode/opencl.bc

Whitespace-only changes.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Auto-generated by cmake
2+
# NOTE: The trailing whitespace is added on purpose to verify that these
3+
# whitespaces are trimmed before paring.
4+
HIP_VERSION_MAJOR=3
5+
HIP_VERSION_MINOR=6
6+
HIP_VERSION_PATCH=20214-a2917cd

flang/test/Driver/Inputs/rocm/include/hip/hip_runtime.h

Whitespace-only changes.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Auto-generated by cmake
2+
# NOTE: The trailing whitespace is added on purpose to verify that these
3+
# whitespaces are trimmed before paring.
4+
HIP_VERSION_MAJOR=3
5+
HIP_VERSION_MINOR=6
6+
HIP_VERSION_PATCH=20214-a2917cd

flang/test/Driver/driver-help-hidden.f90

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@
148148
! CHECK-NEXT: -pthread Support POSIX threads in generated code
149149
! CHECK-NEXT: -P Disable linemarker output in -E mode
150150
! CHECK-NEXT: -resource-dir <value> The directory which holds the compiler resource files
151+
! CHECK-NEXT: --rocm-path=<value> ROCm installation path, used for finding and automatically linking required bitcode libraries.
151152
! CHECK-NEXT: -Rpass-analysis=<value> Report transformation analysis from optimization passes whose name matches the given POSIX regular expression
152153
! CHECK-NEXT: -Rpass-missed=<value> Report missed transformations by optimization passes whose name matches the given POSIX regular expression
153154
! CHECK-NEXT: -Rpass=<value> Report transformations performed by optimization passes whose name matches the given POSIX regular expression

flang/test/Driver/driver-help.f90

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@
135135
! HELP-NEXT: -print-target-triple Print the normalized target triple
136136
! HELP-NEXT: -pthread Support POSIX threads in generated code
137137
! HELP-NEXT: -P Disable linemarker output in -E mode
138+
! HELP-NEXT: --rocm-path=<value> ROCm installation path, used for finding and automatically linking required bitcode libraries.
138139
! HELP-NEXT: -Rpass-analysis=<value> Report transformation analysis from optimization passes whose name matches the given POSIX regular expression
139140
! HELP-NEXT: -Rpass-missed=<value> Report missed transformations by optimization passes whose name matches the given POSIX regular expression
140141
! HELP-NEXT: -Rpass=<value> Report transformations performed by optimization passes whose name matches the given POSIX regular expression

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,3 +201,9 @@
201201
! RUN: -nogpulibc %s 2>&1 \
202202
! RUN: | FileCheck --check-prefix=NO-LIBC-GPU-AMDGPU %s
203203
! NO-LIBC-GPU-AMDGPU-NOT: "-lcgpu-amdgpu"
204+
205+
! RUN: %flang -### -v --target=x86_64-unknown-linux-gnu -fopenmp \
206+
! RUN: --offload-arch=gfx900 \
207+
! RUN: --rocm-path=%S/Inputs/rocm %s 2>&1 \
208+
! RUN: | FileCheck --check-prefix=ROCM-PATH %s
209+
! ROCM-PATH: Found HIP installation: {{.*Inputs.*rocm}}, version 3.6.20214-a2917cd

0 commit comments

Comments
 (0)