# Compiling with nvcc and keeping the function name.

**URL:** <https://forums.developer.nvidia.com/t/compiling-with-nvcc-and-keeping-the-function-name/7108>\
**Category:** CUDA Programming and Performance\
**Created:** [January 7, 2009, 4:47pm UTC](https://forums.developer.nvidia.com/t/compiling-with-nvcc-and-keeping-the-function-name/7108 "2009-01-07T16:47:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MartyMcFly](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@MartyMcFly](https://forums.developer.nvidia.com/u/MartyMcFly)\
**Post date:** [January 7, 2009, 4:47pm UTC](https://forums.developer.nvidia.com/t/compiling-with-nvcc-and-keeping-the-function-name/7108/1 "2009-01-07T16:47:46Z")

</div>

Hello,

during my tests to use CUDA in C# implementations I’m using the driver API to have better access to the compiled .cubin file.  
As you write in your documentation there is a method to get the kernel function-pointer by name. The problem is, that the name is not fix in the cubin file and changes everytime a parameter or a code has changed. Is there a way to keep the name of the function constant so that I can rely on the function name?

Thanks  
Martin

---

<div class="post-metadata">

**Author:** ![MisterAnderson42](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@MisterAnderson42](https://forums.developer.nvidia.com/u/MisterAnderson42)\
**Post date:** [January 7, 2009, 5:04pm UTC](https://forums.developer.nvidia.com/t/compiling-with-nvcc-and-keeping-the-function-name/7108/2 "2009-01-07T17:04:27Z")

</div>

This is from the C++ name mangling. Declare the **global** fuction:

```auto
extern "C" void __global__ kernel(..)

```

to avoid it.

---

<div class="post-metadata">

**Author:** ![MartyMcFly](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@MartyMcFly](https://forums.developer.nvidia.com/u/MartyMcFly)\
**Post date:** [January 7, 2009, 5:06pm UTC](https://forums.developer.nvidia.com/t/compiling-with-nvcc-and-keeping-the-function-name/7108/3 "2009-01-07T17:06:43Z")

</div>

Hello MisterAnderson42,

works great. Thank you very much for your quick help.

Regards

Martin

> [@](#):
>
> This is from the C++ name mangling. Declare the **global** fuction:
> 
> ```auto
> extern "C" void __global__ kernel(..)
> 
> ```
> 
> to avoid it.
