OffTarget

Observed issues › cce-acc-routine-bind-module-ice

Appears to behave incorrectlyCompiler crash · Fortran · OpenACC · Open

ftn -h acc: internal compiler error "Object DEV_VAL is host associated to itself" for routine bind between two module procedures

Legality: independently confirmed. 2 independent readings find the program legal and the result required. How this is checked

Affected variants

CompilerMI300A gfx942
unified memory (XNACK 1)
MI300A gfx942
copy (XNACK 0)
MI250X gfx90a
copy (XNACK 0)
MI300X gfx942
copy (XNACK 0)
MI350X gfx950
copy (XNACK 0)
A100 sm_80
separate memory
A100 sm_80
managed memory
AFAR 24.3.0n/an/an/an/an/an/an/a
CCE 19.0.0behaves incorrectlybehaves incorrectlybehaves incorrectlyunknown
not run
unknown
not run
n/an/a
CCE 20.0.2behaves incorrectlybehaves incorrectlybehaves incorrectlyunknown
not run
unknown
not run
n/an/a
CCE 21.0.3behaves incorrectlybehaves incorrectlybehaves incorrectlyunknown
not run
unknown
not run
n/an/a
CCE 21.0.4behaves incorrectlybehaves incorrectlybehaves incorrectlyunknown
not run
unknown
not run
n/an/a
NVHPC 25.11n/an/an/an/an/acorrectcorrect
NVHPC 26.9n/an/an/an/an/acorrectcorrect
GCC 16.2.0fails another wayfails another wayfails another wayfails another wayfails another wayfails another wayn/a

"behaves incorrectly" / "not supported": this issue, confirmed in up to four environments (another build directory, another node, a repeat). "fails another way": a different failure, not counted as this issue. "unknown": not run there, or the runs disagree.

Messages

ResultCompiler and GPUMessage
behaves incorrectlyCCE 19.0.0, MI300A unified
CCE 19.0.0, MI300A copy
CCE 19.0.0, MI250X
show
Warning:
 Headers and libraries from cray-libsci/25.03.0 will be ignored because depends on PE_MPICH which is unavailable..
ftn-72 ftn: INTERNAL HOST_VAL, File = cce-acc-routine-bind-module-ice.f90, Line = 4, Column = 20 
  Object "DEV_VAL" is host associated to itself.  Attr index is 587.
behaves incorrectlyCCE 20.0.2, MI300A unified
CCE 20.0.2, MI300A copy
CCE 20.0.2, MI250X
show
Warning:
 Headers and libraries from cray-libsci/25.09.0 will be ignored because depends on PE_MPICH which is unavailable..
ftn-72 ftn: INTERNAL HOST_VAL, File = cce-acc-routine-bind-module-ice.f90, Line = 4, Column = 20 
  Object "DEV_VAL" is host associated to itself.  Attr index is 590.
behaves incorrectlyCCE 21.0.3, MI300A unified
CCE 21.0.3, MI300A copy
CCE 21.0.3, MI250X
CCE 21.0.4, MI300A unified
CCE 21.0.4, MI300A copy
CCE 21.0.4, MI250X
show
Warning:
 Headers and libraries from cray-libsci/26.03.0 will be ignored because depends on PE_MPICH which is unavailable..
ftn-72 ftn: INTERNAL HOST_VAL, File = cce-acc-routine-bind-module-ice.f90, Line = 4, Column = 20 
  Object "DEV_VAL" is host associated to itself.  Attr index is 590.
fails another wayGCC 16.2.0, MI300A unified
GCC 16.2.0, MI300A copy
GCC 16.2.0, MI250X
GCC 16.2.0, MI300X
GCC 16.2.0, MI350X
GCC 16.2.0, A100 separate
show
cce-acc-routine-bind-module-ice.f90:10:23:
   10 |     !$acc routine seq bind(dev_val)
      |                       1
