Fix Cycles CUDA render errors with CUDA 9.2.
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Thu, 21 Jun 2018 09:29:09 +0000 (11:29 +0200)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Thu, 21 Jun 2018 10:32:32 +0000 (12:32 +0200)
Work around what might be a compiler bug.

intern/cycles/device/device_cuda.cpp
intern/cycles/kernel/closure/bsdf.h

index 9d893ee61ad1970539c29963b442962cb8e072b9..bf5a95dd2337685709329c3620b6740bfd23d491 100644 (file)
@@ -385,7 +385,7 @@ public:
                VLOG(1) << "Found nvcc " << nvcc
                        << ", CUDA version " << cuda_version
                        << ".";
-               const int major = cuda_version / 10, minor = cuda_version & 10;
+               const int major = cuda_version / 10, minor = cuda_version % 10;
                if(cuda_version == 0) {
                        cuda_error_message("CUDA nvcc compiler version could not be parsed.");
                        return false;
index d8ff69ca2417d091405d671f9e77f92df28e1ad2..c1b02cd4be153f209902322482abdfb1a650e74c 100644 (file)
@@ -72,15 +72,15 @@ ccl_device_inline float bsdf_get_roughness_squared(const ShaderClosure *sc)
        return bsdf_get_specular_roughness_squared(sc);
 }
 
-ccl_device_forceinline int bsdf_sample(KernelGlobals *kg,
-                                       ShaderData *sd,
-                                       const ShaderClosure *sc,
-                                       float randu,
-                                       float randv,
-                                       float3 *eval,
-                                       float3 *omega_in,
-                                       differential3 *domega_in,
-                                       float *pdf)
+ccl_device_inline int bsdf_sample(KernelGlobals *kg,
+                                  ShaderData *sd,
+                                  const ShaderClosure *sc,
+                                  float randu,
+                                  float randv,
+                                  float3 *eval,
+                                  float3 *omega_in,
+                                  differential3 *domega_in,
+                                  float *pdf)
 {
        int label;
 
@@ -210,7 +210,7 @@ ccl_device_forceinline int bsdf_sample(KernelGlobals *kg,
 #ifndef __KERNEL_CUDA__
 ccl_device
 #else
-ccl_device_forceinline
+ccl_device_inline
 #endif
 float3 bsdf_eval(KernelGlobals *kg,
                  ShaderData *sd,