OffTarget

Observed issues › defaultmap-none-loop-variable

Appears not to supportRefused at compile time · Fortran · OpenMP · Open

Defaultmap(none) rejected although every referenced variable has a data-environment attribute (ftn-1964)

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.0not supportednot supportednot supportednot supportednot supportedn/an/a
CCE 19.0.0not supportednot supportednot supportedunknown
not run
unknown
not run
n/an/a
CCE 20.0.2not supportednot supportednot supportedunknown
not run
unknown
not run
n/an/a
CCE 21.0.3not supportednot supportednot supportedunknown
not run
unknown
not run
n/an/a
CCE 21.0.4not supportednot supportednot supportedunknown
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.0correctcorrectcorrectcorrectcorrectcorrectn/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
not supportedAFAR 24.3.0, MI300A unified
AFAR 24.3.0, MI300A copy
AFAR 24.3.0, MI250X
AFAR 24.3.0, MI300X
AFAR 24.3.0, MI350X
show
error: Semantic errors in defaultmap-none-loop-variable.f90
defaultmap-none-loop-variable.f90:11:8: error: The DEFAULTMAP(NONE) clause requires that 'i' must be listed in a data-sharing attribute, data-mapping attribute, or is_device_ptr clause
      do i = 1, n
         ^
defaultmap-none-loop-variable.f90:12:9: error: The DEFAULTMAP(NONE) clause requires that 'i' must be listed in a data-sharing attribute, data-mapping attribute, or is_device_ptr clause
        b(i) = 2*a(i) + 1
          ^
defaultmap-none-loop-variable.f90:12:18: error: The DEFAULTMAP(NONE) clause requires that 'i' must be listed in a data-sharing attribute, data-mapping attribute, or is_device_ptr clause
not supportedCCE 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..
      b(i) = 2*a(i) + 1
      ^                 
ftn-1964 ftn: ERROR P, File = defaultmap-none-loop-variable.f90, Line = 12, Column = 7 
  Variable "B" must have its data mapping attribute explicitly declared because default map(none) was specified.
        ^               
ftn-1964 ftn: ERROR P, File = defaultmap-none-loop-variable.f90, Line = 12, Column = 9 
not supportedCCE 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..
      b(i) = 2*a(i) + 1
        ^               
ftn-1964 ftn: ERROR P, File = defaultmap-none-loop-variable.f90, Line = 12, Column = 9 
  Variable "I" must have its data mapping attribute explicitly declared because default map(none) was specified.
                 ^      
ftn-1964 ftn: ERROR P, File = defaultmap-none-loop-variable.f90, Line = 12, Column = 18 
not supportedCCE 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..
      b(i) = 2*a(i) + 1
        ^               
ftn-1964 ftn: ERROR P, File = defaultmap-none-loop-variable.f90, Line = 12, Column = 9 
  Variable "I" must have its data mapping attribute explicitly declared because default map(none) was specified.
                 ^      
ftn-1964 ftn: ERROR P, File = defaultmap-none-loop-variable.f90, Line = 12, Column = 18 

Reproduce

AFAR 24.3.0, MI300A unified

$AFAR/bin/amdflang -fopenmp --offload-arch=gfx942 -O2 repro.f90 -o repro
HSA_XNACK=1 OMP_TARGET_OFFLOAD=mandatory ./repro

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

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 -fopenmp -O2 repro.f90 -o repro
HSA_XNACK=1 OMP_TARGET_OFFLOAD=mandatory ./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 -fopenmp -O2 repro.f90 -o repro
HSA_XNACK=1 OMP_TARGET_OFFLOAD=mandatory ./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 -fopenmp -O2 repro.f90 -o repro
HSA_XNACK=1 OMP_TARGET_OFFLOAD=mandatory ./repro

