cycles: Add an nvrtc based cubin cli compiler.
[blender.git] / extern / cuew / include / cuew.h
1 /*
2  * Copyright 2011-2014 Blender Foundation
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 #ifndef __CUEW_H__
18 #define __CUEW_H__
19
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23
24 #include <stdlib.h>
25
26 /* Defines. */
27 #define CUEW_VERSION_MAJOR 1
28 #define CUEW_VERSION_MINOR 2
29
30 #define CUDA_VERSION 8000
31 #define CU_IPC_HANDLE_SIZE 64
32 #define CU_STREAM_LEGACY ((CUstream)0x1)
33 #define CU_STREAM_PER_THREAD ((CUstream)0x2)
34 #define CU_MEMHOSTALLOC_PORTABLE 0x01
35 #define CU_MEMHOSTALLOC_DEVICEMAP 0x02
36 #define CU_MEMHOSTALLOC_WRITECOMBINED 0x04
37 #define CU_MEMHOSTREGISTER_PORTABLE 0x01
38 #define CU_MEMHOSTREGISTER_DEVICEMAP 0x02
39 #define CU_MEMHOSTREGISTER_IOMEMORY 0x04
40 #define CUDA_ARRAY3D_LAYERED 0x01
41 #define CUDA_ARRAY3D_2DARRAY 0x01
42 #define CUDA_ARRAY3D_SURFACE_LDST 0x02
43 #define CUDA_ARRAY3D_CUBEMAP 0x04
44 #define CUDA_ARRAY3D_TEXTURE_GATHER 0x08
45 #define CUDA_ARRAY3D_DEPTH_TEXTURE 0x10
46 #define CU_TRSA_OVERRIDE_FORMAT 0x01
47 #define CU_TRSF_READ_AS_INTEGER 0x01
48 #define CU_TRSF_NORMALIZED_COORDINATES 0x02
49 #define CU_TRSF_SRGB 0x10
50 #define CU_LAUNCH_PARAM_END ((void*)0x00)
51 #define CU_LAUNCH_PARAM_BUFFER_POINTER ((void*)0x01)
52 #define CU_LAUNCH_PARAM_BUFFER_SIZE ((void*)0x02)
53 #define CU_PARAM_TR_DEFAULT -1
54 #define CU_DEVICE_CPU ((CUdevice)-1)
55 #define CU_DEVICE_INVALID ((CUdevice)-2)
56
57 /* Functions which changed 3.1 -> 3.2 for 64 bit stuff,
58  * the cuda library has both the old ones for compatibility and new
59  * ones with _v2 postfix,
60  */
61 #define cuDeviceTotalMem cuDeviceTotalMem_v2
62 #define cuCtxCreate cuCtxCreate_v2
63 #define cuModuleGetGlobal cuModuleGetGlobal_v2
64 #define cuMemGetInfo cuMemGetInfo_v2
65 #define cuMemAlloc cuMemAlloc_v2
66 #define cuMemAllocPitch cuMemAllocPitch_v2
67 #define cuMemFree cuMemFree_v2
68 #define cuMemGetAddressRange cuMemGetAddressRange_v2
69 #define cuMemAllocHost cuMemAllocHost_v2
70 #define cuMemHostGetDevicePointer cuMemHostGetDevicePointer_v2
71 #define cuMemcpyHtoD cuMemcpyHtoD_v2
72 #define cuMemcpyDtoH cuMemcpyDtoH_v2
73 #define cuMemcpyDtoD cuMemcpyDtoD_v2
74 #define cuMemcpyDtoA cuMemcpyDtoA_v2
75 #define cuMemcpyAtoD cuMemcpyAtoD_v2
76 #define cuMemcpyHtoA cuMemcpyHtoA_v2
77 #define cuMemcpyAtoH cuMemcpyAtoH_v2
78 #define cuMemcpyAtoA cuMemcpyAtoA_v2
79 #define cuMemcpyHtoAAsync cuMemcpyHtoAAsync_v2
80 #define cuMemcpyAtoHAsync cuMemcpyAtoHAsync_v2
81 #define cuMemcpy2D cuMemcpy2D_v2
82 #define cuMemcpy2DUnaligned cuMemcpy2DUnaligned_v2
83 #define cuMemcpy3D cuMemcpy3D_v2
84 #define cuMemcpyHtoDAsync cuMemcpyHtoDAsync_v2
85 #define cuMemcpyDtoHAsync cuMemcpyDtoHAsync_v2
86 #define cuMemcpyDtoDAsync cuMemcpyDtoDAsync_v2
87 #define cuMemcpy2DAsync cuMemcpy2DAsync_v2
88 #define cuMemcpy3DAsync cuMemcpy3DAsync_v2
89 #define cuMemsetD8 cuMemsetD8_v2
90 #define cuMemsetD16 cuMemsetD16_v2
91 #define cuMemsetD32 cuMemsetD32_v2
92 #define cuMemsetD2D8 cuMemsetD2D8_v2
93 #define cuMemsetD2D16 cuMemsetD2D16_v2
94 #define cuMemsetD2D32 cuMemsetD2D32_v2
95 #define cuArrayCreate cuArrayCreate_v2
96 #define cuArrayGetDescriptor cuArrayGetDescriptor_v2
97 #define cuArray3DCreate cuArray3DCreate_v2
98 #define cuArray3DGetDescriptor cuArray3DGetDescriptor_v2
99 #define cuTexRefSetAddress cuTexRefSetAddress_v2
100 #define cuTexRefGetAddress cuTexRefGetAddress_v2
101 #define cuGraphicsResourceGetMappedPointer cuGraphicsResourceGetMappedPointer_v2
102 #define cuCtxDestroy cuCtxDestroy_v2
103 #define cuCtxPopCurrent cuCtxPopCurrent_v2
104 #define cuCtxPushCurrent cuCtxPushCurrent_v2
105 #define cuStreamDestroy cuStreamDestroy_v2
106 #define cuEventDestroy cuEventDestroy_v2
107 #define cuLinkCreate cuLinkCreate_v2
108 #define cuLinkAddData cuLinkAddData_v2
109 #define cuLinkAddFile cuLinkAddFile_v2
110 #define cuMemHostRegister cuMemHostRegister_v2
111 #define cuGraphicsResourceSetMapFlags cuGraphicsResourceSetMapFlags_v2
112 #define cuTexRefSetAddress2D cuTexRefSetAddress2D_v2
113 #define cuGLCtxCreate cuGLCtxCreate_v2
114 #define cuGLMapBufferObject cuGLMapBufferObject_v2
115 #define cuGLMapBufferObjectAsync cuGLMapBufferObjectAsync_v2
116 #define cuGLGetDevices cuGLGetDevices_v2
117
118 /* Types. */
119 #ifdef _MSC_VER
120 typedef unsigned __int32 cuuint32_t;
121 typedef unsigned __int64 cuuint64_t;
122 #else
123 #include <stdint.h>
124 typedef uint32_t cuuint32_t;
125 typedef uint64_t cuuint64_t;
126 #endif
127
128 #if defined(__x86_64) || defined(AMD64) || defined(_M_AMD64) || defined (__aarch64__)
129 typedef unsigned long long CUdeviceptr;
130 #else
131 typedef unsigned int CUdeviceptr;
132 #endif
133
134
135 #ifdef _WIN32
136 #  define CUDAAPI __stdcall
137 #  define CUDA_CB __stdcall
138 #else
139 #  define CUDAAPI
140 #  define CUDA_CB
141 #endif
142
143 typedef int CUdevice;
144 typedef struct CUctx_st* CUcontext;
145 typedef struct CUmod_st* CUmodule;
146 typedef struct CUfunc_st* CUfunction;
147 typedef struct CUarray_st* CUarray;
148 typedef struct CUmipmappedArray_st* CUmipmappedArray;
149 typedef struct CUtexref_st* CUtexref;
150 typedef struct CUsurfref_st* CUsurfref;
151 typedef struct CUevent_st* CUevent;
152 typedef struct CUstream_st* CUstream;
153 typedef struct CUgraphicsResource_st* CUgraphicsResource;
154 typedef unsigned long long CUtexObject;
155 typedef unsigned long long CUsurfObject;
156
157 typedef struct CUuuid_st {
158   char bytes[16];
159 } CUuuid;
160
161 typedef struct CUipcEventHandle_st {
162   char reserved[CU_IPC_HANDLE_SIZE];
163 } CUipcEventHandle;
164
165 typedef struct CUipcMemHandle_st {
166   char reserved[CU_IPC_HANDLE_SIZE];
167 } CUipcMemHandle;
168
169 typedef enum CUipcMem_flags_enum {
170   CU_IPC_MEM_LAZY_ENABLE_PEER_ACCESS = 0x1,
171 } CUipcMem_flags;
172
173 typedef enum CUmemAttach_flags_enum {
174   CU_MEM_ATTACH_GLOBAL = 0x1,
175   CU_MEM_ATTACH_HOST = 0x2,
176   CU_MEM_ATTACH_SINGLE = 0x4,
177 } CUmemAttach_flags;
178
179 typedef enum CUctx_flags_enum {
180   CU_CTX_SCHED_AUTO = 0x00,
181   CU_CTX_SCHED_SPIN = 0x01,
182   CU_CTX_SCHED_YIELD = 0x02,
183   CU_CTX_SCHED_BLOCKING_SYNC = 0x04,
184   CU_CTX_BLOCKING_SYNC = 0x04,
185   CU_CTX_SCHED_MASK = 0x07,
186   CU_CTX_MAP_HOST = 0x08,
187   CU_CTX_LMEM_RESIZE_TO_MAX = 0x10,
188   CU_CTX_FLAGS_MASK = 0x1f,
189 } CUctx_flags;
190
191 typedef enum CUstream_flags_enum {
192   CU_STREAM_DEFAULT = 0x0,
193   CU_STREAM_NON_BLOCKING = 0x1,
194 } CUstream_flags;
195
196 typedef enum CUevent_flags_enum {
197   CU_EVENT_DEFAULT = 0x0,
198   CU_EVENT_BLOCKING_SYNC = 0x1,
199   CU_EVENT_DISABLE_TIMING = 0x2,
200   CU_EVENT_INTERPROCESS = 0x4,
201 } CUevent_flags;
202
203 typedef enum CUstreamWaitValue_flags_enum {
204   CU_STREAM_WAIT_VALUE_GEQ = 0x0,
205   CU_STREAM_WAIT_VALUE_EQ = 0x1,
206   CU_STREAM_WAIT_VALUE_AND = 0x2,
207   CU_STREAM_WAIT_VALUE_FLUSH = (1 << 30),
208 } CUstreamWaitValue_flags;
209
210 typedef enum CUstreamWriteValue_flags_enum {
211   CU_STREAM_WRITE_VALUE_DEFAULT = 0x0,
212   CU_STREAM_WRITE_VALUE_NO_MEMORY_BARRIER = 0x1,
213 } CUstreamWriteValue_flags;
214
215 typedef enum CUstreamBatchMemOpType_enum {
216   CU_STREAM_MEM_OP_WAIT_VALUE_32 = 1,
217   CU_STREAM_MEM_OP_WRITE_VALUE_32 = 2,
218   CU_STREAM_MEM_OP_FLUSH_REMOTE_WRITES = 3,
219 } CUstreamBatchMemOpType;
220
221 typedef union CUstreamBatchMemOpParams_union {
222   CUstreamBatchMemOpType operation;
223   struct CUstreamMemOpWaitValueParams_st {
224     CUstreamBatchMemOpType operation;
225     CUdeviceptr address;
226     union {
227       cuuint32_t value;
228       cuuint64_t pad;
229     };
230     unsigned int flags;
231     CUdeviceptr alias;
232   } waitValue;
233   struct CUstreamMemOpWriteValueParams_st {
234     CUstreamBatchMemOpType operation;
235     CUdeviceptr address;
236     union {
237       cuuint32_t value;
238       cuuint64_t pad;
239     };
240     unsigned int flags;
241     CUdeviceptr alias;
242   } writeValue;
243   struct CUstreamMemOpFlushRemoteWritesParams_st {
244     CUstreamBatchMemOpType operation;
245     unsigned int flags;
246   } flushRemoteWrites;
247   cuuint64_t pad[6];
248 } CUstreamBatchMemOpParams;
249
250 typedef enum CUoccupancy_flags_enum {
251   CU_OCCUPANCY_DEFAULT = 0x0,
252   CU_OCCUPANCY_DISABLE_CACHING_OVERRIDE = 0x1,
253 } CUoccupancy_flags;
254
255 typedef enum CUarray_format_enum {
256   CU_AD_FORMAT_UNSIGNED_INT8 = 0x01,
257   CU_AD_FORMAT_UNSIGNED_INT16 = 0x02,
258   CU_AD_FORMAT_UNSIGNED_INT32 = 0x03,
259   CU_AD_FORMAT_SIGNED_INT8 = 0x08,
260   CU_AD_FORMAT_SIGNED_INT16 = 0x09,
261   CU_AD_FORMAT_SIGNED_INT32 = 0x0a,
262   CU_AD_FORMAT_HALF = 0x10,
263   CU_AD_FORMAT_FLOAT = 0x20,
264 } CUarray_format;
265
266 typedef enum CUaddress_mode_enum {
267   CU_TR_ADDRESS_MODE_WRAP = 0,
268   CU_TR_ADDRESS_MODE_CLAMP = 1,
269   CU_TR_ADDRESS_MODE_MIRROR = 2,
270   CU_TR_ADDRESS_MODE_BORDER = 3,
271 } CUaddress_mode;
272
273 typedef enum CUfilter_mode_enum {
274   CU_TR_FILTER_MODE_POINT = 0,
275   CU_TR_FILTER_MODE_LINEAR = 1,
276 } CUfilter_mode;
277
278 typedef enum CUdevice_attribute_enum {
279   CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_BLOCK = 1,
280   CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_X = 2,
281   CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Y = 3,
282   CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Z = 4,
283   CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_X = 5,
284   CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_Y = 6,
285   CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_Z = 7,
286   CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK = 8,
287   CU_DEVICE_ATTRIBUTE_SHARED_MEMORY_PER_BLOCK = 8,
288   CU_DEVICE_ATTRIBUTE_TOTAL_CONSTANT_MEMORY = 9,
289   CU_DEVICE_ATTRIBUTE_WARP_SIZE = 10,
290   CU_DEVICE_ATTRIBUTE_MAX_PITCH = 11,
291   CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_BLOCK = 12,
292   CU_DEVICE_ATTRIBUTE_REGISTERS_PER_BLOCK = 12,
293   CU_DEVICE_ATTRIBUTE_CLOCK_RATE = 13,
294   CU_DEVICE_ATTRIBUTE_TEXTURE_ALIGNMENT = 14,
295   CU_DEVICE_ATTRIBUTE_GPU_OVERLAP = 15,
296   CU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT = 16,
297   CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT = 17,
298   CU_DEVICE_ATTRIBUTE_INTEGRATED = 18,
299   CU_DEVICE_ATTRIBUTE_CAN_MAP_HOST_MEMORY = 19,
300   CU_DEVICE_ATTRIBUTE_COMPUTE_MODE = 20,
301   CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_WIDTH = 21,
302   CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_WIDTH = 22,
303   CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_HEIGHT = 23,
304   CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH = 24,
305   CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT = 25,
306   CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH = 26,
307   CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_WIDTH = 27,
308   CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_HEIGHT = 28,
309   CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_LAYERS = 29,
310   CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_ARRAY_WIDTH = 27,
311   CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_ARRAY_HEIGHT = 28,
312   CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_ARRAY_NUMSLICES = 29,
313   CU_DEVICE_ATTRIBUTE_SURFACE_ALIGNMENT = 30,
314   CU_DEVICE_ATTRIBUTE_CONCURRENT_KERNELS = 31,
315   CU_DEVICE_ATTRIBUTE_ECC_ENABLED = 32,
316   CU_DEVICE_ATTRIBUTE_PCI_BUS_ID = 33,
317   CU_DEVICE_ATTRIBUTE_PCI_DEVICE_ID = 34,
318   CU_DEVICE_ATTRIBUTE_TCC_DRIVER = 35,
319   CU_DEVICE_ATTRIBUTE_MEMORY_CLOCK_RATE = 36,
320   CU_DEVICE_ATTRIBUTE_GLOBAL_MEMORY_BUS_WIDTH = 37,
321   CU_DEVICE_ATTRIBUTE_L2_CACHE_SIZE = 38,
322   CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_MULTIPROCESSOR = 39,
323   CU_DEVICE_ATTRIBUTE_ASYNC_ENGINE_COUNT = 40,
324   CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING = 41,
325   CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_WIDTH = 42,
326   CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_LAYERS = 43,
327   CU_DEVICE_ATTRIBUTE_CAN_TEX2D_GATHER = 44,
328   CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_WIDTH = 45,
329   CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_HEIGHT = 46,
330   CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH_ALTERNATE = 47,
331   CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT_ALTERNATE = 48,
332   CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH_ALTERNATE = 49,
333   CU_DEVICE_ATTRIBUTE_PCI_DOMAIN_ID = 50,
334   CU_DEVICE_ATTRIBUTE_TEXTURE_PITCH_ALIGNMENT = 51,
335   CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_WIDTH = 52,
336   CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_LAYERED_WIDTH = 53,
337   CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_LAYERED_LAYERS = 54,
338   CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_WIDTH = 55,
339   CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_WIDTH = 56,
340   CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_HEIGHT = 57,
341   CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_WIDTH = 58,
342   CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_HEIGHT = 59,
343   CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_DEPTH = 60,
344   CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_WIDTH = 61,
345   CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_LAYERS = 62,
346   CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_WIDTH = 63,
347   CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_HEIGHT = 64,
348   CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_LAYERS = 65,
349   CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_WIDTH = 66,
350   CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_WIDTH = 67,
351   CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_LAYERS = 68,
352   CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LINEAR_WIDTH = 69,
353   CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_WIDTH = 70,
354   CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_HEIGHT = 71,
355   CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_PITCH = 72,
356   CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_WIDTH = 73,
357   CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_HEIGHT = 74,
358   CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR = 75,
359   CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR = 76,
360   CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_MIPMAPPED_WIDTH = 77,
361   CU_DEVICE_ATTRIBUTE_STREAM_PRIORITIES_SUPPORTED = 78,
362   CU_DEVICE_ATTRIBUTE_GLOBAL_L1_CACHE_SUPPORTED = 79,
363   CU_DEVICE_ATTRIBUTE_LOCAL_L1_CACHE_SUPPORTED = 80,
364   CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_MULTIPROCESSOR = 81,
365   CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_MULTIPROCESSOR = 82,
366   CU_DEVICE_ATTRIBUTE_MANAGED_MEMORY = 83,
367   CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD = 84,
368   CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD_GROUP_ID = 85,
369   CU_DEVICE_ATTRIBUTE_HOST_NATIVE_ATOMIC_SUPPORTED = 86,
370   CU_DEVICE_ATTRIBUTE_SINGLE_TO_DOUBLE_PRECISION_PERF_RATIO = 87,
371   CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS = 88,
372   CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS = 89,
373   CU_DEVICE_ATTRIBUTE_COMPUTE_PREEMPTION_SUPPORTED = 90,
374   CU_DEVICE_ATTRIBUTE_CAN_USE_HOST_POINTER_FOR_REGISTERED_MEM = 91,
375   CU_DEVICE_ATTRIBUTE_MAX,
376 } CUdevice_attribute;
377
378 typedef struct CUdevprop_st {
379   int maxThreadsPerBlock;
380   int maxThreadsDim[3];
381   int maxGridSize[3];
382   int sharedMemPerBlock;
383   int totalConstantMemory;
384   int SIMDWidth;
385   int memPitch;
386   int regsPerBlock;
387   int clockRate;
388   int textureAlign;
389 } CUdevprop;
390
391 typedef enum CUpointer_attribute_enum {
392   CU_POINTER_ATTRIBUTE_CONTEXT = 1,
393   CU_POINTER_ATTRIBUTE_MEMORY_TYPE = 2,
394   CU_POINTER_ATTRIBUTE_DEVICE_POINTER = 3,
395   CU_POINTER_ATTRIBUTE_HOST_POINTER = 4,
396   CU_POINTER_ATTRIBUTE_P2P_TOKENS = 5,
397   CU_POINTER_ATTRIBUTE_SYNC_MEMOPS = 6,
398   CU_POINTER_ATTRIBUTE_BUFFER_ID = 7,
399   CU_POINTER_ATTRIBUTE_IS_MANAGED = 8,
400 } CUpointer_attribute;
401
402 typedef enum CUfunction_attribute_enum {
403   CU_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK = 0,
404   CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES = 1,
405   CU_FUNC_ATTRIBUTE_CONST_SIZE_BYTES = 2,
406   CU_FUNC_ATTRIBUTE_LOCAL_SIZE_BYTES = 3,
407   CU_FUNC_ATTRIBUTE_NUM_REGS = 4,
408   CU_FUNC_ATTRIBUTE_PTX_VERSION = 5,
409   CU_FUNC_ATTRIBUTE_BINARY_VERSION = 6,
410   CU_FUNC_ATTRIBUTE_CACHE_MODE_CA = 7,
411   CU_FUNC_ATTRIBUTE_MAX,
412 } CUfunction_attribute;
413
414 typedef enum CUfunc_cache_enum {
415   CU_FUNC_CACHE_PREFER_NONE = 0x00,
416   CU_FUNC_CACHE_PREFER_SHARED = 0x01,
417   CU_FUNC_CACHE_PREFER_L1 = 0x02,
418   CU_FUNC_CACHE_PREFER_EQUAL = 0x03,
419 } CUfunc_cache;
420
421 typedef enum CUsharedconfig_enum {
422   CU_SHARED_MEM_CONFIG_DEFAULT_BANK_SIZE = 0x00,
423   CU_SHARED_MEM_CONFIG_FOUR_BYTE_BANK_SIZE = 0x01,
424   CU_SHARED_MEM_CONFIG_EIGHT_BYTE_BANK_SIZE = 0x02,
425 } CUsharedconfig;
426
427 typedef enum CUmemorytype_enum {
428   CU_MEMORYTYPE_HOST = 0x01,
429   CU_MEMORYTYPE_DEVICE = 0x02,
430   CU_MEMORYTYPE_ARRAY = 0x03,
431   CU_MEMORYTYPE_UNIFIED = 0x04,
432 } CUmemorytype;
433
434 typedef enum CUcomputemode_enum {
435   CU_COMPUTEMODE_DEFAULT = 0,
436   CU_COMPUTEMODE_PROHIBITED = 2,
437   CU_COMPUTEMODE_EXCLUSIVE_PROCESS = 3,
438 } CUcomputemode;
439
440 typedef enum CUmem_advise_enum {
441   CU_MEM_ADVISE_SET_READ_MOSTLY = 1,
442   CU_MEM_ADVISE_UNSET_READ_MOSTLY = 2,
443   CU_MEM_ADVISE_SET_PREFERRED_LOCATION = 3,
444   CU_MEM_ADVISE_UNSET_PREFERRED_LOCATION = 4,
445   CU_MEM_ADVISE_SET_ACCESSED_BY = 5,
446   CU_MEM_ADVISE_UNSET_ACCESSED_BY = 6,
447 } CUmem_advise;
448
449 typedef enum CUmem_range_attribute_enum {
450   CU_MEM_RANGE_ATTRIBUTE_READ_MOSTLY = 1,
451   CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION = 2,
452   CU_MEM_RANGE_ATTRIBUTE_ACCESSED_BY = 3,
453   CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION = 4,
454 } CUmem_range_attribute;
455
456 typedef enum CUjit_option_enum {
457   CU_JIT_MAX_REGISTERS = 0,
458   CU_JIT_THREADS_PER_BLOCK,
459   CU_JIT_WALL_TIME,
460   CU_JIT_INFO_LOG_BUFFER,
461   CU_JIT_INFO_LOG_BUFFER_SIZE_BYTES,
462   CU_JIT_ERROR_LOG_BUFFER,
463   CU_JIT_ERROR_LOG_BUFFER_SIZE_BYTES,
464   CU_JIT_OPTIMIZATION_LEVEL,
465   CU_JIT_TARGET_FROM_CUCONTEXT,
466   CU_JIT_TARGET,
467   CU_JIT_FALLBACK_STRATEGY,
468   CU_JIT_GENERATE_DEBUG_INFO,
469   CU_JIT_LOG_VERBOSE,
470   CU_JIT_GENERATE_LINE_INFO,
471   CU_JIT_CACHE_MODE,
472   CU_JIT_NEW_SM3X_OPT,
473   CU_JIT_FAST_COMPILE,
474   CU_JIT_NUM_OPTIONS,
475 } CUjit_option;
476
477 typedef enum CUjit_target_enum {
478   CU_TARGET_COMPUTE_10 = 10,
479   CU_TARGET_COMPUTE_11 = 11,
480   CU_TARGET_COMPUTE_12 = 12,
481   CU_TARGET_COMPUTE_13 = 13,
482   CU_TARGET_COMPUTE_20 = 20,
483   CU_TARGET_COMPUTE_21 = 21,
484   CU_TARGET_COMPUTE_30 = 30,
485   CU_TARGET_COMPUTE_32 = 32,
486   CU_TARGET_COMPUTE_35 = 35,
487   CU_TARGET_COMPUTE_37 = 37,
488   CU_TARGET_COMPUTE_50 = 50,
489   CU_TARGET_COMPUTE_52 = 52,
490   CU_TARGET_COMPUTE_53 = 53,
491   CU_TARGET_COMPUTE_60 = 60,
492   CU_TARGET_COMPUTE_61 = 61,
493   CU_TARGET_COMPUTE_62 = 62,
494 } CUjit_target;
495
496 typedef enum CUjit_fallback_enum {
497   CU_PREFER_PTX = 0,
498   CU_PREFER_BINARY,
499 } CUjit_fallback;
500
501 typedef enum CUjit_cacheMode_enum {
502   CU_JIT_CACHE_OPTION_NONE = 0,
503   CU_JIT_CACHE_OPTION_CG,
504   CU_JIT_CACHE_OPTION_CA,
505 } CUjit_cacheMode;
506
507 typedef enum CUjitInputType_enum {
508   CU_JIT_INPUT_CUBIN = 0,
509   CU_JIT_INPUT_PTX,
510   CU_JIT_INPUT_FATBINARY,
511   CU_JIT_INPUT_OBJECT,
512   CU_JIT_INPUT_LIBRARY,
513   CU_JIT_NUM_INPUT_TYPES,
514 } CUjitInputType;
515
516 typedef struct CUlinkState_st* CUlinkState;
517
518 typedef enum CUgraphicsRegisterFlags_enum {
519   CU_GRAPHICS_REGISTER_FLAGS_NONE = 0x00,
520   CU_GRAPHICS_REGISTER_FLAGS_READ_ONLY = 0x01,
521   CU_GRAPHICS_REGISTER_FLAGS_WRITE_DISCARD = 0x02,
522   CU_GRAPHICS_REGISTER_FLAGS_SURFACE_LDST = 0x04,
523   CU_GRAPHICS_REGISTER_FLAGS_TEXTURE_GATHER = 0x08,
524 } CUgraphicsRegisterFlags;
525
526 typedef enum CUgraphicsMapResourceFlags_enum {
527   CU_GRAPHICS_MAP_RESOURCE_FLAGS_NONE = 0x00,
528   CU_GRAPHICS_MAP_RESOURCE_FLAGS_READ_ONLY = 0x01,
529   CU_GRAPHICS_MAP_RESOURCE_FLAGS_WRITE_DISCARD = 0x02,
530 } CUgraphicsMapResourceFlags;
531
532 typedef enum CUarray_cubemap_face_enum {
533   CU_CUBEMAP_FACE_POSITIVE_X = 0x00,
534   CU_CUBEMAP_FACE_NEGATIVE_X = 0x01,
535   CU_CUBEMAP_FACE_POSITIVE_Y = 0x02,
536   CU_CUBEMAP_FACE_NEGATIVE_Y = 0x03,
537   CU_CUBEMAP_FACE_POSITIVE_Z = 0x04,
538   CU_CUBEMAP_FACE_NEGATIVE_Z = 0x05,
539 } CUarray_cubemap_face;
540
541 typedef enum CUlimit_enum {
542   CU_LIMIT_STACK_SIZE = 0x00,
543   CU_LIMIT_PRINTF_FIFO_SIZE = 0x01,
544   CU_LIMIT_MALLOC_HEAP_SIZE = 0x02,
545   CU_LIMIT_DEV_RUNTIME_SYNC_DEPTH = 0x03,
546   CU_LIMIT_DEV_RUNTIME_PENDING_LAUNCH_COUNT = 0x04,
547   CU_LIMIT_MAX,
548 } CUlimit;
549
550 typedef enum CUresourcetype_enum {
551   CU_RESOURCE_TYPE_ARRAY = 0x00,
552   CU_RESOURCE_TYPE_MIPMAPPED_ARRAY = 0x01,
553   CU_RESOURCE_TYPE_LINEAR = 0x02,
554   CU_RESOURCE_TYPE_PITCH2D = 0x03,
555 } CUresourcetype;
556
557 typedef enum cudaError_enum {
558   CUDA_SUCCESS = 0,
559   CUDA_ERROR_INVALID_VALUE = 1,
560   CUDA_ERROR_OUT_OF_MEMORY = 2,
561   CUDA_ERROR_NOT_INITIALIZED = 3,
562   CUDA_ERROR_DEINITIALIZED = 4,
563   CUDA_ERROR_PROFILER_DISABLED = 5,
564   CUDA_ERROR_PROFILER_NOT_INITIALIZED = 6,
565   CUDA_ERROR_PROFILER_ALREADY_STARTED = 7,
566   CUDA_ERROR_PROFILER_ALREADY_STOPPED = 8,
567   CUDA_ERROR_NO_DEVICE = 100,
568   CUDA_ERROR_INVALID_DEVICE = 101,
569   CUDA_ERROR_INVALID_IMAGE = 200,
570   CUDA_ERROR_INVALID_CONTEXT = 201,
571   CUDA_ERROR_CONTEXT_ALREADY_CURRENT = 202,
572   CUDA_ERROR_MAP_FAILED = 205,
573   CUDA_ERROR_UNMAP_FAILED = 206,
574   CUDA_ERROR_ARRAY_IS_MAPPED = 207,
575   CUDA_ERROR_ALREADY_MAPPED = 208,
576   CUDA_ERROR_NO_BINARY_FOR_GPU = 209,
577   CUDA_ERROR_ALREADY_ACQUIRED = 210,
578   CUDA_ERROR_NOT_MAPPED = 211,
579   CUDA_ERROR_NOT_MAPPED_AS_ARRAY = 212,
580   CUDA_ERROR_NOT_MAPPED_AS_POINTER = 213,
581   CUDA_ERROR_ECC_UNCORRECTABLE = 214,
582   CUDA_ERROR_UNSUPPORTED_LIMIT = 215,
583   CUDA_ERROR_CONTEXT_ALREADY_IN_USE = 216,
584   CUDA_ERROR_PEER_ACCESS_UNSUPPORTED = 217,
585   CUDA_ERROR_INVALID_PTX = 218,
586   CUDA_ERROR_INVALID_GRAPHICS_CONTEXT = 219,
587   CUDA_ERROR_NVLINK_UNCORRECTABLE = 220,
588   CUDA_ERROR_INVALID_SOURCE = 300,
589   CUDA_ERROR_FILE_NOT_FOUND = 301,
590   CUDA_ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND = 302,
591   CUDA_ERROR_SHARED_OBJECT_INIT_FAILED = 303,
592   CUDA_ERROR_OPERATING_SYSTEM = 304,
593   CUDA_ERROR_INVALID_HANDLE = 400,
594   CUDA_ERROR_NOT_FOUND = 500,
595   CUDA_ERROR_NOT_READY = 600,
596   CUDA_ERROR_ILLEGAL_ADDRESS = 700,
597   CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES = 701,
598   CUDA_ERROR_LAUNCH_TIMEOUT = 702,
599   CUDA_ERROR_LAUNCH_INCOMPATIBLE_TEXTURING = 703,
600   CUDA_ERROR_PEER_ACCESS_ALREADY_ENABLED = 704,
601   CUDA_ERROR_PEER_ACCESS_NOT_ENABLED = 705,
602   CUDA_ERROR_PRIMARY_CONTEXT_ACTIVE = 708,
603   CUDA_ERROR_CONTEXT_IS_DESTROYED = 709,
604   CUDA_ERROR_ASSERT = 710,
605   CUDA_ERROR_TOO_MANY_PEERS = 711,
606   CUDA_ERROR_HOST_MEMORY_ALREADY_REGISTERED = 712,
607   CUDA_ERROR_HOST_MEMORY_NOT_REGISTERED = 713,
608   CUDA_ERROR_HARDWARE_STACK_ERROR = 714,
609   CUDA_ERROR_ILLEGAL_INSTRUCTION = 715,
610   CUDA_ERROR_MISALIGNED_ADDRESS = 716,
611   CUDA_ERROR_INVALID_ADDRESS_SPACE = 717,
612   CUDA_ERROR_INVALID_PC = 718,
613   CUDA_ERROR_LAUNCH_FAILED = 719,
614   CUDA_ERROR_NOT_PERMITTED = 800,
615   CUDA_ERROR_NOT_SUPPORTED = 801,
616   CUDA_ERROR_UNKNOWN = 999,
617 } CUresult;
618
619 typedef enum CUdevice_P2PAttribute_enum {
620   CU_DEVICE_P2P_ATTRIBUTE_PERFORMANCE_RANK = 0x01,
621   CU_DEVICE_P2P_ATTRIBUTE_ACCESS_SUPPORTED = 0x02,
622   CU_DEVICE_P2P_ATTRIBUTE_NATIVE_ATOMIC_SUPPORTED = 0x03,
623 } CUdevice_P2PAttribute;
624
625 typedef void (CUDA_CB *CUstreamCallback)(CUstream hStream, CUresult status, void* userData);
626 typedef size_t (CUDA_CB *CUoccupancyB2DSize)(int blockSize);
627
628 typedef struct CUDA_MEMCPY2D_st {
629   size_t srcXInBytes;
630   size_t srcY;
631   CUmemorytype srcMemoryType;
632   const void* srcHost;
633   CUdeviceptr srcDevice;
634   CUarray srcArray;
635   size_t srcPitch;
636   size_t dstXInBytes;
637   size_t dstY;
638   CUmemorytype dstMemoryType;
639   void* dstHost;
640   CUdeviceptr dstDevice;
641   CUarray dstArray;
642   size_t dstPitch;
643   size_t WidthInBytes;
644   size_t Height;
645 } CUDA_MEMCPY2D;
646
647 typedef struct CUDA_MEMCPY3D_st {
648   size_t srcXInBytes;
649   size_t srcY;
650   size_t srcZ;
651   size_t srcLOD;
652   CUmemorytype srcMemoryType;
653   const void* srcHost;
654   CUdeviceptr srcDevice;
655   CUarray srcArray;
656   void* reserved0;
657   size_t srcPitch;
658   size_t srcHeight;
659   size_t dstXInBytes;
660   size_t dstY;
661   size_t dstZ;
662   size_t dstLOD;
663   CUmemorytype dstMemoryType;
664   void* dstHost;
665   CUdeviceptr dstDevice;
666   CUarray dstArray;
667   void* reserved1;
668   size_t dstPitch;
669   size_t dstHeight;
670   size_t WidthInBytes;
671   size_t Height;
672   size_t Depth;
673 } CUDA_MEMCPY3D;
674
675 typedef struct CUDA_MEMCPY3D_PEER_st {
676   size_t srcXInBytes;
677   size_t srcY;
678   size_t srcZ;
679   size_t srcLOD;
680   CUmemorytype srcMemoryType;
681   const void* srcHost;
682   CUdeviceptr srcDevice;
683   CUarray srcArray;
684   CUcontext srcContext;
685   size_t srcPitch;
686   size_t srcHeight;
687   size_t dstXInBytes;
688   size_t dstY;
689   size_t dstZ;
690   size_t dstLOD;
691   CUmemorytype dstMemoryType;
692   void* dstHost;
693   CUdeviceptr dstDevice;
694   CUarray dstArray;
695   CUcontext dstContext;
696   size_t dstPitch;
697   size_t dstHeight;
698   size_t WidthInBytes;
699   size_t Height;
700   size_t Depth;
701 } CUDA_MEMCPY3D_PEER;
702
703 typedef struct CUDA_ARRAY_DESCRIPTOR_st {
704   size_t Width;
705   size_t Height;
706   CUarray_format Format;
707   unsigned int NumChannels;
708 } CUDA_ARRAY_DESCRIPTOR;
709
710 typedef struct CUDA_ARRAY3D_DESCRIPTOR_st {
711   size_t Width;
712   size_t Height;
713   size_t Depth;
714   CUarray_format Format;
715   unsigned int NumChannels;
716   unsigned int Flags;
717 } CUDA_ARRAY3D_DESCRIPTOR;
718
719 typedef struct CUDA_RESOURCE_DESC_st {
720   CUresourcetype resType;
721   union {
722     struct {
723       CUarray hArray;
724     } array;
725     struct {
726       CUmipmappedArray hMipmappedArray;
727     } mipmap;
728     struct {
729       CUdeviceptr devPtr;
730       CUarray_format format;
731       unsigned int numChannels;
732       size_t sizeInBytes;
733     } linear;
734     struct {
735       CUdeviceptr devPtr;
736       CUarray_format format;
737       unsigned int numChannels;
738       size_t width;
739       size_t height;
740       size_t pitchInBytes;
741     } pitch2D;
742     struct {
743       int reserved[32];
744     } reserved;
745   } res;
746   unsigned int flags;
747 } CUDA_RESOURCE_DESC;
748
749 typedef struct CUDA_TEXTURE_DESC_st {
750   CUaddress_mode addressMode[3];
751   CUfilter_mode filterMode;
752   unsigned int flags;
753   unsigned int maxAnisotropy;
754   CUfilter_mode mipmapFilterMode;
755   float mipmapLevelBias;
756   float minMipmapLevelClamp;
757   float maxMipmapLevelClamp;
758   float borderColor[4];
759   int reserved[12];
760 } CUDA_TEXTURE_DESC;
761
762 typedef enum CUresourceViewFormat_enum {
763   CU_RES_VIEW_FORMAT_NONE = 0x00,
764   CU_RES_VIEW_FORMAT_UINT_1X8 = 0x01,
765   CU_RES_VIEW_FORMAT_UINT_2X8 = 0x02,
766   CU_RES_VIEW_FORMAT_UINT_4X8 = 0x03,
767   CU_RES_VIEW_FORMAT_SINT_1X8 = 0x04,
768   CU_RES_VIEW_FORMAT_SINT_2X8 = 0x05,
769   CU_RES_VIEW_FORMAT_SINT_4X8 = 0x06,
770   CU_RES_VIEW_FORMAT_UINT_1X16 = 0x07,
771   CU_RES_VIEW_FORMAT_UINT_2X16 = 0x08,
772   CU_RES_VIEW_FORMAT_UINT_4X16 = 0x09,
773   CU_RES_VIEW_FORMAT_SINT_1X16 = 0x0a,
774   CU_RES_VIEW_FORMAT_SINT_2X16 = 0x0b,
775   CU_RES_VIEW_FORMAT_SINT_4X16 = 0x0c,
776   CU_RES_VIEW_FORMAT_UINT_1X32 = 0x0d,
777   CU_RES_VIEW_FORMAT_UINT_2X32 = 0x0e,
778   CU_RES_VIEW_FORMAT_UINT_4X32 = 0x0f,
779   CU_RES_VIEW_FORMAT_SINT_1X32 = 0x10,
780   CU_RES_VIEW_FORMAT_SINT_2X32 = 0x11,
781   CU_RES_VIEW_FORMAT_SINT_4X32 = 0x12,
782   CU_RES_VIEW_FORMAT_FLOAT_1X16 = 0x13,
783   CU_RES_VIEW_FORMAT_FLOAT_2X16 = 0x14,
784   CU_RES_VIEW_FORMAT_FLOAT_4X16 = 0x15,
785   CU_RES_VIEW_FORMAT_FLOAT_1X32 = 0x16,
786   CU_RES_VIEW_FORMAT_FLOAT_2X32 = 0x17,
787   CU_RES_VIEW_FORMAT_FLOAT_4X32 = 0x18,
788   CU_RES_VIEW_FORMAT_UNSIGNED_BC1 = 0x19,
789   CU_RES_VIEW_FORMAT_UNSIGNED_BC2 = 0x1a,
790   CU_RES_VIEW_FORMAT_UNSIGNED_BC3 = 0x1b,
791   CU_RES_VIEW_FORMAT_UNSIGNED_BC4 = 0x1c,
792   CU_RES_VIEW_FORMAT_SIGNED_BC4 = 0x1d,
793   CU_RES_VIEW_FORMAT_UNSIGNED_BC5 = 0x1e,
794   CU_RES_VIEW_FORMAT_SIGNED_BC5 = 0x1f,
795   CU_RES_VIEW_FORMAT_UNSIGNED_BC6H = 0x20,
796   CU_RES_VIEW_FORMAT_SIGNED_BC6H = 0x21,
797   CU_RES_VIEW_FORMAT_UNSIGNED_BC7 = 0x22,
798 } CUresourceViewFormat;
799
800 typedef struct CUDA_RESOURCE_VIEW_DESC_st {
801   CUresourceViewFormat format;
802   size_t width;
803   size_t height;
804   size_t depth;
805   unsigned int firstMipmapLevel;
806   unsigned int lastMipmapLevel;
807   unsigned int firstLayer;
808   unsigned int lastLayer;
809   unsigned int reserved[16];
810 } CUDA_RESOURCE_VIEW_DESC;
811
812 typedef struct CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st {
813   unsigned long long p2pToken;
814   unsigned int vaSpaceToken;
815 } CUDA_POINTER_ATTRIBUTE_P2P_TOKENS;
816 typedef unsigned int GLenum;
817 typedef unsigned int GLuint;
818 typedef int GLint;
819
820 typedef enum CUGLDeviceList_enum {
821   CU_GL_DEVICE_LIST_ALL = 0x01,
822   CU_GL_DEVICE_LIST_CURRENT_FRAME = 0x02,
823   CU_GL_DEVICE_LIST_NEXT_FRAME = 0x03,
824 } CUGLDeviceList;
825
826 typedef enum CUGLmap_flags_enum {
827   CU_GL_MAP_RESOURCE_FLAGS_NONE = 0x00,
828   CU_GL_MAP_RESOURCE_FLAGS_READ_ONLY = 0x01,
829   CU_GL_MAP_RESOURCE_FLAGS_WRITE_DISCARD = 0x02,
830 } CUGLmap_flags;
831
832 typedef enum  {
833   NVRTC_SUCCESS = 0,
834   NVRTC_ERROR_OUT_OF_MEMORY = 1,
835   NVRTC_ERROR_PROGRAM_CREATION_FAILURE = 2,
836   NVRTC_ERROR_INVALID_INPUT = 3,
837   NVRTC_ERROR_INVALID_PROGRAM = 4,
838   NVRTC_ERROR_INVALID_OPTION = 5,
839   NVRTC_ERROR_COMPILATION = 6,
840   NVRTC_ERROR_BUILTIN_OPERATION_FAILURE = 7,
841   NVRTC_ERROR_NO_NAME_EXPRESSIONS_AFTER_COMPILATION = 8,
842   NVRTC_ERROR_NO_LOWERED_NAMES_BEFORE_COMPILATION = 9,
843   NVRTC_ERROR_NAME_EXPRESSION_NOT_VALID = 10,
844   NVRTC_ERROR_INTERNAL_ERROR = 11,
845 } nvrtcResult;
846
847 typedef struct _nvrtcProgram* nvrtcProgram;
848 /* Function types. */
849 typedef CUresult CUDAAPI tcuGetErrorString(CUresult error, const char** pStr);
850 typedef CUresult CUDAAPI tcuGetErrorName(CUresult error, const char** pStr);
851 typedef CUresult CUDAAPI tcuInit(unsigned int Flags);
852 typedef CUresult CUDAAPI tcuDriverGetVersion(int* driverVersion);
853 typedef CUresult CUDAAPI tcuDeviceGet(CUdevice* device, int ordinal);
854 typedef CUresult CUDAAPI tcuDeviceGetCount(int* count);
855 typedef CUresult CUDAAPI tcuDeviceGetName(char* name, int len, CUdevice dev);
856 typedef CUresult CUDAAPI tcuDeviceTotalMem_v2(size_t* bytes, CUdevice dev);
857 typedef CUresult CUDAAPI tcuDeviceGetAttribute(int* pi, CUdevice_attribute attrib, CUdevice dev);
858 typedef CUresult CUDAAPI tcuDeviceGetProperties(CUdevprop* prop, CUdevice dev);
859 typedef CUresult CUDAAPI tcuDeviceComputeCapability(int* major, int* minor, CUdevice dev);
860 typedef CUresult CUDAAPI tcuDevicePrimaryCtxRetain(CUcontext* pctx, CUdevice dev);
861 typedef CUresult CUDAAPI tcuDevicePrimaryCtxRelease(CUdevice dev);
862 typedef CUresult CUDAAPI tcuDevicePrimaryCtxSetFlags(CUdevice dev, unsigned int flags);
863 typedef CUresult CUDAAPI tcuDevicePrimaryCtxGetState(CUdevice dev, unsigned int* flags, int* active);
864 typedef CUresult CUDAAPI tcuDevicePrimaryCtxReset(CUdevice dev);
865 typedef CUresult CUDAAPI tcuCtxCreate_v2(CUcontext* pctx, unsigned int flags, CUdevice dev);
866 typedef CUresult CUDAAPI tcuCtxDestroy_v2(CUcontext ctx);
867 typedef CUresult CUDAAPI tcuCtxPushCurrent_v2(CUcontext ctx);
868 typedef CUresult CUDAAPI tcuCtxPopCurrent_v2(CUcontext* pctx);
869 typedef CUresult CUDAAPI tcuCtxSetCurrent(CUcontext ctx);
870 typedef CUresult CUDAAPI tcuCtxGetCurrent(CUcontext* pctx);
871 typedef CUresult CUDAAPI tcuCtxGetDevice(CUdevice* device);
872 typedef CUresult CUDAAPI tcuCtxGetFlags(unsigned int* flags);
873 typedef CUresult CUDAAPI tcuCtxSynchronize(void);
874 typedef CUresult CUDAAPI tcuCtxSetLimit(CUlimit limit, size_t value);
875 typedef CUresult CUDAAPI tcuCtxGetLimit(size_t* pvalue, CUlimit limit);
876 typedef CUresult CUDAAPI tcuCtxGetCacheConfig(CUfunc_cache* pconfig);
877 typedef CUresult CUDAAPI tcuCtxSetCacheConfig(CUfunc_cache config);
878 typedef CUresult CUDAAPI tcuCtxGetSharedMemConfig(CUsharedconfig* pConfig);
879 typedef CUresult CUDAAPI tcuCtxSetSharedMemConfig(CUsharedconfig config);
880 typedef CUresult CUDAAPI tcuCtxGetApiVersion(CUcontext ctx, unsigned int* version);
881 typedef CUresult CUDAAPI tcuCtxGetStreamPriorityRange(int* leastPriority, int* greatestPriority);
882 typedef CUresult CUDAAPI tcuCtxAttach(CUcontext* pctx, unsigned int flags);
883 typedef CUresult CUDAAPI tcuCtxDetach(CUcontext ctx);
884 typedef CUresult CUDAAPI tcuModuleLoad(CUmodule* module, const char* fname);
885 typedef CUresult CUDAAPI tcuModuleLoadData(CUmodule* module, const void* image);
886 typedef CUresult CUDAAPI tcuModuleLoadDataEx(CUmodule* module, const void* image, unsigned int numOptions, CUjit_option* options, void** optionValues);
887 typedef CUresult CUDAAPI tcuModuleLoadFatBinary(CUmodule* module, const void* fatCubin);
888 typedef CUresult CUDAAPI tcuModuleUnload(CUmodule hmod);
889 typedef CUresult CUDAAPI tcuModuleGetFunction(CUfunction* hfunc, CUmodule hmod, const char* name);
890 typedef CUresult CUDAAPI tcuModuleGetGlobal_v2(CUdeviceptr* dptr, size_t* bytes, CUmodule hmod, const char* name);
891 typedef CUresult CUDAAPI tcuModuleGetTexRef(CUtexref* pTexRef, CUmodule hmod, const char* name);
892 typedef CUresult CUDAAPI tcuModuleGetSurfRef(CUsurfref* pSurfRef, CUmodule hmod, const char* name);
893 typedef CUresult CUDAAPI tcuLinkCreate_v2(unsigned int numOptions, CUjit_option* options, void** optionValues, CUlinkState* stateOut);
894 typedef CUresult CUDAAPI tcuLinkAddData_v2(CUlinkState state, CUjitInputType type, void* data, size_t size, const char* name, unsigned int numOptions, CUjit_option* options, void** optionValues);
895 typedef CUresult CUDAAPI tcuLinkAddFile_v2(CUlinkState state, CUjitInputType type, const char* path, unsigned int numOptions, CUjit_option* options, void** optionValues);
896 typedef CUresult CUDAAPI tcuLinkComplete(CUlinkState state, void** cubinOut, size_t* sizeOut);
897 typedef CUresult CUDAAPI tcuLinkDestroy(CUlinkState state);
898 typedef CUresult CUDAAPI tcuMemGetInfo_v2(size_t* free, size_t* total);
899 typedef CUresult CUDAAPI tcuMemAlloc_v2(CUdeviceptr* dptr, size_t bytesize);
900 typedef CUresult CUDAAPI tcuMemAllocPitch_v2(CUdeviceptr* dptr, size_t* pPitch, size_t WidthInBytes, size_t Height, unsigned int ElementSizeBytes);
901 typedef CUresult CUDAAPI tcuMemFree_v2(CUdeviceptr dptr);
902 typedef CUresult CUDAAPI tcuMemGetAddressRange_v2(CUdeviceptr* pbase, size_t* psize, CUdeviceptr dptr);
903 typedef CUresult CUDAAPI tcuMemAllocHost_v2(void** pp, size_t bytesize);
904 typedef CUresult CUDAAPI tcuMemFreeHost(void* p);
905 typedef CUresult CUDAAPI tcuMemHostAlloc(void** pp, size_t bytesize, unsigned int Flags);
906 typedef CUresult CUDAAPI tcuMemHostGetDevicePointer_v2(CUdeviceptr* pdptr, void* p, unsigned int Flags);
907 typedef CUresult CUDAAPI tcuMemHostGetFlags(unsigned int* pFlags, void* p);
908 typedef CUresult CUDAAPI tcuMemAllocManaged(CUdeviceptr* dptr, size_t bytesize, unsigned int flags);
909 typedef CUresult CUDAAPI tcuDeviceGetByPCIBusId(CUdevice* dev, const char* pciBusId);
910 typedef CUresult CUDAAPI tcuDeviceGetPCIBusId(char* pciBusId, int len, CUdevice dev);
911 typedef CUresult CUDAAPI tcuIpcGetEventHandle(CUipcEventHandle* pHandle, CUevent event);
912 typedef CUresult CUDAAPI tcuIpcOpenEventHandle(CUevent* phEvent, CUipcEventHandle handle);
913 typedef CUresult CUDAAPI tcuIpcGetMemHandle(CUipcMemHandle* pHandle, CUdeviceptr dptr);
914 typedef CUresult CUDAAPI tcuIpcOpenMemHandle(CUdeviceptr* pdptr, CUipcMemHandle handle, unsigned int Flags);
915 typedef CUresult CUDAAPI tcuIpcCloseMemHandle(CUdeviceptr dptr);
916 typedef CUresult CUDAAPI tcuMemHostRegister_v2(void* p, size_t bytesize, unsigned int Flags);
917 typedef CUresult CUDAAPI tcuMemHostUnregister(void* p);
918 typedef CUresult CUDAAPI tcuMemcpy(CUdeviceptr dst, CUdeviceptr src, size_t ByteCount);
919 typedef CUresult CUDAAPI tcuMemcpyPeer(CUdeviceptr dstDevice, CUcontext dstContext, CUdeviceptr srcDevice, CUcontext srcContext, size_t ByteCount);
920 typedef CUresult CUDAAPI tcuMemcpyHtoD_v2(CUdeviceptr dstDevice, const void* srcHost, size_t ByteCount);
921 typedef CUresult CUDAAPI tcuMemcpyDtoH_v2(void* dstHost, CUdeviceptr srcDevice, size_t ByteCount);
922 typedef CUresult CUDAAPI tcuMemcpyDtoD_v2(CUdeviceptr dstDevice, CUdeviceptr srcDevice, size_t ByteCount);
923 typedef CUresult CUDAAPI tcuMemcpyDtoA_v2(CUarray dstArray, size_t dstOffset, CUdeviceptr srcDevice, size_t ByteCount);
924 typedef CUresult CUDAAPI tcuMemcpyAtoD_v2(CUdeviceptr dstDevice, CUarray srcArray, size_t srcOffset, size_t ByteCount);
925 typedef CUresult CUDAAPI tcuMemcpyHtoA_v2(CUarray dstArray, size_t dstOffset, const void* srcHost, size_t ByteCount);
926 typedef CUresult CUDAAPI tcuMemcpyAtoH_v2(void* dstHost, CUarray srcArray, size_t srcOffset, size_t ByteCount);
927 typedef CUresult CUDAAPI tcuMemcpyAtoA_v2(CUarray dstArray, size_t dstOffset, CUarray srcArray, size_t srcOffset, size_t ByteCount);
928 typedef CUresult CUDAAPI tcuMemcpy2D_v2(const CUDA_MEMCPY2D* pCopy);
929 typedef CUresult CUDAAPI tcuMemcpy2DUnaligned_v2(const CUDA_MEMCPY2D* pCopy);
930 typedef CUresult CUDAAPI tcuMemcpy3D_v2(const CUDA_MEMCPY3D* pCopy);
931 typedef CUresult CUDAAPI tcuMemcpy3DPeer(const CUDA_MEMCPY3D_PEER* pCopy);
932 typedef CUresult CUDAAPI tcuMemcpyAsync(CUdeviceptr dst, CUdeviceptr src, size_t ByteCount, CUstream hStream);
933 typedef CUresult CUDAAPI tcuMemcpyPeerAsync(CUdeviceptr dstDevice, CUcontext dstContext, CUdeviceptr srcDevice, CUcontext srcContext, size_t ByteCount, CUstream hStream);
934 typedef CUresult CUDAAPI tcuMemcpyHtoDAsync_v2(CUdeviceptr dstDevice, const void* srcHost, size_t ByteCount, CUstream hStream);
935 typedef CUresult CUDAAPI tcuMemcpyDtoHAsync_v2(void* dstHost, CUdeviceptr srcDevice, size_t ByteCount, CUstream hStream);
936 typedef CUresult CUDAAPI tcuMemcpyDtoDAsync_v2(CUdeviceptr dstDevice, CUdeviceptr srcDevice, size_t ByteCount, CUstream hStream);
937 typedef CUresult CUDAAPI tcuMemcpyHtoAAsync_v2(CUarray dstArray, size_t dstOffset, const void* srcHost, size_t ByteCount, CUstream hStream);
938 typedef CUresult CUDAAPI tcuMemcpyAtoHAsync_v2(void* dstHost, CUarray srcArray, size_t srcOffset, size_t ByteCount, CUstream hStream);
939 typedef CUresult CUDAAPI tcuMemcpy2DAsync_v2(const CUDA_MEMCPY2D* pCopy, CUstream hStream);
940 typedef CUresult CUDAAPI tcuMemcpy3DAsync_v2(const CUDA_MEMCPY3D* pCopy, CUstream hStream);
941 typedef CUresult CUDAAPI tcuMemcpy3DPeerAsync(const CUDA_MEMCPY3D_PEER* pCopy, CUstream hStream);
942 typedef CUresult CUDAAPI tcuMemsetD8_v2(CUdeviceptr dstDevice, unsigned char uc, size_t N);
943 typedef CUresult CUDAAPI tcuMemsetD16_v2(CUdeviceptr dstDevice, unsigned short us, size_t N);
944 typedef CUresult CUDAAPI tcuMemsetD32_v2(CUdeviceptr dstDevice, unsigned int ui, size_t N);
945 typedef CUresult CUDAAPI tcuMemsetD2D8_v2(CUdeviceptr dstDevice, size_t dstPitch, unsigned char uc, size_t Width, size_t Height);
946 typedef CUresult CUDAAPI tcuMemsetD2D16_v2(CUdeviceptr dstDevice, size_t dstPitch, unsigned short us, size_t Width, size_t Height);
947 typedef CUresult CUDAAPI tcuMemsetD2D32_v2(CUdeviceptr dstDevice, size_t dstPitch, unsigned int ui, size_t Width, size_t Height);
948 typedef CUresult CUDAAPI tcuMemsetD8Async(CUdeviceptr dstDevice, unsigned char uc, size_t N, CUstream hStream);
949 typedef CUresult CUDAAPI tcuMemsetD16Async(CUdeviceptr dstDevice, unsigned short us, size_t N, CUstream hStream);
950 typedef CUresult CUDAAPI tcuMemsetD32Async(CUdeviceptr dstDevice, unsigned int ui, size_t N, CUstream hStream);
951 typedef CUresult CUDAAPI tcuMemsetD2D8Async(CUdeviceptr dstDevice, size_t dstPitch, unsigned char uc, size_t Width, size_t Height, CUstream hStream);
952 typedef CUresult CUDAAPI tcuMemsetD2D16Async(CUdeviceptr dstDevice, size_t dstPitch, unsigned short us, size_t Width, size_t Height, CUstream hStream);
953 typedef CUresult CUDAAPI tcuMemsetD2D32Async(CUdeviceptr dstDevice, size_t dstPitch, unsigned int ui, size_t Width, size_t Height, CUstream hStream);
954 typedef CUresult CUDAAPI tcuArrayCreate_v2(CUarray* pHandle, const CUDA_ARRAY_DESCRIPTOR* pAllocateArray);
955 typedef CUresult CUDAAPI tcuArrayGetDescriptor_v2(CUDA_ARRAY_DESCRIPTOR* pArrayDescriptor, CUarray hArray);
956 typedef CUresult CUDAAPI tcuArrayDestroy(CUarray hArray);
957 typedef CUresult CUDAAPI tcuArray3DCreate_v2(CUarray* pHandle, const CUDA_ARRAY3D_DESCRIPTOR* pAllocateArray);
958 typedef CUresult CUDAAPI tcuArray3DGetDescriptor_v2(CUDA_ARRAY3D_DESCRIPTOR* pArrayDescriptor, CUarray hArray);
959 typedef CUresult CUDAAPI tcuMipmappedArrayCreate(CUmipmappedArray* pHandle, const CUDA_ARRAY3D_DESCRIPTOR* pMipmappedArrayDesc, unsigned int numMipmapLevels);
960 typedef CUresult CUDAAPI tcuMipmappedArrayGetLevel(CUarray* pLevelArray, CUmipmappedArray hMipmappedArray, unsigned int level);
961 typedef CUresult CUDAAPI tcuMipmappedArrayDestroy(CUmipmappedArray hMipmappedArray);
962 typedef CUresult CUDAAPI tcuPointerGetAttribute(void* data, CUpointer_attribute attribute, CUdeviceptr ptr);
963 typedef CUresult CUDAAPI tcuMemPrefetchAsync(CUdeviceptr devPtr, size_t count, CUdevice dstDevice, CUstream hStream);
964 typedef CUresult CUDAAPI tcuMemAdvise(CUdeviceptr devPtr, size_t count, CUmem_advise advice, CUdevice device);
965 typedef CUresult CUDAAPI tcuMemRangeGetAttribute(void* data, size_t dataSize, CUmem_range_attribute attribute, CUdeviceptr devPtr, size_t count);
966 typedef CUresult CUDAAPI tcuMemRangeGetAttributes(void** data, size_t* dataSizes, CUmem_range_attribute* attributes, size_t numAttributes, CUdeviceptr devPtr, size_t count);
967 typedef CUresult CUDAAPI tcuPointerSetAttribute(const void* value, CUpointer_attribute attribute, CUdeviceptr ptr);
968 typedef CUresult CUDAAPI tcuPointerGetAttributes(unsigned int numAttributes, CUpointer_attribute* attributes, void** data, CUdeviceptr ptr);
969 typedef CUresult CUDAAPI tcuStreamCreate(CUstream* phStream, unsigned int Flags);
970 typedef CUresult CUDAAPI tcuStreamCreateWithPriority(CUstream* phStream, unsigned int flags, int priority);
971 typedef CUresult CUDAAPI tcuStreamGetPriority(CUstream hStream, int* priority);
972 typedef CUresult CUDAAPI tcuStreamGetFlags(CUstream hStream, unsigned int* flags);
973 typedef CUresult CUDAAPI tcuStreamWaitEvent(CUstream hStream, CUevent hEvent, unsigned int Flags);
974 typedef CUresult CUDAAPI tcuStreamAddCallback(CUstream hStream, CUstreamCallback callback, void* userData, unsigned int flags);
975 typedef CUresult CUDAAPI tcuStreamAttachMemAsync(CUstream hStream, CUdeviceptr dptr, size_t length, unsigned int flags);
976 typedef CUresult CUDAAPI tcuStreamQuery(CUstream hStream);
977 typedef CUresult CUDAAPI tcuStreamSynchronize(CUstream hStream);
978 typedef CUresult CUDAAPI tcuStreamDestroy_v2(CUstream hStream);
979 typedef CUresult CUDAAPI tcuEventCreate(CUevent* phEvent, unsigned int Flags);
980 typedef CUresult CUDAAPI tcuEventRecord(CUevent hEvent, CUstream hStream);
981 typedef CUresult CUDAAPI tcuEventQuery(CUevent hEvent);
982 typedef CUresult CUDAAPI tcuEventSynchronize(CUevent hEvent);
983 typedef CUresult CUDAAPI tcuEventDestroy_v2(CUevent hEvent);
984 typedef CUresult CUDAAPI tcuEventElapsedTime(float* pMilliseconds, CUevent hStart, CUevent hEnd);
985 typedef CUresult CUDAAPI tcuStreamWaitValue32(CUstream stream, CUdeviceptr addr, cuuint32_t value, unsigned int flags);
986 typedef CUresult CUDAAPI tcuStreamWriteValue32(CUstream stream, CUdeviceptr addr, cuuint32_t value, unsigned int flags);
987 typedef CUresult CUDAAPI tcuStreamBatchMemOp(CUstream stream, unsigned int count, CUstreamBatchMemOpParams* paramArray, unsigned int flags);
988 typedef CUresult CUDAAPI tcuFuncGetAttribute(int* pi, CUfunction_attribute attrib, CUfunction hfunc);
989 typedef CUresult CUDAAPI tcuFuncSetCacheConfig(CUfunction hfunc, CUfunc_cache config);
990 typedef CUresult CUDAAPI tcuFuncSetSharedMemConfig(CUfunction hfunc, CUsharedconfig config);
991 typedef CUresult CUDAAPI tcuLaunchKernel(CUfunction f, unsigned int gridDimX, unsigned int gridDimY, unsigned int gridDimZ, unsigned int blockDimX, unsigned int blockDimY, unsigned int blockDimZ, unsigned int sharedMemBytes, CUstream hStream, void** kernelParams, void** extra);
992 typedef CUresult CUDAAPI tcuFuncSetBlockShape(CUfunction hfunc, int x, int y, int z);
993 typedef CUresult CUDAAPI tcuFuncSetSharedSize(CUfunction hfunc, unsigned int bytes);
994 typedef CUresult CUDAAPI tcuParamSetSize(CUfunction hfunc, unsigned int numbytes);
995 typedef CUresult CUDAAPI tcuParamSeti(CUfunction hfunc, int offset, unsigned int value);
996 typedef CUresult CUDAAPI tcuParamSetf(CUfunction hfunc, int offset, float value);
997 typedef CUresult CUDAAPI tcuParamSetv(CUfunction hfunc, int offset, void* ptr, unsigned int numbytes);
998 typedef CUresult CUDAAPI tcuLaunch(CUfunction f);
999 typedef CUresult CUDAAPI tcuLaunchGrid(CUfunction f, int grid_width, int grid_height);
1000 typedef CUresult CUDAAPI tcuLaunchGridAsync(CUfunction f, int grid_width, int grid_height, CUstream hStream);
1001 typedef CUresult CUDAAPI tcuParamSetTexRef(CUfunction hfunc, int texunit, CUtexref hTexRef);
1002 typedef CUresult CUDAAPI tcuOccupancyMaxActiveBlocksPerMultiprocessor(int* numBlocks, CUfunction func, int blockSize, size_t dynamicSMemSize);
1003 typedef CUresult CUDAAPI tcuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int* numBlocks, CUfunction func, int blockSize, size_t dynamicSMemSize, unsigned int flags);
1004 typedef CUresult CUDAAPI tcuOccupancyMaxPotentialBlockSize(int* minGridSize, int* blockSize, CUfunction func, CUoccupancyB2DSize blockSizeToDynamicSMemSize, size_t dynamicSMemSize, int blockSizeLimit);
1005 typedef CUresult CUDAAPI tcuOccupancyMaxPotentialBlockSizeWithFlags(int* minGridSize, int* blockSize, CUfunction func, CUoccupancyB2DSize blockSizeToDynamicSMemSize, size_t dynamicSMemSize, int blockSizeLimit, unsigned int flags);
1006 typedef CUresult CUDAAPI tcuTexRefSetArray(CUtexref hTexRef, CUarray hArray, unsigned int Flags);
1007 typedef CUresult CUDAAPI tcuTexRefSetMipmappedArray(CUtexref hTexRef, CUmipmappedArray hMipmappedArray, unsigned int Flags);
1008 typedef CUresult CUDAAPI tcuTexRefSetAddress_v2(size_t* ByteOffset, CUtexref hTexRef, CUdeviceptr dptr, size_t bytes);
1009 typedef CUresult CUDAAPI tcuTexRefSetAddress2D_v3(CUtexref hTexRef, const CUDA_ARRAY_DESCRIPTOR* desc, CUdeviceptr dptr, size_t Pitch);
1010 typedef CUresult CUDAAPI tcuTexRefSetFormat(CUtexref hTexRef, CUarray_format fmt, int NumPackedComponents);
1011 typedef CUresult CUDAAPI tcuTexRefSetAddressMode(CUtexref hTexRef, int dim, CUaddress_mode am);
1012 typedef CUresult CUDAAPI tcuTexRefSetFilterMode(CUtexref hTexRef, CUfilter_mode fm);
1013 typedef CUresult CUDAAPI tcuTexRefSetMipmapFilterMode(CUtexref hTexRef, CUfilter_mode fm);
1014 typedef CUresult CUDAAPI tcuTexRefSetMipmapLevelBias(CUtexref hTexRef, float bias);
1015 typedef CUresult CUDAAPI tcuTexRefSetMipmapLevelClamp(CUtexref hTexRef, float minMipmapLevelClamp, float maxMipmapLevelClamp);
1016 typedef CUresult CUDAAPI tcuTexRefSetMaxAnisotropy(CUtexref hTexRef, unsigned int maxAniso);
1017 typedef CUresult CUDAAPI tcuTexRefSetBorderColor(CUtexref hTexRef, float* pBorderColor);
1018 typedef CUresult CUDAAPI tcuTexRefSetFlags(CUtexref hTexRef, unsigned int Flags);
1019 typedef CUresult CUDAAPI tcuTexRefGetAddress_v2(CUdeviceptr* pdptr, CUtexref hTexRef);
1020 typedef CUresult CUDAAPI tcuTexRefGetArray(CUarray* phArray, CUtexref hTexRef);
1021 typedef CUresult CUDAAPI tcuTexRefGetMipmappedArray(CUmipmappedArray* phMipmappedArray, CUtexref hTexRef);
1022 typedef CUresult CUDAAPI tcuTexRefGetAddressMode(CUaddress_mode* pam, CUtexref hTexRef, int dim);
1023 typedef CUresult CUDAAPI tcuTexRefGetFilterMode(CUfilter_mode* pfm, CUtexref hTexRef);
1024 typedef CUresult CUDAAPI tcuTexRefGetFormat(CUarray_format* pFormat, int* pNumChannels, CUtexref hTexRef);
1025 typedef CUresult CUDAAPI tcuTexRefGetMipmapFilterMode(CUfilter_mode* pfm, CUtexref hTexRef);
1026 typedef CUresult CUDAAPI tcuTexRefGetMipmapLevelBias(float* pbias, CUtexref hTexRef);
1027 typedef CUresult CUDAAPI tcuTexRefGetMipmapLevelClamp(float* pminMipmapLevelClamp, float* pmaxMipmapLevelClamp, CUtexref hTexRef);
1028 typedef CUresult CUDAAPI tcuTexRefGetMaxAnisotropy(int* pmaxAniso, CUtexref hTexRef);
1029 typedef CUresult CUDAAPI tcuTexRefGetBorderColor(float* pBorderColor, CUtexref hTexRef);
1030 typedef CUresult CUDAAPI tcuTexRefGetFlags(unsigned int* pFlags, CUtexref hTexRef);
1031 typedef CUresult CUDAAPI tcuTexRefCreate(CUtexref* pTexRef);
1032 typedef CUresult CUDAAPI tcuTexRefDestroy(CUtexref hTexRef);
1033 typedef CUresult CUDAAPI tcuSurfRefSetArray(CUsurfref hSurfRef, CUarray hArray, unsigned int Flags);
1034 typedef CUresult CUDAAPI tcuSurfRefGetArray(CUarray* phArray, CUsurfref hSurfRef);
1035 typedef CUresult CUDAAPI tcuTexObjectCreate(CUtexObject* pTexObject, const CUDA_RESOURCE_DESC* pResDesc, const CUDA_TEXTURE_DESC* pTexDesc, const CUDA_RESOURCE_VIEW_DESC* pResViewDesc);
1036 typedef CUresult CUDAAPI tcuTexObjectDestroy(CUtexObject texObject);
1037 typedef CUresult CUDAAPI tcuTexObjectGetResourceDesc(CUDA_RESOURCE_DESC* pResDesc, CUtexObject texObject);
1038 typedef CUresult CUDAAPI tcuTexObjectGetTextureDesc(CUDA_TEXTURE_DESC* pTexDesc, CUtexObject texObject);
1039 typedef CUresult CUDAAPI tcuTexObjectGetResourceViewDesc(CUDA_RESOURCE_VIEW_DESC* pResViewDesc, CUtexObject texObject);
1040 typedef CUresult CUDAAPI tcuSurfObjectCreate(CUsurfObject* pSurfObject, const CUDA_RESOURCE_DESC* pResDesc);
1041 typedef CUresult CUDAAPI tcuSurfObjectDestroy(CUsurfObject surfObject);
1042 typedef CUresult CUDAAPI tcuSurfObjectGetResourceDesc(CUDA_RESOURCE_DESC* pResDesc, CUsurfObject surfObject);
1043 typedef CUresult CUDAAPI tcuDeviceCanAccessPeer(int* canAccessPeer, CUdevice dev, CUdevice peerDev);
1044 typedef CUresult CUDAAPI tcuDeviceGetP2PAttribute(int* value, CUdevice_P2PAttribute attrib, CUdevice srcDevice, CUdevice dstDevice);
1045 typedef CUresult CUDAAPI tcuCtxEnablePeerAccess(CUcontext peerContext, unsigned int Flags);
1046 typedef CUresult CUDAAPI tcuCtxDisablePeerAccess(CUcontext peerContext);
1047 typedef CUresult CUDAAPI tcuGraphicsUnregisterResource(CUgraphicsResource resource);
1048 typedef CUresult CUDAAPI tcuGraphicsSubResourceGetMappedArray(CUarray* pArray, CUgraphicsResource resource, unsigned int arrayIndex, unsigned int mipLevel);
1049 typedef CUresult CUDAAPI tcuGraphicsResourceGetMappedMipmappedArray(CUmipmappedArray* pMipmappedArray, CUgraphicsResource resource);
1050 typedef CUresult CUDAAPI tcuGraphicsResourceGetMappedPointer_v2(CUdeviceptr* pDevPtr, size_t* pSize, CUgraphicsResource resource);
1051 typedef CUresult CUDAAPI tcuGraphicsResourceSetMapFlags_v2(CUgraphicsResource resource, unsigned int flags);
1052 typedef CUresult CUDAAPI tcuGraphicsMapResources(unsigned int count, CUgraphicsResource* resources, CUstream hStream);
1053 typedef CUresult CUDAAPI tcuGraphicsUnmapResources(unsigned int count, CUgraphicsResource* resources, CUstream hStream);
1054 typedef CUresult CUDAAPI tcuGetExportTable(const void** ppExportTable, const CUuuid* pExportTableId);
1055
1056 typedef CUresult CUDAAPI tcuGraphicsGLRegisterBuffer(CUgraphicsResource* pCudaResource, GLuint buffer, unsigned int Flags);
1057 typedef CUresult CUDAAPI tcuGraphicsGLRegisterImage(CUgraphicsResource* pCudaResource, GLuint image, GLenum target, unsigned int Flags);
1058 typedef CUresult CUDAAPI tcuGLGetDevices_v2(unsigned int* pCudaDeviceCount, CUdevice* pCudaDevices, unsigned int cudaDeviceCount, CUGLDeviceList deviceList);
1059 typedef CUresult CUDAAPI tcuGLCtxCreate_v2(CUcontext* pCtx, unsigned int Flags, CUdevice device);
1060 typedef CUresult CUDAAPI tcuGLInit(void);
1061 typedef CUresult CUDAAPI tcuGLRegisterBufferObject(GLuint buffer);
1062 typedef CUresult CUDAAPI tcuGLMapBufferObject_v2(CUdeviceptr* dptr, size_t* size, GLuint buffer);
1063 typedef CUresult CUDAAPI tcuGLUnmapBufferObject(GLuint buffer);
1064 typedef CUresult CUDAAPI tcuGLUnregisterBufferObject(GLuint buffer);
1065 typedef CUresult CUDAAPI tcuGLSetBufferObjectMapFlags(GLuint buffer, unsigned int Flags);
1066 typedef CUresult CUDAAPI tcuGLMapBufferObjectAsync_v2(CUdeviceptr* dptr, size_t* size, GLuint buffer, CUstream hStream);
1067 typedef CUresult CUDAAPI tcuGLUnmapBufferObjectAsync(GLuint buffer, CUstream hStream);
1068
1069 typedef const char* CUDAAPI tnvrtcGetErrorString(nvrtcResult result);
1070 typedef nvrtcResult CUDAAPI tnvrtcVersion(int* major, int* minor);
1071 typedef nvrtcResult CUDAAPI tnvrtcCreateProgram(nvrtcProgram* prog, const char* src, const char* name, int numHeaders, const char** headers, const char** includeNames);
1072 typedef nvrtcResult CUDAAPI tnvrtcDestroyProgram(nvrtcProgram* prog);
1073 typedef nvrtcResult CUDAAPI tnvrtcCompileProgram(nvrtcProgram prog, int numOptions, const char** options);
1074 typedef nvrtcResult CUDAAPI tnvrtcGetPTXSize(nvrtcProgram prog, size_t* ptxSizeRet);
1075 typedef nvrtcResult CUDAAPI tnvrtcGetPTX(nvrtcProgram prog, char* ptx);
1076 typedef nvrtcResult CUDAAPI tnvrtcGetProgramLogSize(nvrtcProgram prog, size_t* logSizeRet);
1077 typedef nvrtcResult CUDAAPI tnvrtcGetProgramLog(nvrtcProgram prog, char* log);
1078 typedef nvrtcResult CUDAAPI tnvrtcAddNameExpression(nvrtcProgram prog, const char* name_expression);
1079 typedef nvrtcResult CUDAAPI tnvrtcGetLoweredName(nvrtcProgram prog, const char* name_expression, const char** lowered_name);
1080
1081
1082 /* Function declarations. */
1083 extern tcuGetErrorString *cuGetErrorString;
1084 extern tcuGetErrorName *cuGetErrorName;
1085 extern tcuInit *cuInit;
1086 extern tcuDriverGetVersion *cuDriverGetVersion;
1087 extern tcuDeviceGet *cuDeviceGet;
1088 extern tcuDeviceGetCount *cuDeviceGetCount;
1089 extern tcuDeviceGetName *cuDeviceGetName;
1090 extern tcuDeviceTotalMem_v2 *cuDeviceTotalMem_v2;
1091 extern tcuDeviceGetAttribute *cuDeviceGetAttribute;
1092 extern tcuDeviceGetProperties *cuDeviceGetProperties;
1093 extern tcuDeviceComputeCapability *cuDeviceComputeCapability;
1094 extern tcuDevicePrimaryCtxRetain *cuDevicePrimaryCtxRetain;
1095 extern tcuDevicePrimaryCtxRelease *cuDevicePrimaryCtxRelease;
1096 extern tcuDevicePrimaryCtxSetFlags *cuDevicePrimaryCtxSetFlags;
1097 extern tcuDevicePrimaryCtxGetState *cuDevicePrimaryCtxGetState;
1098 extern tcuDevicePrimaryCtxReset *cuDevicePrimaryCtxReset;
1099 extern tcuCtxCreate_v2 *cuCtxCreate_v2;
1100 extern tcuCtxDestroy_v2 *cuCtxDestroy_v2;
1101 extern tcuCtxPushCurrent_v2 *cuCtxPushCurrent_v2;
1102 extern tcuCtxPopCurrent_v2 *cuCtxPopCurrent_v2;
1103 extern tcuCtxSetCurrent *cuCtxSetCurrent;
1104 extern tcuCtxGetCurrent *cuCtxGetCurrent;
1105 extern tcuCtxGetDevice *cuCtxGetDevice;
1106 extern tcuCtxGetFlags *cuCtxGetFlags;
1107 extern tcuCtxSynchronize *cuCtxSynchronize;
1108 extern tcuCtxSetLimit *cuCtxSetLimit;
1109 extern tcuCtxGetLimit *cuCtxGetLimit;
1110 extern tcuCtxGetCacheConfig *cuCtxGetCacheConfig;
1111 extern tcuCtxSetCacheConfig *cuCtxSetCacheConfig;
1112 extern tcuCtxGetSharedMemConfig *cuCtxGetSharedMemConfig;
1113 extern tcuCtxSetSharedMemConfig *cuCtxSetSharedMemConfig;
1114 extern tcuCtxGetApiVersion *cuCtxGetApiVersion;
1115 extern tcuCtxGetStreamPriorityRange *cuCtxGetStreamPriorityRange;
1116 extern tcuCtxAttach *cuCtxAttach;
1117 extern tcuCtxDetach *cuCtxDetach;
1118 extern tcuModuleLoad *cuModuleLoad;
1119 extern tcuModuleLoadData *cuModuleLoadData;
1120 extern tcuModuleLoadDataEx *cuModuleLoadDataEx;
1121 extern tcuModuleLoadFatBinary *cuModuleLoadFatBinary;
1122 extern tcuModuleUnload *cuModuleUnload;
1123 extern tcuModuleGetFunction *cuModuleGetFunction;
1124 extern tcuModuleGetGlobal_v2 *cuModuleGetGlobal_v2;
1125 extern tcuModuleGetTexRef *cuModuleGetTexRef;
1126 extern tcuModuleGetSurfRef *cuModuleGetSurfRef;
1127 extern tcuLinkCreate_v2 *cuLinkCreate_v2;
1128 extern tcuLinkAddData_v2 *cuLinkAddData_v2;
1129 extern tcuLinkAddFile_v2 *cuLinkAddFile_v2;
1130 extern tcuLinkComplete *cuLinkComplete;
1131 extern tcuLinkDestroy *cuLinkDestroy;
1132 extern tcuMemGetInfo_v2 *cuMemGetInfo_v2;
1133 extern tcuMemAlloc_v2 *cuMemAlloc_v2;
1134 extern tcuMemAllocPitch_v2 *cuMemAllocPitch_v2;
1135 extern tcuMemFree_v2 *cuMemFree_v2;
1136 extern tcuMemGetAddressRange_v2 *cuMemGetAddressRange_v2;
1137 extern tcuMemAllocHost_v2 *cuMemAllocHost_v2;
1138 extern tcuMemFreeHost *cuMemFreeHost;
1139 extern tcuMemHostAlloc *cuMemHostAlloc;
1140 extern tcuMemHostGetDevicePointer_v2 *cuMemHostGetDevicePointer_v2;
1141 extern tcuMemHostGetFlags *cuMemHostGetFlags;
1142 extern tcuMemAllocManaged *cuMemAllocManaged;
1143 extern tcuDeviceGetByPCIBusId *cuDeviceGetByPCIBusId;
1144 extern tcuDeviceGetPCIBusId *cuDeviceGetPCIBusId;
1145 extern tcuIpcGetEventHandle *cuIpcGetEventHandle;
1146 extern tcuIpcOpenEventHandle *cuIpcOpenEventHandle;
1147 extern tcuIpcGetMemHandle *cuIpcGetMemHandle;
1148 extern tcuIpcOpenMemHandle *cuIpcOpenMemHandle;
1149 extern tcuIpcCloseMemHandle *cuIpcCloseMemHandle;
1150 extern tcuMemHostRegister_v2 *cuMemHostRegister_v2;
1151 extern tcuMemHostUnregister *cuMemHostUnregister;
1152 extern tcuMemcpy *cuMemcpy;
1153 extern tcuMemcpyPeer *cuMemcpyPeer;
1154 extern tcuMemcpyHtoD_v2 *cuMemcpyHtoD_v2;
1155 extern tcuMemcpyDtoH_v2 *cuMemcpyDtoH_v2;
1156 extern tcuMemcpyDtoD_v2 *cuMemcpyDtoD_v2;
1157 extern tcuMemcpyDtoA_v2 *cuMemcpyDtoA_v2;
1158 extern tcuMemcpyAtoD_v2 *cuMemcpyAtoD_v2;
1159 extern tcuMemcpyHtoA_v2 *cuMemcpyHtoA_v2;
1160 extern tcuMemcpyAtoH_v2 *cuMemcpyAtoH_v2;
1161 extern tcuMemcpyAtoA_v2 *cuMemcpyAtoA_v2;
1162 extern tcuMemcpy2D_v2 *cuMemcpy2D_v2;
1163 extern tcuMemcpy2DUnaligned_v2 *cuMemcpy2DUnaligned_v2;
1164 extern tcuMemcpy3D_v2 *cuMemcpy3D_v2;
1165 extern tcuMemcpy3DPeer *cuMemcpy3DPeer;
1166 extern tcuMemcpyAsync *cuMemcpyAsync;
1167 extern tcuMemcpyPeerAsync *cuMemcpyPeerAsync;
1168 extern tcuMemcpyHtoDAsync_v2 *cuMemcpyHtoDAsync_v2;
1169 extern tcuMemcpyDtoHAsync_v2 *cuMemcpyDtoHAsync_v2;
1170 extern tcuMemcpyDtoDAsync_v2 *cuMemcpyDtoDAsync_v2;
1171 extern tcuMemcpyHtoAAsync_v2 *cuMemcpyHtoAAsync_v2;
1172 extern tcuMemcpyAtoHAsync_v2 *cuMemcpyAtoHAsync_v2;
1173 extern tcuMemcpy2DAsync_v2 *cuMemcpy2DAsync_v2;
1174 extern tcuMemcpy3DAsync_v2 *cuMemcpy3DAsync_v2;
1175 extern tcuMemcpy3DPeerAsync *cuMemcpy3DPeerAsync;
1176 extern tcuMemsetD8_v2 *cuMemsetD8_v2;
1177 extern tcuMemsetD16_v2 *cuMemsetD16_v2;
1178 extern tcuMemsetD32_v2 *cuMemsetD32_v2;
1179 extern tcuMemsetD2D8_v2 *cuMemsetD2D8_v2;
1180 extern tcuMemsetD2D16_v2 *cuMemsetD2D16_v2;
1181 extern tcuMemsetD2D32_v2 *cuMemsetD2D32_v2;
1182 extern tcuMemsetD8Async *cuMemsetD8Async;
1183 extern tcuMemsetD16Async *cuMemsetD16Async;
1184 extern tcuMemsetD32Async *cuMemsetD32Async;
1185 extern tcuMemsetD2D8Async *cuMemsetD2D8Async;
1186 extern tcuMemsetD2D16Async *cuMemsetD2D16Async;
1187 extern tcuMemsetD2D32Async *cuMemsetD2D32Async;
1188 extern tcuArrayCreate_v2 *cuArrayCreate_v2;
1189 extern tcuArrayGetDescriptor_v2 *cuArrayGetDescriptor_v2;
1190 extern tcuArrayDestroy *cuArrayDestroy;
1191 extern tcuArray3DCreate_v2 *cuArray3DCreate_v2;
1192 extern tcuArray3DGetDescriptor_v2 *cuArray3DGetDescriptor_v2;
1193 extern tcuMipmappedArrayCreate *cuMipmappedArrayCreate;
1194 extern tcuMipmappedArrayGetLevel *cuMipmappedArrayGetLevel;
1195 extern tcuMipmappedArrayDestroy *cuMipmappedArrayDestroy;
1196 extern tcuPointerGetAttribute *cuPointerGetAttribute;
1197 extern tcuMemPrefetchAsync *cuMemPrefetchAsync;
1198 extern tcuMemAdvise *cuMemAdvise;
1199 extern tcuMemRangeGetAttribute *cuMemRangeGetAttribute;
1200 extern tcuMemRangeGetAttributes *cuMemRangeGetAttributes;
1201 extern tcuPointerSetAttribute *cuPointerSetAttribute;
1202 extern tcuPointerGetAttributes *cuPointerGetAttributes;
1203 extern tcuStreamCreate *cuStreamCreate;
1204 extern tcuStreamCreateWithPriority *cuStreamCreateWithPriority;
1205 extern tcuStreamGetPriority *cuStreamGetPriority;
1206 extern tcuStreamGetFlags *cuStreamGetFlags;
1207 extern tcuStreamWaitEvent *cuStreamWaitEvent;
1208 extern tcuStreamAddCallback *cuStreamAddCallback;
1209 extern tcuStreamAttachMemAsync *cuStreamAttachMemAsync;
1210 extern tcuStreamQuery *cuStreamQuery;
1211 extern tcuStreamSynchronize *cuStreamSynchronize;
1212 extern tcuStreamDestroy_v2 *cuStreamDestroy_v2;
1213 extern tcuEventCreate *cuEventCreate;
1214 extern tcuEventRecord *cuEventRecord;
1215 extern tcuEventQuery *cuEventQuery;
1216 extern tcuEventSynchronize *cuEventSynchronize;
1217 extern tcuEventDestroy_v2 *cuEventDestroy_v2;
1218 extern tcuEventElapsedTime *cuEventElapsedTime;
1219 extern tcuStreamWaitValue32 *cuStreamWaitValue32;
1220 extern tcuStreamWriteValue32 *cuStreamWriteValue32;
1221 extern tcuStreamBatchMemOp *cuStreamBatchMemOp;
1222 extern tcuFuncGetAttribute *cuFuncGetAttribute;
1223 extern tcuFuncSetCacheConfig *cuFuncSetCacheConfig;
1224 extern tcuFuncSetSharedMemConfig *cuFuncSetSharedMemConfig;
1225 extern tcuLaunchKernel *cuLaunchKernel;
1226 extern tcuFuncSetBlockShape *cuFuncSetBlockShape;
1227 extern tcuFuncSetSharedSize *cuFuncSetSharedSize;
1228 extern tcuParamSetSize *cuParamSetSize;
1229 extern tcuParamSeti *cuParamSeti;
1230 extern tcuParamSetf *cuParamSetf;
1231 extern tcuParamSetv *cuParamSetv;
1232 extern tcuLaunch *cuLaunch;
1233 extern tcuLaunchGrid *cuLaunchGrid;
1234 extern tcuLaunchGridAsync *cuLaunchGridAsync;
1235 extern tcuParamSetTexRef *cuParamSetTexRef;
1236 extern tcuOccupancyMaxActiveBlocksPerMultiprocessor *cuOccupancyMaxActiveBlocksPerMultiprocessor;
1237 extern tcuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags *cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags;
1238 extern tcuOccupancyMaxPotentialBlockSize *cuOccupancyMaxPotentialBlockSize;
1239 extern tcuOccupancyMaxPotentialBlockSizeWithFlags *cuOccupancyMaxPotentialBlockSizeWithFlags;
1240 extern tcuTexRefSetArray *cuTexRefSetArray;
1241 extern tcuTexRefSetMipmappedArray *cuTexRefSetMipmappedArray;
1242 extern tcuTexRefSetAddress_v2 *cuTexRefSetAddress_v2;
1243 extern tcuTexRefSetAddress2D_v3 *cuTexRefSetAddress2D_v3;
1244 extern tcuTexRefSetFormat *cuTexRefSetFormat;
1245 extern tcuTexRefSetAddressMode *cuTexRefSetAddressMode;
1246 extern tcuTexRefSetFilterMode *cuTexRefSetFilterMode;
1247 extern tcuTexRefSetMipmapFilterMode *cuTexRefSetMipmapFilterMode;
1248 extern tcuTexRefSetMipmapLevelBias *cuTexRefSetMipmapLevelBias;
1249 extern tcuTexRefSetMipmapLevelClamp *cuTexRefSetMipmapLevelClamp;
1250 extern tcuTexRefSetMaxAnisotropy *cuTexRefSetMaxAnisotropy;
1251 extern tcuTexRefSetBorderColor *cuTexRefSetBorderColor;
1252 extern tcuTexRefSetFlags *cuTexRefSetFlags;
1253 extern tcuTexRefGetAddress_v2 *cuTexRefGetAddress_v2;
1254 extern tcuTexRefGetArray *cuTexRefGetArray;
1255 extern tcuTexRefGetMipmappedArray *cuTexRefGetMipmappedArray;
1256 extern tcuTexRefGetAddressMode *cuTexRefGetAddressMode;
1257 extern tcuTexRefGetFilterMode *cuTexRefGetFilterMode;
1258 extern tcuTexRefGetFormat *cuTexRefGetFormat;
1259 extern tcuTexRefGetMipmapFilterMode *cuTexRefGetMipmapFilterMode;
1260 extern tcuTexRefGetMipmapLevelBias *cuTexRefGetMipmapLevelBias;
1261 extern tcuTexRefGetMipmapLevelClamp *cuTexRefGetMipmapLevelClamp;
1262 extern tcuTexRefGetMaxAnisotropy *cuTexRefGetMaxAnisotropy;
1263 extern tcuTexRefGetBorderColor *cuTexRefGetBorderColor;
1264 extern tcuTexRefGetFlags *cuTexRefGetFlags;
1265 extern tcuTexRefCreate *cuTexRefCreate;
1266 extern tcuTexRefDestroy *cuTexRefDestroy;
1267 extern tcuSurfRefSetArray *cuSurfRefSetArray;
1268 extern tcuSurfRefGetArray *cuSurfRefGetArray;
1269 extern tcuTexObjectCreate *cuTexObjectCreate;
1270 extern tcuTexObjectDestroy *cuTexObjectDestroy;
1271 extern tcuTexObjectGetResourceDesc *cuTexObjectGetResourceDesc;
1272 extern tcuTexObjectGetTextureDesc *cuTexObjectGetTextureDesc;
1273 extern tcuTexObjectGetResourceViewDesc *cuTexObjectGetResourceViewDesc;
1274 extern tcuSurfObjectCreate *cuSurfObjectCreate;
1275 extern tcuSurfObjectDestroy *cuSurfObjectDestroy;
1276 extern tcuSurfObjectGetResourceDesc *cuSurfObjectGetResourceDesc;
1277 extern tcuDeviceCanAccessPeer *cuDeviceCanAccessPeer;
1278 extern tcuDeviceGetP2PAttribute *cuDeviceGetP2PAttribute;
1279 extern tcuCtxEnablePeerAccess *cuCtxEnablePeerAccess;
1280 extern tcuCtxDisablePeerAccess *cuCtxDisablePeerAccess;
1281 extern tcuGraphicsUnregisterResource *cuGraphicsUnregisterResource;
1282 extern tcuGraphicsSubResourceGetMappedArray *cuGraphicsSubResourceGetMappedArray;
1283 extern tcuGraphicsResourceGetMappedMipmappedArray *cuGraphicsResourceGetMappedMipmappedArray;
1284 extern tcuGraphicsResourceGetMappedPointer_v2 *cuGraphicsResourceGetMappedPointer_v2;
1285 extern tcuGraphicsResourceSetMapFlags_v2 *cuGraphicsResourceSetMapFlags_v2;
1286 extern tcuGraphicsMapResources *cuGraphicsMapResources;
1287 extern tcuGraphicsUnmapResources *cuGraphicsUnmapResources;
1288 extern tcuGetExportTable *cuGetExportTable;
1289
1290 extern tcuGraphicsGLRegisterBuffer *cuGraphicsGLRegisterBuffer;
1291 extern tcuGraphicsGLRegisterImage *cuGraphicsGLRegisterImage;
1292 extern tcuGLGetDevices_v2 *cuGLGetDevices_v2;
1293 extern tcuGLCtxCreate_v2 *cuGLCtxCreate_v2;
1294 extern tcuGLInit *cuGLInit;
1295 extern tcuGLRegisterBufferObject *cuGLRegisterBufferObject;
1296 extern tcuGLMapBufferObject_v2 *cuGLMapBufferObject_v2;
1297 extern tcuGLUnmapBufferObject *cuGLUnmapBufferObject;
1298 extern tcuGLUnregisterBufferObject *cuGLUnregisterBufferObject;
1299 extern tcuGLSetBufferObjectMapFlags *cuGLSetBufferObjectMapFlags;
1300 extern tcuGLMapBufferObjectAsync_v2 *cuGLMapBufferObjectAsync_v2;
1301 extern tcuGLUnmapBufferObjectAsync *cuGLUnmapBufferObjectAsync;
1302
1303 extern tnvrtcGetErrorString *nvrtcGetErrorString;
1304 extern tnvrtcVersion *nvrtcVersion;
1305 extern tnvrtcCreateProgram *nvrtcCreateProgram;
1306 extern tnvrtcDestroyProgram *nvrtcDestroyProgram;
1307 extern tnvrtcCompileProgram *nvrtcCompileProgram;
1308 extern tnvrtcGetPTXSize *nvrtcGetPTXSize;
1309 extern tnvrtcGetPTX *nvrtcGetPTX;
1310 extern tnvrtcGetProgramLogSize *nvrtcGetProgramLogSize;
1311 extern tnvrtcGetProgramLog *nvrtcGetProgramLog;
1312 extern tnvrtcAddNameExpression *nvrtcAddNameExpression;
1313 extern tnvrtcGetLoweredName *nvrtcGetLoweredName;
1314
1315
1316 enum {
1317   CUEW_SUCCESS = 0,
1318   CUEW_ERROR_OPEN_FAILED = -1,
1319   CUEW_ERROR_ATEXIT_FAILED = -2,
1320 };
1321
1322 int cuewInit(void);
1323 const char *cuewErrorString(CUresult result);
1324 const char *cuewCompilerPath(void);
1325 int cuewCompilerVersion(void);
1326 int cuewNvrtcVersion(void);
1327
1328 #ifdef __cplusplus
1329 }
1330 #endif
1331
1332 #endif  /* __CUEW_H__ */