Functions/Procedure not supported

Hi,
This is the code section that I am trying to accelerate.

!$acc region copyin (k,yxv,f,route) copyout(vtx) local(phase3,ctemp)
!$acc do parallel
DO p = 1,npoints
DO i = 1,nterms
phase3 = CMPLX(0,0.5d0) * SUM( k(:,1:order+1,p)*yxv(:,1:order+1,i) )
ctemp = f(i) * EXP(phase3)
vtx(0,0,0,p) = vtx(0,0,0,p) + ctemp
END DO
END DO
!$acc end region

I get the following message

main:
64, Accelerator region ignored
67, Accelerator restriction: function/procedure calls are not supported
68, sum reduction inlined
69, Accelerator restriction: function/procedure calls are not supported

It seems CMPLX, SUM and EXP functions are not supported? Is there any work around?

Hi Karthee,

It seems CMPLX, SUM and EXP functions are not supported?

CMPLX is not supported. SUM and EXP are supported just not for Complex data types. For a complete list of supported intrinsics, please refer the Chapter 7 of PGI User’s Guide (http://www.pgroup.com/doc/pgiug.pdf).

Is there any work around?

You could replace “CMPLX(0,0.5d0)” with a variable initialized on the host. For sum, you would simply add another loop to perform the summation. Unfortunately, I can’t think of anything for EXP.

Sorry,
Mat

Do the real and imaginary parts as separate variables using:

CMPLX(a,b) * CMPLX(c,d) = CMPLX(ac-bd,ad+bc)

EXP(CMPLX(a,b)) = EXP(a) * CMPLX(COS(b),SIN(b))

Cheers,

Alistair.

Is it really true that CMPLX is not supported?

MMB

After further research, i.e. reading more of the PGI manuals, I see that CMPLX really is not supported, as shown in Table 7.5 of the User Guide. In fact, comparing Table 7.5 with the list of supported intrinsics shown in the Fortran Reference manual, there are quite a few intrinsics not supported. To the HPC community things like DOT_PRODUCT and TRANSPOSE, just to mention two that are not supported in any intrinsic data type, must crop up all of the time! This has got to be a real draw back to the adoption of the Accelerator product!!

MMB

Is it really true that CMPLX is not supported?

I did more research on this and found that CMPLX is actually now supported. The docs just need updating.

Thanks,
Mat

Hi Mat,

Thanks for your replies. Appreciate your time and effort.
We currently got the latest version of pgfortran 10.6. Complex arithmetic seems to be not working on this still.

       INTEGER,               ALLOCATABLE :: yxv(:,:,:)
       COMPLEX(kind=cx_kind), ALLOCATABLE :: k(:,:,:)
       COMPLEX(kind=cx_kind), ALLOCATABLE :: vtx(:,:,:,:)
       COMPLEX(kind=cx_kind) ctemp, phase3
........
!$acc region
!$acc do 
        DO p = 1,npoints
          phase3 = 0
          DO r = 1,order+1
            DO mu = 0,NDIR-1
              ctemp = k(mu,r,p)
              DO i = 1,nterms
                phase3 = phase3 + ctemp*yxv(mu,r,i)
              END DO
            END DO
          END DO
          vtx(0,0,0,p) = phase3
        END DO
!$acc end region

I get the following message.
Accelerator restriction: struct/member references are not yet supported: imag(ctemp)
Accelerator restriction: struct/member references are not yet supported: real(ctemp)

Please advice.

Hi Karthee,

Complex arithmetic seems to be not working on this still.

I checked with our compiler engineers. Complex arithmetic is supported, however this is a bug where the unroller where isn’t copying the complex offset for complex scalar variables. They had found this a internally and have a fix in place for the 10.8 release.

Sorry for the error,
Mat