Fix Cycles kernel compile error with NanoVDB because of type redefinition

Cycles defines some basic integer types since it cannot use the standard headers when
compiling with NVRTC. NanoVDB however only does this when the "__CUDACC_RTC__" define
is set and otherwise includes the standard "stdint.h" header which clashes with those typedefs.
So for compatibility do the same thing in the Cycles kernel headers. See also T81454.
This commit is contained in:
Patrick Mours 2020-11-02 18:00:13 +01:00
parent 1408052781
commit cf7343a355
2 changed files with 8 additions and 0 deletions

@ -32,8 +32,12 @@
/* Manual definitions so we can compile without CUDA toolkit. */
#ifdef __CUDACC_RTC__
typedef unsigned int uint32_t;
typedef unsigned long long uint64_t;
#else
# include <stdint.h>
#endif
typedef unsigned short half;
typedef unsigned long long CUtexObject;

@ -31,8 +31,12 @@
# define ATTR_FALLTHROUGH
#endif
#ifdef __CUDACC_RTC__
typedef unsigned int uint32_t;
typedef unsigned long long uint64_t;
#else
# include <stdint.h>
#endif
typedef unsigned short half;
typedef unsigned long long CUtexObject;