I’m experiencing an issue with a very simple OpenACC program that uses a pointer alias. When I run my code, I get the following runtime error:
call to cuEventSynchronize returned error 700 (CUDA_ERROR_ILLEGAL_ADDRESS): Illegal address during kernel execution
program simple_acc_pointer
implicit none
integer, parameter :: n = 10
integer :: i
real, allocatable, target :: a(:)
real, pointer :: p(:)
real :: local_val
allocate(a(n))
p => a
do i = 1, n
a(i) = i * 1.0
end do
!$acc data copy(a(1:n))
!$acc parallel loop deviceptr(p)
do i = 1, n
local_val = p(i) * 2.0
p(i) = local_val
end do
!$acc end parallel loop
!$acc end data
deallocate(a)
end program simple_acc_pointer
Compiler: NVFORTRAN
Could the error be due to how local variables are handled within the OpenACC parallel region when using pointer aliasing?
Are there any known issues with this pattern (using a local variable together with a pointer alias in a collapsed data region)?