# How to give cuda code

**URL:** <https://forums.developer.nvidia.com/t/how-to-give-cuda-code/134677>\
**Category:** Legacy PGI Compilers (archived)\
**Created:** [November 3, 2015, 2:44pm UTC](https://forums.developer.nvidia.com/t/how-to-give-cuda-code/134677 "2015-11-03T14:44:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![simoliok](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@simoliok](https://forums.developer.nvidia.com/u/simoliok)\
**Post date:** [November 3, 2015, 2:44pm UTC](https://forums.developer.nvidia.com/t/how-to-give-cuda-code/134677/1 "2015-11-03T14:44:18Z")

</div>

Hi  
I want to give cuda code , my program write in c or c++ !  
Anyone can help me to find Anyway to give cuda code?  
A command or …  
Thanks

---

<div class="post-metadata">

**Author:** ![MatColgrove](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/matcolgrove/32/14047_2.png) [@MatColgrove](https://forums.developer.nvidia.com/u/MatColgrove)\
**Post date:** [November 3, 2015, 5:51pm UTC](https://forums.developer.nvidia.com/t/how-to-give-cuda-code/134677/2 "2015-11-03T17:51:21Z")

</div>

Hi simoliok,

My apologies but I’m unclear on what you’re asking. Can you please restate your question?

Do you wish to view the device code generated by the compiler when compiling an OpenACC compute region? If so, then add the flag “-ta=tesla:keep”. However, we default to generating LLVM code. To see the CUDA equilvent use the flag “-ta=tesla:nollvm,keep”.

- Mat

---

<div class="post-metadata">

**Author:** ![simoliok](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@simoliok](https://forums.developer.nvidia.com/u/simoliok)\
**Post date:** [November 4, 2015, 6:46am UTC](https://forums.developer.nvidia.com/t/how-to-give-cuda-code/134677/3 "2015-11-04T06:46:48Z")

</div>

> [@mkcolg](#):
>
> Hi simoliok,
> 
> My apologies but I’m unclear on what you’re asking. Can you please restate your question?
> 
> Do you wish to view the device code generated by the compiler when compiling an OpenACC compute region? If so, then add the flag “-ta=tesla:keep”. However, we default to generating LLVM code. To see the CUDA equilvent use the flag “-ta=tesla:nollvm,keep”.
> 
> - Mat

Hi Mat  
Thanks  
This help me  
And this link [http://stackoverflow.com/questions/33263541/can-the-pgi-compilers-output-the-generated-cuda-code-to-a-file](http://stackoverflow.com/questions/33263541/can-the-pgi-compilers-output-the-generated-cuda-code-to-a-file) is useful too!  
Thanks A lot Mat
