diff options
author | Patrick Mours <pmours@nvidia.com> | 2020-12-03 17:20:50 +0300 |
---|---|---|
committer | Patrick Mours <pmours@nvidia.com> | 2020-12-03 17:20:50 +0300 |
commit | a3c40912153235508aaccbd310f247073029becb (patch) | |
tree | ed4119cdc89e5f22d4d89f6cffa0f3fba6ddcabf | |
parent | 5d1308262218db60e22088bd7f16587cf28148e0 (diff) |
Fix Cycles device kernels containing debug assertation code
NanoVDB includes "assert.h" and makes use of "assert" in several places and since the compile
pipeline for CUDA/OptiX kernels does not define "NDEBUG" for release builds, those debug
checks were always added. This is not intended, so this patch disables "assert" for CUDA/OptiX
by defining "NDEBUG" before including NanoVDB headers.
This also fixes a warning about unknown pragmas in NanoVDB thrown by the CUDA compiler.
-rw-r--r-- | intern/cycles/kernel/kernels/cpu/kernel_cpu_image.h | 1 | ||||
-rw-r--r-- | intern/cycles/kernel/kernels/cuda/kernel_cuda_image.h | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/intern/cycles/kernel/kernels/cpu/kernel_cpu_image.h b/intern/cycles/kernel/kernels/cpu/kernel_cpu_image.h index 44c658d4cab..59b96c86c50 100644 --- a/intern/cycles/kernel/kernels/cpu/kernel_cpu_image.h +++ b/intern/cycles/kernel/kernels/cpu/kernel_cpu_image.h @@ -18,6 +18,7 @@ #define __KERNEL_CPU_IMAGE_H__ #ifdef WITH_NANOVDB +# define NANOVDB_USE_INTRINSICS # include <nanovdb/NanoVDB.h> # include <nanovdb/util/SampleFromVoxels.h> #endif diff --git a/intern/cycles/kernel/kernels/cuda/kernel_cuda_image.h b/intern/cycles/kernel/kernels/cuda/kernel_cuda_image.h index 001bc652810..82ad9225fc3 100644 --- a/intern/cycles/kernel/kernels/cuda/kernel_cuda_image.h +++ b/intern/cycles/kernel/kernels/cuda/kernel_cuda_image.h @@ -15,6 +15,8 @@ */ #ifdef WITH_NANOVDB +# define NDEBUG /* Disable "assert" in device code */ +# define NANOVDB_USE_INTRINSICS # include "nanovdb/NanoVDB.h" # include "nanovdb/util/SampleFromVoxels.h" #endif |