0
votes

Sorry, stuck with VS2013 but I don't think that is a problem. The same code compiles correctly on linux. I assume I need to define uint rather than edit 100+ lines of code. I am getting "error : explicit type is missing ("int" assumed)" on first line of below code

__device__ uint inline get_smid(void)
{
  uint ret;
  asm("mov.u32 %0, %%smid ;" : "=r"(ret) );
  return ret; 
}

At the property for the app there is only CUDA => Host => Preprocessor Definitions I put in

WIN32;uint="unsigned int"

This seemed to fix the "assumed int" but now I am getting "error : expected a declaration" Replacing uint with unsigned int in the source will compile without error. There is a lot of uint and this breaks with the linux build. Is more required besides 'uint="unsigned int"'? Maybe a switch to cause the NVCC to accept the uint and not give an error?

Just discovered a lot of ushort and I am guessing the same problem. Also, looking at the Linux build, the source were compiled with gcc but the link was done with nvcc so there is a difference.

====sample CUDA has ushort==== i must have not set up the include correctly as these variables are probably ok to use.

1
What is wrong with old fashioned typedef unsigned int uint;, or simple #define uint unsigned int? - tera
Nothing wrong with that. The folks who maintain the Linux version of the code will simple remove it. Hopefully they will remove it after I have built my windows version. - Joseph Stateson

1 Answers

1
votes

I gave up trying to define uint or ushort as the sample CUDA programs had

typedef unsigned int uint;
typedef unsigned short ushort;

so I just put those in each cu file that needed it.