# nvcc .cpp file

**URL:** <https://forums.developer.nvidia.com/t/nvcc-cpp-file/16164>\
**Category:** CUDA Programming and Performance\
**Created:** [April 20, 2010, 6:02pm UTC](https://forums.developer.nvidia.com/t/nvcc-cpp-file/16164 "2010-04-20T18:02:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dgetrf](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@dgetrf](https://forums.developer.nvidia.com/u/dgetrf)\
**Post date:** [April 20, 2010, 6:02pm UTC](https://forums.developer.nvidia.com/t/nvcc-cpp-file/16164/1 "2010-04-20T18:02:42Z")

</div>

hi

is there any way to compile a file with cuda kernel in it but with extension .cpp? if it’s .cu, nvcc could work straight out, but if it’s changed to .cpp, nvcc would treat it as something else.

thanks!

---

<div class="post-metadata">

**Author:** ![avidday](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/avidday/32/59219_2.png) [@avidday](https://forums.developer.nvidia.com/u/avidday)\
**Post date:** [April 20, 2010, 6:10pm UTC](https://forums.developer.nvidia.com/t/nvcc-cpp-file/16164/2 "2010-04-20T18:10:23Z")

</div>

I don’t believe so. nvcc uses the file extension to determine the compilation trajectory and won’t try extracting and compiling device code if the file doesn’t have the correct extension.
