PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

CUDA FORTRAN Programming, debug in Emulation mode

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Debugging and Profiling
View previous topic :: View next topic  
Author Message
artimes



Joined: 07 Feb 2012
Posts: 1

PostPosted: Tue Feb 07, 2012 9:04 pm    Post subject: CUDA FORTRAN Programming, debug in Emulation mode Reply with quote

Hi,

I have a huge program in cuda fortran. I tried to parallelized a new subroutine. My problem is that it work perfect when I built it in emulation mode using -o -Mcuda=emu. but when I built it and run it with out -Mcuda=emu although I can run it and there is no error but the answers are not what they should be. I tried many different things. I really don't know what should l do to find the problem. I was wondering if there are special reasons when programs work well in emulation mode but not other than that.
Back to top
View user's profile
mkcolg



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

PostPosted: Wed Feb 08, 2012 4:07 pm    Post subject: Reply with quote

Hi artimes,

While emulation mode is very helpful in discovering some bugs, one of the things it can't do is recreate is the massively parallel environment of the GPU. So one possible cause is if you have a race condition or other memory (global or shared) contention issue. Also, the GPU may use different numerical methods (such as FMA) which can yield slightly different answers.

First thing to try is add the flag "-Mcuda=nofma" to disable the use of fuse-multiply-add instructions.

If that doesn't do fix the issue, create temporary arrays that capture intermediate values in your kernel. Then compare these values with the same ones captured when running in emulation mode. While this method does take a bit of hunting, it will help narrow down where in the code the numbers diverge.

Hope this helps,
Mat
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Debugging and Profiling 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