PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

Generate CUDA kernel code

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



Joined: 26 Jul 2010
Posts: 11

PostPosted: Mon Aug 02, 2010 10:17 am    Post subject: Generate CUDA kernel code Reply with quote

Are there any options to generate the CUDA kernel code? I think it's really helpful for us to optimize the code.
Back to top
View user's profile
mkcolg



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

PostPosted: Mon Aug 02, 2010 10:53 am    Post subject: Reply with quote

Hi tannguyen,

Can you please clarify your question?

We have two different ways that users can generate code targeting NVIDIA GPUs.

First is the PGI Accelerator model, where users insert directives around the code they wish to off-load to the GPU and the compiler generates the kernel. Full details can be found at: http://www.pgroup.com/resources/accel.htm.

Second is CUDA Fortran. This is an explicit extension to Fortran where users write there own kernels. Please see: http://www.pgroup.com/resources/cudafortran.htm for details.

- Mat
Back to top
View user's profile
tannguyen



Joined: 26 Jul 2010
Posts: 11

PostPosted: Mon Aug 02, 2010 11:21 am    Post subject: Reply with quote

Hi, thanks for your quick response. I'm using the PGI accelerator model to parallelize some codes, e.g., 3-D stencil. However, the performance is quite low compared to my CUDA hand code. I think it's because I didn't use the directives properly. So I wonder if pgcc supports option for user to see the kernel code it generates. Thanks.

Tan.
Back to top
View user's profile
mkcolg



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

PostPosted: Mon Aug 02, 2010 11:36 am    Post subject: Reply with quote

Hi Tan,

Yes. Use the "-ta=nvidia,keepgpu" flag to have the compiler keep the intermediary CUDA C GPU file. The caveat is that the file is not very human readable. You can also keep the generated PTX file using "keepptx".

- Mat
Back to top
View user's profile
tannguyen



Joined: 26 Jul 2010
Posts: 11

PostPosted: Mon Aug 02, 2010 11:50 am    Post subject: Reply with quote

Great, I can generate the CUDA code now. Thank you for your help.

Tan.
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