Home | History | Annotate | Line # | Download | only in gdb.rocm
      1 # Copyright 2022-2024 Free Software Foundation, Inc.
      2 
      3 # This file is part of GDB.
      4 
      5 # This program is free software; you can redistribute it and/or modify
      6 # it under the terms of the GNU General Public License as published by
      7 # the Free Software Foundation; either version 3 of the License, or
      8 # (at your option) any later version.
      9 
     10 # This program is distributed in the hope that it will be useful,
     11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
     12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     13 # GNU General Public License for more details.
     14 
     15 # You should have received a copy of the GNU General Public License
     16 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
     17 
     18 # Test showing the "amdgpu precise-memory" setting.
     19 
     20 load_lib rocm.exp
     21 
     22 require allow_hipcc_tests
     23 
     24 standard_testfile .cpp
     25 
     26 if {[build_executable "failed to prepare" $testfile $srcfile {debug hip}]} {
     27     return
     28 }
     29 
     30 proc do_test { } {
     31     clean_restart $::binfile
     32 
     33     with_rocm_gpu_lock {
     34 	if ![runto_main] {
     35 	    return
     36 	}
     37 
     38 	gdb_test "show amdgpu precise-memory" \
     39 	    "AMDGPU precise memory access reporting is off \\(currently disabled\\)." \
     40 	    "show precise-memory setting in CLI before"
     41 
     42 	if {[hip_devices_support_precise_memory]} {
     43 	    gdb_test_no_output "set amdgpu precise-memory on"
     44 	    set cli_effective_value "enabled"
     45 	} else {
     46 	    gdb_test "set amdgpu precise-memory on" \
     47 		"warning: AMDGPU precise memory access reporting could not be enabled."
     48 	    set cli_effective_value "disabled"
     49 	}
     50 
     51 	gdb_test "show amdgpu precise-memory" \
     52 	    "AMDGPU precise memory access reporting is on \\(currently ${cli_effective_value}\\)." \
     53 	    "show precise-memory setting in CLI after"
     54     }
     55 }
     56 
     57 do_test
     58