[Maya & CUDA build customization] Maya plugin CUDA compile problem

Hi guys,

i’m currently trying to find my way into accelerating my Maya (DCC Application from Autodesk) Plugins with CUDA.
My setup is the following: I have a deformer plugin, in its deform method i would like to
execute a simple kernel to do some vector math.

I have set up VS2010 and the NVidia Toolkit and all the sample files compile correctly.
When i want to compile the CUDA version of my plugin, and i use the “CUDA Build Customization” to setup the compilation of .cu files i get the following error:


1> C:\Program Files\Autodesk\Maya2012\include\maya/MTypes.h(270): error : invalid redeclaration of type name “short2”
1> c:\program files\nvidia gpu computing toolkit\cuda\v5.0\include\vector_types.h(145): here

Problem: The CUDA vector-types.h header redeclares the same basic types as MTypes.h does.

Solution from another thread: Use namespace for #include directive! (https://devtalk.nvidia.com/default/topic/487176/maya-plug-in-conflicts-with-cuda-namespace-conflict-between-60-vector-62-/)

But this does not work for me, since i dont even include any CUDA headers in my header file. The Build customization seems to set everything up in a way, so that this is not neccessary. (Even if i try to include CUDA headers in a namespace i get the same error…)

How do you get around this problem? Is there a way to specify everything manually to avoid the build customization?

Hey guys,
maybe i should try to formulate my question a bit clearer:

Why do my CUDA programs compile if i dont include any CUDA header files? (I mean thats probably a good thing in 90% of all cases, but if i want to put a namespace around my headers i should know where and when they are included automatically).
Is that, and if how exactly, related to the build customization i check on?
Is it common practice to use the build customization or do you adjust the compile settings
manually?

Thanks a lot ;D