# Understanding #include in Nsight

**URL:** <https://forums.developer.nvidia.com/t/understanding-include-in-nsight/30900>\
**Category:** CUDA Programming and Performance\
**Created:** [September 30, 2013, 5:09pm UTC](https://forums.developer.nvidia.com/t/understanding-include-in-nsight/30900 "2013-09-30T17:09:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrei](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@mrei](https://forums.developer.nvidia.com/u/mrei)\
**Post date:** [September 30, 2013, 5:09pm UTC](https://forums.developer.nvidia.com/t/understanding-include-in-nsight/30900/1 "2013-09-30T17:09:48Z")

</div>

I have a project with many source files (examples: main.cu, a.cu, b.cu, c.cu, d.cu). Each with functions and kernel calls ( **global** and **device** ).

In a header (cpu.h) all the structures to be used in the host side.  
Another header (gpu.h) all the structures to be used in the device side.

1. If I call kernel functions from main.cu, declared in a.cu. How do I #include those kernel functions declared in a.cu to use in main.cu, without doing the not recommended #include “a.cu”?

2. Do I create a header a.h with forward declaration of the kernel function in a.cu? Example:  
extern “C” void functionA(type);

Where can I find some examples?

I mention Nsight Eclipse because I am having lots of trouble with it and multiple sources.

---

<div class="post-metadata">

**Author:** ![eugeneo](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@eugeneo](https://forums.developer.nvidia.com/u/eugeneo)\
**Post date:** [September 30, 2013, 8:45pm UTC](https://forums.developer.nvidia.com/t/understanding-include-in-nsight/30900/2 "2013-09-30T20:45:37Z")

</div>

mrei, I replied on Stackoverflow (I saw your question there first and copying my reply here would require me redoing the formatting).

Link: [linux - How to include several source files in Nsight Eclipse? - Stack Overflow](http://stackoverflow.com/questions/19101763/how-to-include-several-source-files-in-nsight-eclipse)

Does this answer your question?

---

<div class="post-metadata">

**Author:** ![mrei](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@mrei](https://forums.developer.nvidia.com/u/mrei)\
**Post date:** [September 30, 2013, 9:03pm UTC](https://forums.developer.nvidia.com/t/understanding-include-in-nsight/30900/3 "2013-09-30T21:03:27Z")

</div>

I commented on Stackoverflow the parts I don’t get. Thanks a lot!
