I have Nvidia geforce 310M and when i write this code
int main()
{
int dev;
cudaDeviceProp prop;
cudaGetDevice(&dev);
cudaGetDeviceProperties(&prop,dev);
cout << "Device name " << prop.name << endl;
cout << "warp size = " << prop.warpSize << endl;
cout << "mutiprocesosrs = " << prop.multiProcessorCount << endl;
return 0;
}
it writes :
Device name ♀
warp size = -2144521342
mutiprocesosrs = 0
Press any key to continue . . .
and every time i run this program it produces different warp size.
how can i fix that ?
(p.s. I’m using visual studio 2010)
Check first of all whether the function calls succeed!
I made a little macro I use for calling all CUDA functions which takes care of the checking and throws a custom exception:
With this, I just say,
The exception class is defined as follows: