OWL
Loading...
Searching...
No Matches
optix.h
1// ======================================================================== //
2// Copyright 2019-2020 Ingo Wald //
3// //
4// Licensed under the Apache License, Version 2.0 (the "License"); //
5// you may not use this file except in compliance with the License. //
6// You may obtain a copy of the License at //
7// //
8// http://www.apache.org/licenses/LICENSE-2.0 //
9// //
10// Unless required by applicable law or agreed to in writing, software //
11// distributed under the License is distributed on an "AS IS" BASIS, //
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //
13// See the License for the specific language governing permissions and //
14// limitations under the License. //
15// ======================================================================== //
16
17#pragma once
18
19#include "owl/helper/cuda.h"
20
21#ifdef _WIN32
22#pragma warning( push )
23#pragma warning( disable : 4996 )
24#endif
25
26#include <optix.h>
27#include <optix_function_table.h>
28#include <optix_stubs.h>
29
30#ifdef _WIN32
31#pragma warning( push )
32#endif
33
34#define OPTIX_CHECK( call ) \
35 { \
36 OptixResult res = call; \
37 if( res != OPTIX_SUCCESS ) \
38 { \
39 fprintf( stderr, "Optix call (%s) failed with code %d (line %d)\n", #call, res, __LINE__ ); \
40 exit( 2 ); \
41 } \
42 }
43
44#define OPTIX_CHECK_LOG( call ) \
45 { \
46 OptixResult res = call; \
47 if( res != OPTIX_SUCCESS ) \
48 { \
49 fprintf( stderr, "Optix call (%s) failed with code %d (line %d)\n", #call, res, __LINE__ ); \
50 fprintf( stderr, "Log:\n%s\n", log ); \
51 exit( 2 ); \
52 } \
53 }
54
55#define OPTIX_CALL( call ) OPTIX_CHECK(optix##call)
56