I made a cuda project with cpp and cu files which base on the cppIntegration project from the SDK.
From some reason i get the next compilation error:
error: function “main” has already been defined
The error is clear. It seems you already have a function main defined somewhere.
Did you forget update some file of your new project? Did you place a new function main in example in other file and keep the one at the main.cpp ?. A sketch of your files may help to provide a better answer.
Thanks,
But i also need the values of ROWS, Tile_DIM and COLUMNS as constant.
If i will not include the cpp file, than i wil have a problem with them at the cu file.
In that case I’ll recommend put your defines, constant, etc in an include file, in example, globals.h which you can include in both, the .cpp and the .cu file.
This is also useful to include other type of stuff, like timing function.