[nvfortran] missing "sign" intrinsic for device code in HPC SDK 23.11?

Similar to this older post, the “sign” intrinsic function doesn’t seem to be recognized in device code compiled with nvfortran in HPC SDK 23.11. Here is a simple example (yes I’m aware this is a terrible kernel):

module test
  use cudafor
  implicit none
  integer*4, parameter :: Nbl = 32
  integer*4, parameter :: Nth = 512
contains
  attributes (global) subroutine sign_kernel(Y,n,m)
    real*8, dimension(:,:) :: Y
    integer*4 :: n,m,i,j,k
    do i = (blockIdx%x-1)*blockDim%x+threadIdx%x-1,n*m,blockDim%x*gridDim%x
      j = i/m + 1 ! integer division
      k = mod(i,m) + 1
      Y(j,k) = sign(Y(j,k))
    enddo
  end subroutine sign_kernel

  subroutine get_sign_2d(Y)
    real*8, dimension(:,:), device, intent(inout) :: Y
    integer*4, device :: n, m
    n = size(Y,1)
    m = size(Y,2)
    call sign_kernel<<<Nbl,Nth>>>(Y,n,m)
  end subroutine get_sign_2d
end module test

program main
  use cudafor
  use test
  implicit none

  real*8 :: d(4,5)
  real*8, device :: d_d(4,5)

  d = 10.0
  d(1,2) = -5.0
  d_d = d

  call get_sign_2d(d_d)

  d = d_d

  print *, d(1,:)
end program main

Compilation yields:

NVFORTRAN-S-1253-Calls from device code to a host subroutine/function are not allowed - sign. (test_sign.cuf: 13)
NVFORTRAN-S-0038-Symbol, sign, has not been explicitly declared (test_sign.cuf: 7)

Replacing the call to “sign” with any of the other Fortran intrinsic numeric functions implemented for real*8 in device code (e.g. “abs”), this example compiles/runs fine. I also haven’t clobbered “sign” anywhere here. Is this actually missing?

Tricky one, but the problem is that sign() takes two arguments.

Sorry for wasting your time… should have figured that one out.

NP. The error was somewhat misleading. In Fortran, if you call an intrinsic with the wrong number of arguments, it just becomes an external symbol, in this case that defaults to a host function.