I hope I have a simple problem, but I could not solve it during this day, so I ask for your help.
So, I`m building CUDA project in Visual studio 2010, using CUDA toolkit.
My project contains several files, and the three most important are:
//tvector_traits_kernel.cu
//contains two fuctions, the first is cuda kernel, and the second is it`s wrapper, to call it in .cpp files
template < typename _T >
__ global __ void DaxpyKernel(lint64 _m, lint64 _na, lint64 _nb, _T *_amatr, _T *_bmatr, _T *_cmatr)
{
...
}
template < typename _T >
void DaxpyKernelWrapper(lint64 _m, lint64 _na, lint64 _nb, _T *_amatr, _T *_bmatr, _T *_cmat)
{
...
}
//tvector_traits_kernel.h
//contains wrapper fuction`s prototipe
template < typename _T >
void DaxpyKernelWrapper(lint64 _m, lint64 _na, lint64 _nb, _T *_amatr, _T *_bmatr, _T *_cmat);
//main.cpp
//it just calls DaxpyKernelWrapper fuction and includes tvector_traits_kernel.h
but while linking I have an error:
Error 3 error LNK2019: external symbol unresolved "void __cdecl DaxpyKernelWrapper(__int64,__int64,__int64,float *,float *,float *)" (??$DaxpyKernelWrapper@M@@YAX_J00PAM11@Z) in functions "public: static void __cdecl CTVect_traits::CudaBlockDaxpy(__int64,__int64,__int64,float *,float *,float *)" (?CudaBlockDaxpy@?$CTVect_traits@M@@SAX_J00PAM11@Z) C:\Users\ckhgjh\Documents\GPU\Tesis\Test\test.obj Test
I wonder why, becouse "tvector_traits_kernel.cu" is in projects source files, it
s objective file was sucsessfully created.
I`m new in Visual studio, previously I used gcc, so I managed linking process myself.
So my question may be very stupid :(
Thank you for your attention!
No comments:
Post a Comment