Skip to content

Commit f938e5f

Browse files
committed
gdb.rocm: replace hipcc with amdclang++ as the HIP compiler
1 parent 39b5e43 commit f938e5f

81 files changed

Lines changed: 182 additions & 134 deletions

File tree

Some content is hidden

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

gdb/doc/gdb.texinfo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29155,7 +29155,7 @@ to compile a HIP program that can utilize ``Vega 10'' and ``Vega 7nm''
2915529155
@acronym{AMD GPU} devices, with no optimization:
2915629156

2915729157
@smallexample
29158-
hipcc -O0 -g --offload-arch=gfx900 --offload-arch=gfx906 bit_extract.cpp -o bit_extract
29158+
amdclang++ -x hip --hip-link -O0 -g --offload-arch=gfx900 --offload-arch=gfx906 bit_extract.cpp -o bit_extract
2915929159
@end smallexample
2916029160

2916129161
The @acronym{AMD ROCm} compiler maps HIP source language device

gdb/testsuite/boards/hip.exp

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# along with this program. If not, see <http://www.gnu.org/licenses/>.
1616

1717
# This file is a dejagnu "board file" and is used to run the testsuite
18-
# against C/C++ device code compiled with hipcc.
18+
# against C/C++ device code compiled with amdclang++ (HIP).
1919
#
2020
# Example usage:
2121
# bash$ make check RUNTESTFLAGS='--target_board=hip'
@@ -80,8 +80,8 @@ load_lib rocm.exp
8080
load_generic_config "unix"
8181
process_multilib_options ""
8282

83-
set_board_info compiler [find_hipcc]
84-
set_board_info c++compiler [find_hipcc]
83+
set_board_info compiler [find_hip_compiler]
84+
set_board_info c++compiler [find_hip_compiler]
8585

8686
set_board_info gdb,cannot_call_functions 1
8787

@@ -149,10 +149,15 @@ proc skip_opencl_tests {} {
149149
# Yup, we don't want to run the gdb.rocm/ tests against this board.
150150
# That would be kind of recursive. Those tests really expect that
151151
# "main()" is host code and start kernels themselves.
152-
proc allow_hipcc_tests {} {
152+
proc allow_hip_tests {} {
153153
return 0
154154
}
155155

156+
# Backwards compatibility alias.
157+
proc allow_hipcc_tests {} {
158+
return [allow_hip_tests]
159+
}
160+
156161
# Override this to fail faster. If we let the default run, tests
157162
# compile successfully, but fail at link time.
158163
proc gdb_compile_pthreads {source dest type options} {
@@ -271,10 +276,10 @@ proc gdb_compile {source dest type options} {
271276

272277
# We need:
273278
#
274-
# . explicit -O0, because hipcc optimizes by default.
279+
# . explicit -O0, because the HIP compiler optimizes by default.
275280
#
276-
# . -std=gnu++11 because hipcc defaults to -std=c++11, and
277-
# some testcases assume GNU extensions.
281+
# . -std=gnu++11 because the HIP compiler defaults to -std=c++11,
282+
# and some testcases assume GNU extensions.
278283
#
279284
# . -fgpu-rdc enables separate compilation mode, so we can
280285
# compile the kernel from multiple translation units.
@@ -303,7 +308,7 @@ proc gdb_compile {source dest type options} {
303308
} elseif {[info exists CC_FOR_TARGET]} {
304309
set compiler $CC_FOR_TARGET
305310
}
306-
if {[string first "hipcc" $compiler] != -1} {
311+
if {[string first "amdclang++" $compiler] != -1} {
307312

308313
# Remove "c++" from the options when linking, otherwise we
309314
# would get:

gdb/testsuite/gdb.perf/rocm-break-cond-false.exp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
load_lib rocm.exp
2323
load_lib perftest.exp
2424

25-
require allow_hipcc_tests
25+
require allow_hip_tests
2626

2727
standard_testfile .cpp
2828

gdb/testsuite/gdb.rocm/addr-bp-gpu-no-deb-info.exp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ load_lib rocm.exp
2020

2121
standard_testfile .cpp
2222

23-
require allow_hipcc_tests
23+
require allow_hip_tests
2424

2525
if {[build_executable "failed to prepare" $testfile $srcfile {hip}]} {
2626
return

gdb/testsuite/gdb.rocm/alu-exceptions.exp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
load_lib rocm.exp
2323

24-
require allow_hipcc_tests
24+
require allow_hip_tests
2525

2626
standard_testfile .cpp
2727

gdb/testsuite/gdb.rocm/aspace-user-input.exp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
load_lib rocm.exp
2323

24-
require allow_hipcc_tests
24+
require allow_hip_tests
2525

2626
standard_testfile bit-extract.cpp
2727

gdb/testsuite/gdb.rocm/aspace-watchpoint.exp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
load_lib rocm.exp
2626

27-
require allow_hipcc_tests
27+
require allow_hip_tests
2828

2929
standard_testfile .cpp
3030

gdb/testsuite/gdb.rocm/bit-extract.exp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
load_lib rocm.exp
2020

21-
require allow_hipcc_tests
21+
require allow_hip_tests
2222

2323
standard_testfile .cpp
2424

gdb/testsuite/gdb.rocm/branch-fault.exp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
load_lib rocm.exp
2323

24-
require allow_hipcc_tests
24+
require allow_hip_tests
2525

2626
standard_testfile .cpp
2727

gdb/testsuite/gdb.rocm/break-kernel-no-debug-info.exp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ load_lib rocm.exp
2525

2626
standard_testfile .cpp
2727

28-
require allow_hipcc_tests
28+
require allow_hip_tests
2929

3030
# Build for hip, explicitly without debug infos
3131
if {[build_executable "failed to prepare" $testfile $srcfile {hip nodebug}]} {

0 commit comments

Comments
 (0)