Problem with compiling .cu code having C code

Hi,

The topic title may sound confusing… So I’m.

I have a C code. Which I have compiled with gcc on linux and it compiles successfully. It has certain things like void* is assigned to void** …etc. Which are supported by C but not by C++.

But include this code in .cu with the help of #include… it gives errors to all those things which are not suported by C++.

any suggestion what can i do? i tried using that “–host-compilation” option from nvcc but that also dint help…

I wonder that why do you include code into .cu file?

just write a C-wrapper to encapsulate your kernel function in .cu file and

call this wrapper outside.

you don’t need to include your code into .cu file