- client (Win) look for CUDA as nvcuda.dll

svn path=/trunk/boinc/; revision=15372
This commit is contained in:
David Anderson 2008-06-06 15:43:05 +00:00
parent 304c1dc934
commit f0cb602f42
2 changed files with 10 additions and 1 deletions

View File

@ -4728,3 +4728,9 @@ David 5 June 2008
util.inc
util_basics.inc (new)
xml.inc
David 6 June 2008
- client (Win) look for CUDA as nvcuda.dll
lib/
coproc.C

View File

@ -102,6 +102,7 @@ void COPROC_CUDA::get(COPROCS& coprocs) {
int (__stdcall* __cudaGetDeviceProperties) ( cudaDeviceProp*, int );
int bufsize=256;
char buf[256], path[256];
#if 0
HKEY key;
retval = RegOpenKeyEx(
HKEY_LOCAL_MACHINE,
@ -115,8 +116,10 @@ void COPROC_CUDA::get(COPROCS& coprocs) {
RegCloseKey(key);
if (retval != ERROR_SUCCESS) return;
sprintf(path, "%s\\bin\\cudart.dll", buf);
HMODULE cudalib = LoadLibrary(path);
#else
HMODULE cudalib = LoadLibrary("nvcuda.dll");
#endif
__cudaGetDeviceCount = (int(__stdcall*)(int*)) GetProcAddress(cudalib, "cudaGetDeviceCount");
if(!__cudaGetDeviceCount) return;
__cudaGetDeviceProperties = (int(__stdcall*)(cudaDeviceProp*, int)) GetProcAddress( cudalib, "cudaGetDeviceProperties" );