PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

Problems with shared memory in cuda fortran

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



Joined: 27 Sep 2006
Posts: 9

PostPosted: Wed Oct 05, 2011 2:47 pm    Post subject: Problems with shared memory in cuda fortran Reply with quote

Hello All,

I am having issues when using shared memory arrays in fortran. If someone can look at the code and identify the errors in the code, that would be great.
I uploaded the files to mediafire.
http://www.mediafire.com/?gv752n5ieqncx30

In folder v1, I didn't use shared memory and the code is working fine.

To get more performance, I changed the structure of code and used 2 dimensional blocks and with that I started using shared memory. But the code is giving garbage results. Logically the code looks sound, but I am making some mistake unknown to me. The modified code is in folder v2

The troublesome files are xi.90 and enrgy_eval.f90. And when I am mixing xi and enrgy_eval files from the two folders, I am getting memory errors.

Any help is greatly appreciated
thanks
Bharat
Back to top
View user's profile
mkcolg



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

PostPosted: Wed Oct 05, 2011 4:01 pm    Post subject: Reply with quote

Hi Bharat,

Adding error checking:
Code:
       
        call xi2_kernel<<<dimGrid>>>(xd,yd,zd,WLKR,NCL_NO,wf2d)
        istat = cudaGetLastError()
        print *, cudaGetErrorString(istat)


I get the following runtime error:
Code:

 too many resources requested for launch       


The "-Mcuda=ptxinfo" flag shows that you're using 37 registers per thread. Since you have 1024 threads per block, the total register usage is 37888. The maximum number of registers on a C2060 is 32768.

To fix you either need to reduce the number of threads per block, or use the flag "-Mcuda=maxregcount:35" to reduce the number of registers per block.

Hope this helps,
Mat
Back to top
View user's profile
mbkumar



Joined: 27 Sep 2006
Posts: 9

PostPosted: Thu Oct 06, 2011 12:55 pm    Post subject: Reply with quote

Hello Mat,

Thanks for the info.

Regards,
Bharat
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