Do not use CUDA on emulation devices.

This commit is contained in:
castano 2007-12-12 21:55:28 +00:00
parent 670310e558
commit 5946514408

View File

@ -74,11 +74,24 @@ bool nv::cuda::isHardwarePresent()
{ {
#if defined HAVE_CUDA #if defined HAVE_CUDA
#if NV_OS_WIN32 #if NV_OS_WIN32
return !isWindowsVista() && deviceCount() > 0; if (isWindowsVista()) return false;
//return !isWindowsVista() && isWow32() && deviceCount() > 0; //if (isWindowsVista() || !isWow32()) return false;
#else
return deviceCount() > 0;
#endif #endif
int count = deviceCount();
if (count == 1)
{
// Make sure it's not an emulation device.
cudaDeviceProp deviceProp;
cudaGetDeviceProperties(&deviceProp, 0);
// deviceProp.name != Device Emulation (CPU)
if (deviceProp.major == -1 || deviceProp.minor == -1)
{
return false;
}
}
return count > 0;
#else #else
return false; return false;
#endif #endif