PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

Compiler hanging with CUDA Fortran
Goto page 1, 2  Next
 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Accelerator Programming
View previous topic :: View next topic  
Author Message
tomko



Joined: 23 Sep 2011
Posts: 10

PostPosted: Fri Sep 23, 2011 10:07 am    Post subject: Compiler hanging with CUDA Fortran Reply with quote

I'm developing a CUDA Fortran version of a computationally expensive portion of a research code. Its a large MPI code which uses some external libraries.
I've been successful with the addition of the first kernel (compiling and running). However, after adding a second kernel, the compiler hangs on the file containing the cuda fortran code (kernels, declaration and allocation of device arrays, wrapper routines to call kernels). If I remove the code for the second kernel, the compiler completes and generates code as expected.
The code is arranged as follows

module CudaStuff

define device variables

kernel 1

kernel 2

end module

In the same file, but outside of the module are routines to allocate the device variables, call cuda init and wrappers to invoke the kernels.

Has anyone had similar issues with the compiler hanging, and is there a work around.
Thanks,
Karen
Back to top
View user's profile
mkcolg



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

PostPosted: Fri Sep 23, 2011 2:50 pm    Post subject: Reply with quote

Hi Karen,

Can you please send an example of the code to PGI Customer Service (trs@pgroup.com)? Multiple kernels can be included in a single module so there is something specific about your code that's causing the problem. Does it still occur if you remove kernel 1?

Thanks,
Mat
Back to top
View user's profile
tomko



Joined: 23 Sep 2011
Posts: 10

PostPosted: Mon Sep 26, 2011 12:09 pm    Post subject: Reply with quote

Thanks Matt,
The compiler does not hang when I have just Kernel2 (simplified version). I fixed a few minor things, will try with both Kernels again. Meanwhile, I'm checking with my research collaborator, the code developer, before sending the code to customer service.
Karen
Back to top
View user's profile
tomko



Joined: 23 Sep 2011
Posts: 10

PostPosted: Mon Oct 03, 2011 12:56 pm    Post subject: Reply with quote

Hi Mat,
I've created a toy code based on mat mul that exhibits the problem that I'm seeing. I've sent it to trs. The problem seems to be related to using blockdim%x as part of an array declaration for a parameter to the kernel. e.g. something like D below.

attributes(global) subroutine mmul_kernel2( A, B, C, D, N, M, L )
real :: A(N,M), B(M,L), C(N,L)
real :: D(blockdim%x,blockdim%x)
integer, value :: N, M, L

Is the use of blockdim or other predefined variables in this way illegal?

Karen
Back to top
View user's profile
mkcolg



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

PostPosted: Mon Oct 03, 2011 2:22 pm    Post subject: Reply with quote

Hi Karen,
Quote:

Is the use of blockdim or other predefined variables in this way illegal?
It is legal and shouldn't cause the compiler to hang. I'll ask Customer Support to send a report to engineering.

Though I'm wondering if this is really what you want? The code as written will write beyond the end of the D array when you have more then one block.

In 11.6 we added support for Dynamic Shared Memory. Is this what you're looking for? A way to dynamically adjust Asub and Bsub to match your block dimension?

- 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
Goto page 1, 2  Next
Page 1 of 2

 
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