Hack-fix for crash-by-assertion on mingw builds on startup if the CUDA driver on

the computer is too old (and probably can't be upgraded to a version that does)
to support the cuDriverGetVersion method.
This commit is contained in:
2011-11-12 03:59:45 +00:00
parent 0f85990d4a
commit 4e83c67baa

View File

@@ -147,6 +147,8 @@ tcuCtxSetCurrent *cuCtxSetCurrent;
CCL_NAMESPACE_BEGIN
/* utility macros */
#define CUDA_LIBRARY_FIND_CHECKED(name) \
name = (t##name*)dynamic_library_find(lib, #name);
#define CUDA_LIBRARY_FIND(name) \
name = (t##name*)dynamic_library_find(lib, #name); \
@@ -188,7 +190,7 @@ bool cuLibraryInit()
/* detect driver version */
int driver_version = 1000;
CUDA_LIBRARY_FIND(cuDriverGetVersion);
CUDA_LIBRARY_FIND_CHECKED(cuDriverGetVersion);
if(cuDriverGetVersion)
cuDriverGetVersion(&driver_version);