Hi. i have too many errors to post them here, so i just give you a project cause them.
it compiles perfectly on CUDA 1.1 but not on 2.0 betha.
i am using C++ template metaprogramming in my lib. I know - documetation says - “only С”, but i was very happy when my C++ code compiles on device. My library was CPU/GPU portable and it has some optimisations (like automatic SSE on CPU).
so i dont think that C++ features cause any problems in future versions.
1)a question is will CUDA 2.0 support all C++ features that CUDA 1.1 supported? espesially, what about templates?
if it is not - this is very-very bad :crying: , because i have a lot of code and plans using MGML_MATH library.
While I doubt this is the cause for the problem, since that code should never do anything when compiling with nvcc:
I do not know for C++, but for C identifiers starting with __ or _ and uppercase letter are reserved. If you use (or as in this case even redefine) any of those, there is no reason to expect your program to work at all.
Can you post a small snippet of code that doesn’t work? Your initial post has a big project but it’s annoying to get all the paths and such correct just to start to compile it.
I tried this code below in 2.0B2 and it compiled just fine:
It also works as an unnamed struct (removing the SSE_Aligned_Object tag).
This is in Windows XP, which may matter.
I am also using template metaprogramming with kernel code. It can be finicky (no static constant definitions, since the “static” keyword is not allowed) but it works.
There are no disgraces due to compiler errors, except the disgrace that the errors messages themselves are. Thanks for posting - trouble shared is trouble halved.
I do not know about C++, but at least in C empty structs are not allowed, so this would just not be valid code. Your could try some of the hacks like adding a “int a[0];” or “int a” though I doubt it will help.
Even if it is valid in C++, both CUDA and brook are Franken-monster mixtures of C and C++, neither the one nor the other (e.g. I still have to cast all malloc return values - even when I set nvcc to compile C host code or with brook which claims to be C - which to my knowledge is a clear violation of any C standard in existence). Doesn’t stop anyone from advertising it as C, which is a clear lie, even CUDA is at best C++ - though possibly some very early version.