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.
This commit is contained in:
Patrick Mours 2020-12-03 15:20:50 +01:00
parent 5d13082622
commit a3c4091215
2 changed files with 3 additions and 0 deletions

View File

@ -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

View File

@ -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