PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

F90 accelerator directives + cublas dgemv

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



Joined: 23 Nov 2009
Posts: 35

PostPosted: Sat Mar 24, 2012 7:42 pm    Post subject: F90 accelerator directives + cublas dgemv Reply with quote

Would anyone have an example of using PGI accelerator directives in Fortran 90 used in conjunction with a cublas dgemv call?

From searching the forum, I believe this is possible. But was not able to find any examples.

I'd imagine that it would be possible to place the array data on the device using the data region directives, placing a call to cublas degemv, and then doing a copy out.
Back to top
View user's profile
mkcolg



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

PostPosted: Mon Mar 26, 2012 11:19 am    Post subject: Reply with quote

Hi Sarom,

The PGI Accelerator Model will recognise CUDA Fortran device variables. So here, you would call CUBLAS degemv using CUDA Fortran and then just use the device array in the compute region. No need to use a data region.

Note the CUDA Fortran SDK has an example of calling sgemm. (/opt/pgi/linux86-64/2012/cuda/CUDA-Fortran-SDK/cublasTestSgemm.F90).

- Mat
Back to top
View user's profile
sslgamess



Joined: 23 Nov 2009
Posts: 35

PostPosted: Mon Mar 26, 2012 2:06 pm    Post subject: Reply with quote

Hi Mat,

Does the compiler flag

Code:
ta=nvidia,wait


have any affect on asynchronous routines like cublasSetVectorAsync if it is set to wait?

And is cublasDgemv_v2 an asynchronous call?

I have several Dgemv to do and I'm interested in trying to overlap communication with computation and take advantage of multiple streams.
Back to top
View user's profile
mkcolg



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

PostPosted: Mon Mar 26, 2012 3:13 pm    Post subject: Reply with quote

Quote:
have any affect on asynchronous routines like cublasSetVectorAsync if it is set to wait?
No.

Quote:
And is cublasDgemv_v2 an asynchronous call?
I don't know for sure, but would doubt it. What does the CUBLAS docs say?

- Mat
Back to top
View user's profile
sslgamess



Joined: 23 Nov 2009
Posts: 35

PostPosted: Tue Mar 27, 2012 12:59 pm    Post subject: Reply with quote

After some digging through the web and some testing. Control immediate returns to the CPU after a cublas call.
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