PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

OpenACC reduction for complex variables in FORTRAN

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Accelerator Programming
View previous topic :: View next topic  
Author Message
adrianj



Joined: 02 Mar 2012
Posts: 10

PostPosted: Wed Oct 30, 2013 6:05 am    Post subject: OpenACC reduction for complex variables in FORTRAN Reply with quote

Is there any plans to provide support for OpenACC reduction on complex variables in loops? Currently if I try to parallelise a loop like this:

!$acc parallel reduction(+:total) create(i) copy(total)
!$acc loop
do i=1,10
total = total + data(i)
end do
!$acc end parallel

Where total and data declared as follows:

complex, dimension(10) :: data
complex :: total

I get these compiler errors:

[adrianj@kepler1 CASTEP-CUBLAS]$ pgf90 -acc -Minfo=accel -o test test.f90
/tmp/pgacckiObEm-bALDn.gpu(27): error: expression must have class type

/tmp/pgacckiObEm-bALDn.gpu(28): error: expression must have class type

/tmp/pgacckiObEm-bALDn.gpu(35): error: expression must have class type

/tmp/pgacckiObEm-bALDn.gpu(36): error: expression must have class type

/tmp/pgacckiObEm-bALDn.gpu(43): error: a value of type "signed char *" cannot be assigned to an entity of type "signed char"

/tmp/pgacckiObEm-bALDn.gpu(72): error: no operator "=" matches these operands
operand types are: dcmplx2 = signed char

/tmp/pgacckiObEm-bALDn.gpu(80): error: no operator "+" matches these operands
operand types are: dcmplx2 + signed char

/tmp/pgacckiObEm-bALDn.gpu(86): error: a value of type "signed char *" cannot be assigned to an entity of type "dcmplx2 *"

/tmp/pgacckiObEm-bALDn.gpu(87): error: no suitable conversion function from "dcmplx2" to "signed char" exists

/tmp/pgacckiObEm-bALDn.gpu(106): error: no operator "+" matches these operands
operand types are: dcmplx2 + dcmplx2

/tmp/pgacckiObEm-bALDn.gpu(113): error: no operator "+" matches these operands
operand types are: dcmplx2 + dcmplx2

/tmp/pgacckiObEm-bALDn.gpu(116): error: no operator "+" matches these operands
operand types are: dcmplx2 + dcmplx2

/tmp/pgacckiObEm-bALDn.gpu(119): error: no operator "+" matches these operands
operand types are: dcmplx2 + dcmplx2

/tmp/pgacckiObEm-bALDn.gpu(122): error: no operator "+" matches these operands
operand types are: dcmplx2 + dcmplx2

/tmp/pgacckiObEm-bALDn.gpu(125): error: no operator "+" matches these operands
operand types are: dcmplx2 + dcmplx2

/tmp/pgacckiObEm-bALDn.gpu(128): error: no operator "+" matches these operands
operand types are: dcmplx2 + dcmplx2

/tmp/pgacckiObEm-bALDn.gpu(129): error: no operator "+" matches these operands
operand types are: dcmplx2 + dcmplx2

17 errors detected in the compilation of "/tmp/pgnvdGjObG989VOht.nv0".
PGF90-W-0155-Compiler failed to translate accelerator region (see -Minfo messages): Device compiler exited with error status code (test.f90: 23)
test:
23, Generating present_or_create(i)
Generating present_or_copy(total)
Accelerator kernel generated
26, !$acc loop gang ! blockidx%x
23, Generating present_or_copyin(data(:))
Generating NVIDIA code
26, Scalar last value needed after loop for 'total' at line 33
Accelerator restriction: scalar variable live-out from loop: total
0 inform, 1 warnings, 0 severes, 0 fatal for test

And if I try to run the produced executable it seg faults.

I can get round this by reducing the real and imaginary parts to separate real variables and combining again after the loop but this is not a very nice solution.

thanks
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6138
Location: The Portland Group Inc.

PostPosted: Wed Oct 30, 2013 11:03 am    Post subject: Reply with quote

Quote:
Is there any plans to provide support for OpenACC reduction on complex variables in loops?
I talked with our Compiler Engineering Manger about this. Support for complex reductions is currently planned for mid-2014. Apologies that it's so far out, but it was determined to be lower in priority than other items.

- Mat
Back to top
View user's profile
EnricoC



Joined: 07 Mar 2014
Posts: 15

PostPosted: Tue Sep 30, 2014 9:25 am    Post subject: Reply with quote

Hi,
do you know if the use of reduction on complex data type is now possible? I read that it was expected for the 14.7 version, but I can not find any information about it in the release notes...

Best Regards,

Enrico
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6138
Location: The Portland Group Inc.

PostPosted: Tue Sep 30, 2014 2:04 pm    Post subject: Reply with quote

Hi Enrico,

It looks like this work was just completed a few weeks ago so will be in available in the 15.1 release (assuming it passes QA). It includes the case where a complex variable is used in an OpenACC reduction clause. However, the compiler will not automatically be able to recognize complex reductions.

- Mat
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Accelerator Programming All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group