Converting CUDA code to a DLL equivalent to use in MFC
-
Hello, I have some CUDA code in .cu file that I add to my solution (MFC project in VS 2008) as a source file and it all works fine. Now I would like to access the same functions that I defined in .cu file in my application via a DLL equivalent of that .cu file so that I can keep the soruce code away from users. Could someone help me out with this? I already tried on nvidia forums, but didn't get any reply. thanks in advance.
PKNT
-
Hello, I have some CUDA code in .cu file that I add to my solution (MFC project in VS 2008) as a source file and it all works fine. Now I would like to access the same functions that I defined in .cu file in my application via a DLL equivalent of that .cu file so that I can keep the soruce code away from users. Could someone help me out with this? I already tried on nvidia forums, but didn't get any reply. thanks in advance.
PKNT
Well, I'm not familiar with cuda but as to what you're trying to achieve, you'll just have to create a DLL with some set of exports and a corresponding header file(s) that will allow users to pull that functionality off the dll. There should be plenty of resources online on the subject: http://msdn.microsoft.com/en-us/library/ms235636.aspx[^] HowTo: Export C++ classes from a DLL[^]
-
Well, I'm not familiar with cuda but as to what you're trying to achieve, you'll just have to create a DLL with some set of exports and a corresponding header file(s) that will allow users to pull that functionality off the dll. There should be plenty of resources online on the subject: http://msdn.microsoft.com/en-us/library/ms235636.aspx[^] HowTo: Export C++ classes from a DLL[^]
I am aware of writing DLLs in C++ and I have written many before. I started out in the same way and stumbled upon errors specific to cuda header files that are included in the project. Specifically syntax missing error for the lines
texture texDataIn;
texture texDataMid;
texture texDataOut;PKNT
-
I am aware of writing DLLs in C++ and I have written many before. I started out in the same way and stumbled upon errors specific to cuda header files that are included in the project. Specifically syntax missing error for the lines
texture texDataIn;
texture texDataMid;
texture texDataOut;PKNT
what's the error?
-
what's the error?
For all those 3 lines, the error log shows
1>error C2143: syntax error : missing ';' before '<'
1>error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>error C2143: syntax error : missing ';' before '<'
1>error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>error C2086: 'int texture' : redefinition
1>see declaration of 'texture'
1>error C2143: syntax error : missing ';' before '<'
1>error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>error C2086: 'int texture' : redefinition
1>see declaration of 'texture'thanks
PKNT
-
For all those 3 lines, the error log shows
1>error C2143: syntax error : missing ';' before '<'
1>error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>error C2143: syntax error : missing ';' before '<'
1>error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>error C2086: 'int texture' : redefinition
1>see declaration of 'texture'
1>error C2143: syntax error : missing ';' before '<'
1>error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>error C2086: 'int texture' : redefinition
1>see declaration of 'texture'thanks
PKNT
That first error essentially says that the
texture<>
template is undefined. Make sure you have the appropriate header included.