CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
112 lines
3.3 KiB
Plaintext
112 lines
3.3 KiB
Plaintext
# Copyright 2024 Free Software Foundation, Inc.
|
||
|
||
# This program is free software; you can redistribute it and/or modify
|
||
# it under the terms of the GNU General Public License as published by
|
||
# the Free Software Foundation; either version 3 of the License, or
|
||
# (at your option) any later version.
|
||
#
|
||
# This program is distributed in the hope that it will be useful,
|
||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
# GNU General Public License for more details.
|
||
#
|
||
# You should have received a copy of the GNU General Public License
|
||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||
|
||
# This test checks that a write watchpoint is reported to the debugger
|
||
# when the memory is modified by the last statement of a shader.
|
||
|
||
load_lib rocm.exp
|
||
|
||
require allow_hip_tests
|
||
# The debug behavior this test checks is not reliable with
|
||
# link-time optimization, so skip it for -flto builds.
|
||
require no_lto
|
||
|
||
standard_testfile .cpp
|
||
|
||
if {[build_executable "failed to prepare" $testfile $srcfile {debug hip}]} {
|
||
return
|
||
}
|
||
|
||
# This test is known to fail for some architectures when precise memory is
|
||
# not enabled. This proc finds out if the current target is expected to have
|
||
# a fail or not.
|
||
proc target_has_xfail {} {
|
||
# Check for targets where this test will fail without precise memory
|
||
set targets [find_amdgpu_devices]
|
||
if { [llength $targets] == 0} {
|
||
return 1
|
||
}
|
||
|
||
# The test will run on GPU-0, so it should be the first of the list.
|
||
set target [lindex $targets 0]
|
||
# Extract the target family by removing the last 2 chars from the target
|
||
# gfx number.
|
||
set target_family [string range $target 0 end-2]
|
||
verbose -log "Target family: $target_family"
|
||
return [expr {[lsearch -exact {gfx10 gfx11 gfx12} $target_family] != -1}]
|
||
}
|
||
|
||
proc do_test {precise_memory has_xfail} {
|
||
clean_restart $::binfile
|
||
|
||
with_rocm_gpu_lock {
|
||
if {![runto [gdb_get_line_number "Break here."] allow-pending]} {
|
||
return
|
||
}
|
||
|
||
gdb_test "p *v" "= 64"
|
||
gdb_test "watch -l *v" "Hardware watchpoint $::decimal: -location \\*v"
|
||
|
||
if {$precise_memory} {
|
||
# For architectures that does not support precise memory, a warning
|
||
# will be displayed.
|
||
gdb_test "set amdgpu precise-memory $precise_memory" \
|
||
"(warning: AMDGPU precise memory access reporting could not be enabled\\.)?"
|
||
}
|
||
|
||
if { !$precise_memory && $has_xfail } {
|
||
setup_xfail "*-*-*"
|
||
}
|
||
gdb_test "continue" \
|
||
[multi_line "Switching to \[^\r\n\]+(?=\r\n)" \
|
||
"" \
|
||
"Thread $::decimal \[^\r\n\]*hit Hardware watchpoint $::decimal: -location \\*v" \
|
||
"" \
|
||
"Old value = 64" \
|
||
"New value = 8" \
|
||
".*"]
|
||
}
|
||
}
|
||
|
||
set has_xfail [target_has_xfail]
|
||
|
||
# First check if we support precise-memory.
|
||
set supports_precise_memory 0
|
||
clean_restart $::binfile
|
||
with_rocm_gpu_lock {
|
||
if {![runto_main]} {
|
||
return
|
||
}
|
||
|
||
gdb_test_multiple "set amdgpu precise-memory on" "" {
|
||
-re -wrap "warning: AMDGPU precise memory access reporting could not be enabled\\." {
|
||
set supports_precise_memory 0
|
||
pass $gdb_test_name
|
||
}
|
||
-re -wrap "^" {
|
||
set supports_precise_memory 1
|
||
pass $gdb_test_name
|
||
}
|
||
}
|
||
}
|
||
|
||
foreach_with_prefix precise_memory {on off} {
|
||
if { $precise_memory && !$supports_precise_memory } {
|
||
unsupported "target does not support precise memory"
|
||
continue
|
||
}
|
||
do_test $precise_memory $has_xfail
|
||
}
|