NVHPC 25.11, A100 separate (runs correctly)

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
Program (65 lines)
! Finding: defaultmap(none) on a target construct whose every
! referenced variable has a data-environment attribute is rejected by every
! compiler.
!
! Legal OpenMP 5.2: "If implicit-behavior is none, each variable that is
! specified by variable-category and is referenced in the construct but does
! not have a predetermined data-sharing and does not appear in an enter or
! link clause on a declare target directive must be explicitly listed in a
! data-environment attribute clause on the construct" (5.2 §5.8.7 p.162).
! a, b and host_flag are mapped; n is a named constant, not a variable; i is
! listed in private(i), a data-environment attribute clause (whether it is
! also predetermined private as a loop iteration variable, 5.2 §5.1.1 p.97,
! depends on reading target as a task generating construct; the finding
! does not rest on it). Expected: "RESULT ran_on_host=0 check=pass".
!
! Legality rests on the quoted spec text only (registry
! RUL-LEGAL-DEFAULTMAP-NONE): there is no independent compiler witness.
! Cited gfortran 13.3.1 -fopenmp as one; the maintainer withdrew
! gfortran/gcc -fopenmp as offload legality witnesses on 2026-10-23 (final
! review 3, data/reports/rulings.md), so the catalog cells are
! unsupported_everywhere (every family rejects), not compiler_bug (R12a
! cannot fire without a witness). The variant without private(i)
! (data/evidence/triage_probe/dmap_none_noi.f90) is contested.
! (2026-10-24): NVHPC 25.11 and 26.9 (wingtip, the configured
! witness) accept the omp50/52/60-clause-defaultmap-none programs, but
! that is no witness either (ruling R2): nvc also
! compiles and runs the illegal C defaultmap(none) variants
! (omp52/60-c-illegal-defaultmap-map-003, a referenced variable not
! listed), and nvfortran compiles a Fortran target defaultmap(none) that
! references unlisted x and n; NVHPC does not enforce defaultmap(none), so
! its accept says nothing about legality (offload.engine.confirm.witness
! uncalibrated; catalog/legality_witness.yaml calibration rows). The cells
! stay unsupported_everywhere.
!
! Observed (tuolumne, MI300A, both memory modes, -O2, 2026-10-22,
! data/evidence/triage_probe/dmap_none.f90 and dmap_none_noi.f90 (without private(i)),
! results/t27b/probes.jsonl): every compiler under test rejects this form
! (and the variant without private(i)):
! - AFAR amdflang 24.0.0git: "The DEFAULTMAP(NONE) clause requires that 'i'
!   must be listed in a data-sharing attribute, data-mapping attribute, or
!   is_device_ptr clause";
! - CCE 20.0.2, 21.0.3: ftn-1964 "Variable "I" must have its data mapping
!   attribute explicitly declared because default map(none) was specified";
! - CCE 19.0.0: ftn-1964 "Variable "B" ..." although b is in map(from: b).
! The catalog's omp50/52/60-clause-defaultmap-none programs are rejected on
! every compiler because of it.
!
! amdflang -fopenmp --offload-arch=gfx942 -O2; ftn -fopenmp -O2
program p
  use omp_lib, only: omp_is_initial_device
  implicit none
  integer, parameter :: n = 64
  integer :: a(n), b(n), i, host_flag
  a = [(i, i = 1, n)]
  b = 0
  host_flag = 1
  !$omp target map(to: a) map(from: b) map(tofrom: host_flag) defaultmap(none) private(i)
    host_flag = merge(1, 0, omp_is_initial_device())
    do i = 1, n
      b(i) = 2*a(i) + 1
    end do
  !$omp end target
  print '(a,i0,a,a)', 'RESULT ran_on_host=', host_flag, ' check=', &
    merge('pass', 'fail', all(b == 2*a + 1))
end program p

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

Expected

RESULT ran_on_host=0 check=pass

Observed where it behaves incorrectly

error: Semantic errors in defaultmap-none-loop-variable.f90
defaultmap-none-loop-variable.f90:11:8: error: The DEFAULTMAP(NONE) clause requires that 'i' must be listed in a data-sharing attribute, data-mapping attribute, or is_device_ptr clause
      do i = 1, n
         ^
defaultmap-none-loop-variable.f90:12:9: error: The DEFAULTMAP(NONE) clause requires that 'i' must be listed in a data-sharing attribute, data-mapping attribute, or is_device_ptr clause
        b(i) = 2*a(i) + 1
          ^
defaultmap-none-loop-variable.f90:12:18: error: The DEFAULTMAP(NONE) clause requires that 'i' must be listed in a data-sharing attribute, data-mapping attribute, or is_device_ptr clause

What the specification requires

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

OpenMP 5.2 §5.8.7 p.162

If implicit-behavior is none, each variable that is specified by variable-category and is referenced in the construct but does not have a predetermined data-sharing and does not appear in an enter or link clause on a declare target directive must be explicitly listed in a data-environment attribute clause on the construct

OpenMP 5.2 §5.1.1 p.97

Evidence

Same compiler, one change

  • defaultmap(none) removed: AFAR 24.3.0: correct; CCE 19.0.0: correct; CCE 20.0.2: correct; CCE 21.0.3: correct; CCE 21.0.4: correct
    Control program
    program p
      use omp_lib, only: omp_is_initial_device
      implicit none
      integer, parameter :: n = 64
      integer :: a(n), b(n), i, host_flag
      a = [(i, i = 1, n)]
      b = 0
      host_flag = 1
      !$omp target map(to: a) map(from: b) map(tofrom: host_flag) private(i)
        host_flag = merge(1, 0, omp_is_initial_device())
        do i = 1, n
          b(i) = 2*a(i) + 1
        end do
      !$omp end target
      print '(a,i0,a,a)', 'RESULT ran_on_host=', host_flag, ' check=', &
        merge('pass', 'fail', all(b == 2*a + 1))
    end program p
    

Other compilers run it correctly

NVHPC 25.11, NVHPC 26.9, GCC 16.2.0