I have some problems using ATL (https://msdn.microsoft.com/en-us/library/3ax346b7.aspx) on NVdia Cuda architecture.
I have made CUDA7.5 project on Visual studio 2010, and just added
#include <afxwin.h>
to my default source file, kernel.cu.
Since afxwin.h needs Microsoft MFC libraries, I have changed my project properties to use Shared MFC libraries.
But when I tried to compile it, error occurs. ERROR NO C2015, C2017, C2143, which is about grammar error occurs for "atlbase.h" which I never modified.
Do you have any solutions to use ATL on CUDA?
PS. ATL is working well on MVCC, not a problem of absence of header file, dlls and so on
The CUDA C++ front end is known to fail on very complex template declarations (at least boost, eigen, QT have been reported here to fail to compile when included into a .cu
file).
The only solution is to quarantine the ATL code into .cpp
files and not include those headers into .cu
files. nvcc will not attempt to send code within .cpp
files through the CUDA C++ parser and there will be no errors. You might need to provide wrapper functions in your .cu
file(s) to link the ATL containing code to the CUDA code, depending on your application design.
If you have a real usage case for using ATL inside a .cu
file, I would suggest contacting NVIDIA developer support and raising a bug report/feature request.