OSDN Git Service

new file: Integration/Tomography/Makefile.recent
[eos/hostdependX86LINUX64.git] / util / X86MAC64 / cuda / include / cuda_gl_interop.h
1 /*
2  * Copyright 1993-2009 NVIDIA Corporation.  All rights reserved.
3  *
4  * NOTICE TO USER:   
5  *
6  * This source code is subject to NVIDIA ownership rights under U.S. and 
7  * international Copyright laws.  Users and possessors of this source code 
8  * are hereby granted a nonexclusive, royalty-free license to use this code 
9  * in individual and commercial software.
10  *
11  * NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOURCE 
12  * CODE FOR ANY PURPOSE.  IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR 
13  * IMPLIED WARRANTY OF ANY KIND.  NVIDIA DISCLAIMS ALL WARRANTIES WITH 
14  * REGARD TO THIS SOURCE CODE, INCLUDING ALL IMPLIED WARRANTIES OF 
15  * MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
16  * IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL, 
17  * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS 
18  * OF USE, DATA OR PROFITS,  WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 
19  * OR OTHER TORTIOUS ACTION,  ARISING OUT OF OR IN CONNECTION WITH THE USE 
20  * OR PERFORMANCE OF THIS SOURCE CODE.  
21  *
22  * U.S. Government End Users.   This source code is a "commercial item" as 
23  * that term is defined at  48 C.F.R. 2.101 (OCT 1995), consisting  of 
24  * "commercial computer  software"  and "commercial computer software 
25  * documentation" as such terms are  used in 48 C.F.R. 12.212 (SEPT 1995) 
26  * and is provided to the U.S. Government only as a commercial end item.  
27  * Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through 
28  * 227.7202-4 (JUNE 1995), all U.S. Government End Users acquire the 
29  * source code with only those rights set forth herein. 
30  *
31  * Any use of this source code in individual and commercial software must 
32  * include, in the user documentation and internal comments to the code,
33  * the above Disclaimer and U.S. Government End Users Notice.
34  */
35
36 #if !defined(__CUDA_GL_INTEROP_H__)
37 #define __CUDA_GL_INTEROP_H__
38
39 /*******************************************************************************
40 *                                                                              *
41 *                                                                              *
42 *                                                                              *
43 *******************************************************************************/
44
45 #include "host_defines.h"
46
47 #if defined(__APPLE__)
48
49 #include <OpenGL/gl.h>
50
51 #else /* __APPLE__ */
52
53 #include <GL/gl.h>
54
55 #endif /* __APPLE__ */
56
57 #if defined(__cplusplus)
58 extern "C" {
59 #endif /* __cplusplus */
60
61 /*******************************************************************************
62 *                                                                              *
63 *                                                                              *
64 *                                                                              *
65 *******************************************************************************/
66
67 extern __host__ cudaError_t CUDARTAPI cudaGLSetGLDevice(int device);
68 extern __host__ cudaError_t CUDARTAPI cudaGLRegisterBufferObject(GLuint bufObj);
69 extern __host__ cudaError_t CUDARTAPI cudaGLMapBufferObject(void **devPtr, GLuint bufObj);
70 extern __host__ cudaError_t CUDARTAPI cudaGLUnmapBufferObject(GLuint bufObj);
71 extern __host__ cudaError_t CUDARTAPI cudaGLUnregisterBufferObject(GLuint bufObj);
72 #ifdef _WIN32
73 #ifndef WGL_NV_gpu_affinity
74 typedef void* HGPUNV;
75 #endif
76 extern __host__ cudaError_t CUDARTAPI cudaWGLGetDevice(int *device, HGPUNV hGpu);
77 #endif
78
79 #if defined(__cplusplus)
80 }
81 #endif /* __cplusplus */
82
83 #endif /* __CUDA_GL_INTEROP_H__ */