I am using pgfortran on PGI suite 19.10.
(Q1) The default(none) clause on a data construct (!$acc data …) is giving error:
PGF90-S-0533-Clause ‘DEFAULT(NONE)’ not allowed in ACC DATA (p1.f90: 15)
0 inform, 0 warnings, 1 severes, 0 fatal for main
(Q2) The default(none) clause on a compute construct (!$acc parallel … ) is redundant.
I have arrays and scalars inside the compute construct, without any data-clauses. I would imagine the default(none) clause should raise an error.
Kindly help.
Thanks,
arun
Hi arun,
For Q1, “defualt(none)” can only be used on a compute construct (kernels or parallel) so the error is correct that isn’t not allowed on a data region.
For Q2, I’m not sure what you mean by “redundant”. It does change the behavior over the default.
I have arrays and scalars inside the compute construct, without any data-clauses.
If the variables are declared inside the compute construct, that would make them local.
If these variables are declared outside of the compute region, then only variables that “do not have predetermined data attributes” would the “default(none)” clause apply. In other words, it wouldn’t apply to scalars.
For the arrays, do you have these in a structured data region? If the region is visible to the compiler, it would be the same as if you put them in a data clause on the compute region itself.
1015 The default clause is optional. The none argument tells the compiler to require that all variables
1016 used in the compute construct that do not have predetermined data attributes to explicitly appear
1017 in a data clause on the compute construct, a data construct that lexically contains the compute
1018 construct, or a visible declare directive
I would imagine the default(none) clause should raise an error.
I would think it would cause an error as well and my quick tests here shows that it does. If you can provide a reproducing example that shows what you think should error, that would be appreciated so we can investigate.
Here’s an example of the type of error that I would expect:
% nvfortran -acc -Minfo=accel acc_f2.f90
NVFORTRAN-S-1069-Data clause required with default(none) - a(1:n) (acc_f2.f90: 36)
NVFORTRAN-S-1069-Data clause required with default(none) - r(1:n) (acc_f2.f90: 36)
-Mat
(Q1) Pl see https://www.openacc.org/sites/default/files/inline-images/Specification/OpenACC.3.0.pdf.
page.37 (line.1111) does have “default( none | present )”
(Q2) Here is the program, which is NOT raising an error:
program main
implicit none
integer N,i,j,ans
integer a(100,100), b(100)
N = 100
!$acc parallel loop default(none)
do i=1,N
do j=1,N
ans=ans+1
a(i,j)=i+j
b(j) = j
enddo
enddo
!$acc end parallel
write(*,*) ans
end program main
As you can see, a, b are arrays, and compiler is not complaining.
arun
Yes, that’s new as of the 2.7 standard. We currently support the 2.6 standard are working on adding the 2.7 and 3.0 features.
For your example, since a and b aren’t actually used, dead-code elimination optimization removes them. Hence no need to copy them to the GPU. If you use the variables, then the compiler gives an error.
% cat test.f90
program main
implicit none
integer N,i,j,ans
integer a(100,100), b(100)
N = 100
!$acc parallel loop default(none)
do i=1,N
do j=1,N
ans=ans+1
a(i,j)=i+j
b(j) = j
enddo
enddo
!$acc end parallel
write(*,*) ans, a(1,1), b(1)
end program main
%
% nvfortran -acc -Minfo=accel test.f90
NVFORTRAN-S-1069-Data clause required with default(none) - a(:,:) (test.f90: 9)
NVFORTRAN-S-1069-Data clause required with default(none) - b(:) (test.f90: 9)
main:
9, Generating Tesla code
10, !$acc loop gang ! blockidx%x
11, !$acc loop vector(128) ! threadidx%x
Interchanging generated vector loop outwards
Interchanging generated strip mine loop outwards
9, Generating implicit copyout(a(:,:),b(:)) [if not already present]
11, Loop is parallelizable
0 inform, 0 warnings, 2 severes, 0 fatal for main
Hope this helps,
Mat