OptiX  3.9
NVIDIA OptiX Acceleration Engine
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
optix_cuda_interop.h
Go to the documentation of this file.
1 
2 /*
3  * Copyright (c) 2012 NVIDIA Corporation. All rights reserved.
4  *
5  * NVIDIA Corporation and its licensors retain all intellectual property and proprietary
6  * rights in and to this software, related documentation and any modifications thereto.
7  * Any use, reproduction, disclosure or distribution of this software and related
8  * documentation without an express license agreement from NVIDIA Corporation is strictly
9  * prohibited.
10  *
11  * TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED *AS IS*
12  * AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS OR IMPLIED,
13  * INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
14  * PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS BE LIABLE FOR ANY
15  * SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT
16  * LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF
17  * BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR
18  * INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF
19  * SUCH DAMAGES
20  */
21 
30 #ifndef __optix_optix_cuda_interop_h__
31 #define __optix_optix_cuda_interop_h__
32 
33 #include "optix.h"
34 
35 #if defined(__x86_64) || defined(AMD64) || defined(_M_AMD64)
36 typedef unsigned long long CUdeviceptr;
37 #else
38 typedef unsigned int CUdeviceptr;
39 #endif
40 
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
113  RTresult RTAPI rtBufferCreateForCUDA (RTcontext context, unsigned int bufferdesc, RTbuffer *buffer);
114 
149  RTresult RTAPI rtBufferGetDevicePointer (RTbuffer buffer, unsigned int optix_device_number, void** device_pointer);
150 
183  RTresult RTAPI rtBufferMarkDirty (RTbuffer buffer);
184 
222  RTresult RTAPI rtBufferSetDevicePointer (RTbuffer buffer, unsigned int optix_device_number, CUdeviceptr device_pointer);
223 
224 #ifdef __cplusplus
225 }
226 #endif
227 
228 #endif /* __optix_optix_cuda_interop_h__ */
RTresult
Definition: optix_declarations.h:236
RTresult RTAPI rtBufferCreateForCUDA(RTcontext context, unsigned int bufferdesc, RTbuffer *buffer)
Creates a new buffer object that will later rely on user-side CUDA allocation.
RTresult RTAPI rtBufferGetDevicePointer(RTbuffer buffer, unsigned int optix_device_number, void **device_pointer)
Gets the pointer to the buffer's data on the given device.
struct RTbuffer_api * RTbuffer
Definition: optix_host.h:69
RTresult RTAPI rtBufferMarkDirty(RTbuffer buffer)
Sets a buffer as dirty.
RTresult RTAPI rtBufferSetDevicePointer(RTbuffer buffer, unsigned int optix_device_number, CUdeviceptr device_pointer)
Sets the pointer to the buffer's data on the given device.
struct RTcontext_api * RTcontext
Definition: optix_host.h:72
OptiX public API header.