Observed issues › fuzz/98-cce19
Appears to behave incorrectlyWrong answer · Fortran · OpenMP · Open
An array mapped tofrom next to defaultmap(firstprivate: aggregate) is not copied back (fuzz seed 98)
Legality: independently confirmed. 2 independent readings find the program legal and the result required. How this is checked
Affected variants
| Compiler | MI300A 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.0 | correct | correct | unknown not run | correct | correct | n/a | n/a |
| CCE 19.0.0 | behaves incorrectly | behaves incorrectly | unknown not run | unknown not run | unknown not run | n/a | n/a |
| CCE 20.0.2 | correct | correct | unknown not run | unknown not run | unknown not run | n/a | n/a |
| CCE 21.0.3 | correct | correct | unknown not run | unknown not run | unknown not run | n/a | n/a |
| CCE 21.0.4 | correct | correct | unknown not run | unknown not run | unknown not run | n/a | n/a |
| NVHPC 25.11 | n/a | n/a | n/a | n/a | n/a | behaves incorrectly | behaves incorrectly |
| NVHPC 26.9 | n/a | n/a | n/a | n/a | n/a | behaves incorrectly | behaves incorrectly |
| GCC 16.2.0 | correct | correct | correct | correct | correct | correct | n/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
| Result | Compiler and GPU | Message |
|---|---|---|
| behaves incorrectly | CCE 19.0.0, MI300A unified CCE 19.0.0, MI300A copy NVHPC 25.11, A100 separate NVHPC 25.11, A100 managed NVHPC 26.9, A100 separate NVHPC 26.9, A100 managed | showRESULT checksum=0 |
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 -fopenmp -O2 repro.f90 -o repro HSA_XNACK=1 OMP_TARGET_OFFLOAD=mandatory ./repro
NVHPC 25.11, A100 separate
export LD_LIBRARY_PATH=$NVHPC_25_11/compilers/lib nvfortran -mp=gpu -gpu=cc80 -gpu=mem:separate -O2 repro.f90 -o repro OMP_TARGET_OFFLOAD=mandatory ./repro
NVHPC 26.9, A100 separate
export LD_LIBRARY_PATH=$NVHPC_26_9/compilers/lib nvfortran -mp=gpu -gpu=cc80 -gpu=mem:separate -O2 repro.f90 -o repro OMP_TARGET_OFFLOAD=mandatory ./repro
AFAR 24.3.0, MI300A unified (runs correctly)
$AFAR/bin/amdflang -fopenmp --offload-arch=gfx942 -O2 repro.f90 -o repro HSA_XNACK=1 OMP_TARGET_OFFLOAD=mandatory ./repro
Program (37 lines)
! Minimized by compliance.fuzz_min from fuzz seed 98 (fuzz-1).
! toolchain: cce19 (-O2, HSA_XNACK=1, OMP_TARGET_OFFLOAD=mandatory)
! failure: wrong_code
! expected: the host reference checksum (host reference (afar/cce20) checksum=1819295657)
! observed: device checksum=0 ran_on_host=0
! Legal OpenMP 5.2: offload.engine.prerun.check accepts it (rerun: offload.engine.rules with the
! race rule and the restriction checks, and the AFAR flang front end, not under test here); no
! compiler under test, gfortran or gcc is a legality witness.
program fuzz_prog
implicit none
integer, parameter :: n = 100, m = 8
integer :: o1(n)
integer :: i, j
integer(8) :: cs
o1 = 0
! fuzz: kernels
!$omp target map(tofrom: o1) defaultmap(firstprivate: aggregate)
do i = 1, n
o1(i) = 1
end do
!$omp end target
! fuzz: checksum
cs = 0
do i = 1, n
cs = modulo(cs * 31_8 + int(o1(i), 8), 2147483629_8)
end do
print '(a,i0,a,i0)', 'RESULT checksum=', cs, ' ran_on_host=', 0
end program fuzz_prog
! spec (requirement): explicit data-environment attribute clauses on a target construct determine the attributes of the
! variables they name; the defaultmap rule is only consulted for variables without an explicit clause, so an array with
! map(tofrom: o1) is mapped tofrom even when defaultmap(firstprivate: aggregate) is present.
! "When specified, explicit data-environment attribute clauses on target directives determine the attributes for variables
! referenced in a target construct." (5.2 §5.8.1 p.148 l.2-3)
! "If a defaultmap clause is present for the category of the variable and specifies an implicit behavior other than default, the
! data-mapping or data-sharing attribute is determined by that clause." (5.2 §5.8.1 p.148 l.18-20)
! spec (this program): o1 is mapped explicitly with map(tofrom: o1) next to defaultmap(firstprivate: aggregate); the target
! region stores 1 in every element and the host must see them; CCE 19 returns checksum 0 instead of the host's 1819295657.
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
RESULT checksum=0
What the specification requires
The specification text this program relies on and the compiler is expected to support.
OpenMP 5.2 §5.8.1 p.148 l.2-3
When specified, explicit data-environment attribute clauses on target directives determine the attributes for variables referenced in a target construct.
OpenMP 5.2 §5.8.1 p.148 l.18-20
If a defaultmap clause is present for the category of the variable and specifies an implicit behavior other than default, the data-mapping or data-sharing attribute is determined by that clause.
Evidence
Other compilers run it correctly
AFAR 24.3.0, GCC 16.2.0