From a3c40912153235508aaccbd310f247073029becb Mon Sep 17 00:00:00 2001 From: Patrick Mours Date: Thu, 3 Dec 2020 15:20:50 +0100 Subject: 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. --- intern/cycles/kernel/kernels/cpu/kernel_cpu_image.h | 1 + intern/cycles/kernel/kernels/cuda/kernel_cuda_image.h | 2 ++ 2 files changed, 3 insertions(+) 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 # include #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 -- cgit v1.2.3