Skip to content

ACC006 missing-acc-routine ​

warning enabled by default

A project procedure is called inside an OpenACC compute region but has no !$acc routine.

Why ​

Code executed on the device can only call procedures compiled for the device: each needs an !$acc routine directive (with its parallelism level, usually seq). Without it the compiler either fails, or inlines the call only when it can see the body, so the build breaks as soon as the procedure moves to another file or the optimisation level changes.

Reported ​

fortran
!$acc parallel loop
do i = 1, n
  call flux_cell(q(:, i))      ! flux_cell has no !$acc routine
end do

Preferred ​

fortran
subroutine flux_cell(q)
  !$acc routine seq
  ...

Suppressing ​

For one occurrence, with the reason on the same line (or alone on the line before the statement):

fortran
! fobis: ignore[ACC006] <why this occurrence is fine>

For the whole project, ignore = ACC006 in the fobos [lint] section.

References ​

Sections of the shipped knowledge packs behind this rule:

  • openacc:patterns#routine-for-device-callable-functions (fobis kb show openacc:patterns#routine-for-device-callable-functions)
  • openacc:ch07-procedures-async-fortran#frameworks-introduced (fobis kb show openacc:ch07-procedures-async-fortran#frameworks-introduced)