Blender V4.3
cycles/device/optix/util.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2011-2022 Blender Foundation
2 *
3 * SPDX-License-Identifier: Apache-2.0 */
4
5#pragma once
6
7#ifdef WITH_OPTIX
8
9# include "device/cuda/util.h"
10
11# ifdef WITH_CUDA_DYNLOAD
12# include <cuew.h>
13// Do not use CUDA SDK headers when using CUEW
14# define OPTIX_DONT_INCLUDE_CUDA
15# endif
16
17# include <optix_stubs.h>
18
19/* Utility for checking return values of OptiX function calls. */
20# define optix_device_assert(optix_device, stmt) \
21 { \
22 OptixResult result = stmt; \
23 if (result != OPTIX_SUCCESS) { \
24 const char *name = optixGetErrorName(result); \
25 optix_device->set_error( \
26 string_printf("%s in %s (%s:%d)", name, #stmt, __FILE__, __LINE__)); \
27 } \
28 } \
29 (void)0
30
31# define optix_assert(stmt) optix_device_assert(this, stmt)
32
33#endif /* WITH_OPTIX */