Error: Failed to match clause at (1)
cce-acc-routine-bind-module-ice.f90:17:7:
   17 |   use m
      |       1
Fatal Error: Cannot open module file ‘m.mod’ for reading at (1): No such file or directory

Reproduce

CCE 19.0.0, MI300A unified

module load cce/19.0.0 craype-accel-amd-gfx942 rocm/6.4.3
module unload cray-mpich
ftn -h acc -O2 repro.f90 -o repro
HSA_XNACK=1 ./repro

CCE 20.0.2, MI300A unified

module load cce/20.0.2 craype-accel-amd-gfx942 rocm/6.4.3
module unload cray-mpich
ftn -h acc -O2 repro.f90 -o repro
HSA_XNACK=1 ./repro

CCE 21.0.3, MI300A unified

module load cce/21.0.3 craype-accel-amd-gfx942 rocm/7.2.0
module unload cray-mpich
ftn -h acc -O2 repro.f90 -o repro
HSA_XNACK=1 ./repro

CCE 21.0.4, MI300A unified

module load cce/21.0.4 craype-accel-amd-gfx942 rocm/7.2.0
module unload cray-mpich
ftn -h acc -O2 repro.f90 -o repro
HSA_XNACK=1 ./repro

NVHPC 25.11, A100 separate (runs correctly)

export LD_LIBRARY_PATH=$NVHPC_25_11/compilers/lib
nvfortran -acc=gpu -gpu=cc80 -gpu=mem:separate -O2 repro.f90 -o repro
./repro
Program (28 lines)
! OpenACC 3.4 §2.15.1 (routine bind): host_val is called on the device under
! the name dev_val. Legal. Expected output: 3 5 7 9 11 13 15 17
! (dev_val(x) = 2*x + 1). Compile: ftn -h acc -O2.
module m
  implicit none
contains
  integer function dev_val(x)
    !$acc routine seq
    integer, intent(in) :: x
    dev_val = 2*x + 1
  end function dev_val
  integer function host_val(x)
    !$acc routine seq bind(dev_val)
    integer, intent(in) :: x
    host_val = -x
  end function host_val
end module m

program t
  use m
  implicit none
  integer :: b(8), i
  !$acc parallel loop copyout(b)
  do i = 1, 8
    b(i) = host_val(i)
  end do
  print *, b
end program t

Source in the repository

Something to add? Dispute its legality · Report it fixed in a newer release · Report a mistake on this page

Expected and observed

Observed where it behaves incorrectly

Warning:
 Headers and libraries from cray-libsci/25.03.0 will be ignored because depends on PE_MPICH which is unavailable..
ftn-72 ftn: INTERNAL HOST_VAL, File = cce-acc-routine-bind-module-ice.f90, Line = 4, Column = 20 
  Object "DEV_VAL" is host associated to itself.  Attr index is 587.

What the specification requires

The specification text this program relies on and the compiler is expected to support.

OpenACC 3.4 §2.15.1

Evidence

Same compiler, one change

  • the two functions as external procedures instead of module procedures: CCE 19.0.0: correct; CCE 20.0.2: correct; CCE 21.0.3: correct; CCE 21.0.4: correct
    Control program
    integer function dev_val(x)
      !$acc routine seq
      integer, intent(in) :: x
      dev_val = 2*x + 1
    end function dev_val
    integer function host_val(x)
      !$acc routine seq bind(dev_val)
      integer, intent(in) :: x
      host_val = -x
    end function host_val
    
    program t
      implicit none
      interface
        integer function host_val(x)
          !$acc routine seq bind(dev_val)
          integer, intent(in) :: x
        end function host_val
      end interface
      integer :: b(8), i
      !$acc parallel loop copyout(b)
      do i = 1, 8
        b(i) = host_val(i)
      end do
      print *, b
    end program t
    

Other compilers run it correctly

NVHPC 25.11, NVHPC 26.9