[Bf-blender-cvs] [ef16510] opensubdiv-modifier: Compilation fixes on Windows
Sergey Sharybin
noreply at git.blender.org
Fri May 30 21:39:38 CEST 2014
Commit: ef165104bfa1bd7dbac9a0ed2de10df3ee7c11a3
Author: Sergey Sharybin
Date: Sat May 31 01:38:45 2014 +0600
https://developer.blender.org/rBef165104bfa1bd7dbac9a0ed2de10df3ee7c11a3
Compilation fixes on Windows
Now both scons and cmake are tested building
with msvc2013 64bit.
===================================================================
M extern/cuew/src/cuew.c
M intern/opensubdiv/cudaInit.h
===================================================================
diff --git a/extern/cuew/src/cuew.c b/extern/cuew/src/cuew.c
index f7da718..30d7d0c 100644
--- a/extern/cuew/src/cuew.c
+++ b/extern/cuew/src/cuew.c
@@ -16,7 +16,10 @@
#include "cuew.h"
#include <assert.h>
-#include <dlfcn.h>
+
+#ifndef _WIN32
+# include <dlfcn.h>
+#endif
/* function defininitions */
diff --git a/intern/opensubdiv/cudaInit.h b/intern/opensubdiv/cudaInit.h
index 40f6c49..91f73e3 100644
--- a/intern/opensubdiv/cudaInit.h
+++ b/intern/opensubdiv/cudaInit.h
@@ -71,7 +71,7 @@ inline int cutGetMaxGflopsDeviceId()
int device_count = 0, best_SM_arch = 0;
int compat_major, compat_minor;
- cuDeviceGetCount( &device_count );
+ cuda_assert(cuDeviceGetCount( &device_count ));
// Find the best major SM Architecture GPU device
while ( current_device < device_count ) {
cuDeviceComputeCapability( &compat_major, &compat_minor, current_device );
@@ -130,6 +130,9 @@ static bool HAS_CUDA_VERSION_4_0 () {
fprintf(stderr, "Loading CUDA failed.\n");
}
# endif
+ // Need to initialize CUDA here so getting device
+ // with the maximum FPLOS works fine.
+ cuda_assert(cuInit(0));
// This is to deal with cases like NVidia Optimus,
// when there might be CUDA library installed but
More information about the Bf-blender-cvs
mailing list