Hi,
I am having a trouble in file linking. Suppose I have a kernel.cu file defined as follows:
//------------------------------------------
#ifndef KERNEL_A
#define _KERNEL_A
global void
kernel( int* g_data )
{
}
#endif
//-------------------------------------------
and then I have two other files that need to include the kernel.cu file:
// func_a.cu:
//-------------------------------------------
#include “kernel.cu”
…
…
//--------------------------------------------
//func_b.cu:
//--------------------------------------------
#include “kernel.cu”
…
…
//--------------------------------------------
When I compile the project in vs 2005, it gives me the error msg:
func_b.obj : error LNK2005: ___device_stub__Z6kernelPi already defined in func_a.obj.
Anyone know how to fix this? Any help is highly appreciated.