1//===--- cuda/dynamic_cuda/cuda.h --------------------------------- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// The parts of the cuda api that are presently in use by the openmp cuda plugin
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef DYNAMIC_CUDA_CUDA_H_INCLUDED
14#define DYNAMIC_CUDA_CUDA_H_INCLUDED
15
16#include <cstddef>
17#include <cstdint>
18
19typedef int CUdevice;
20typedef uintptr_t CUdeviceptr;
21typedef struct CUmod_st *CUmodule;
22typedef struct CUctx_st *CUcontext;
23typedef struct CUfunc_st *CUfunction;
24typedef struct CUstream_st *CUstream;
25typedef struct CUevent_st *CUevent;
26
27#define CU_DEVICE_INVALID ((CUdevice)-2)
28
29typedef unsigned long long CUmemGenericAllocationHandle_v1;
30typedef CUmemGenericAllocationHandle_v1 CUmemGenericAllocationHandle;
31
32#define CU_DEVICE_INVALID ((CUdevice)-2)
33
34typedef enum CUmemAllocationGranularity_flags_enum {
35 CU_MEM_ALLOC_GRANULARITY_MINIMUM = 0x0,
36 CU_MEM_ALLOC_GRANULARITY_RECOMMENDED = 0x1
37} CUmemAllocationGranularity_flags;
38
39typedef enum CUmemAccess_flags_enum {
40 CU_MEM_ACCESS_FLAGS_PROT_NONE = 0x0,
41 CU_MEM_ACCESS_FLAGS_PROT_READ = 0x1,
42 CU_MEM_ACCESS_FLAGS_PROT_READWRITE = 0x3,
43 CU_MEM_ACCESS_FLAGS_PROT_MAX = 0x7FFFFFFF
44} CUmemAccess_flags;
45
46typedef enum CUmemLocationType_enum {
47 CU_MEM_LOCATION_TYPE_INVALID = 0x0,
48 CU_MEM_LOCATION_TYPE_DEVICE = 0x1,
49 CU_MEM_LOCATION_TYPE_MAX = 0x7FFFFFFF
50} CUmemLocationType;
51
52typedef struct CUmemLocation_st {
53 CUmemLocationType type;
54 int id;
55} CUmemLocation_v1;
56typedef CUmemLocation_v1 CUmemLocation;
57
58typedef struct CUmemAccessDesc_st {
59 CUmemLocation location;
60 CUmemAccess_flags flags;
61} CUmemAccessDesc_v1;
62
63typedef CUmemAccessDesc_v1 CUmemAccessDesc;
64
65typedef enum CUmemAllocationType_enum {
66 CU_MEM_ALLOCATION_TYPE_INVALID = 0x0,
67 CU_MEM_ALLOCATION_TYPE_PINNED = 0x1,
68 CU_MEM_ALLOCATION_TYPE_MAX = 0x7FFFFFFF
69} CUmemAllocationType;
70
71typedef enum CUmemAllocationHandleType_enum {
72 CU_MEM_HANDLE_TYPE_NONE = 0x0,
73 CU_MEM_HANDLE_TYPE_POSIX_FILE_DESCRIPTOR = 0x1,
74 CU_MEM_HANDLE_TYPE_WIN32 = 0x2,
75 CU_MEM_HANDLE_TYPE_WIN32_KMT = 0x4,
76 CU_MEM_HANDLE_TYPE_MAX = 0x7FFFFFFF
77} CUmemAllocationHandleType;
78
79typedef struct CUmemAllocationProp_st {
80 CUmemAllocationType type;
81 CUmemAllocationHandleType requestedHandleTypes;
82 CUmemLocation location;
83
84 void *win32HandleMetaData;
85 struct {
86 unsigned char compressionType;
87 unsigned char gpuDirectRDMACapable;
88 unsigned short usage;
89 unsigned char reserved[4];
90 } allocFlags;
91} CUmemAllocationProp_v1;
92typedef CUmemAllocationProp_v1 CUmemAllocationProp;
93
94typedef enum cudaError_enum {
95 CUDA_SUCCESS = 0,
96 CUDA_ERROR_INVALID_VALUE = 1,
97 CUDA_ERROR_NO_DEVICE = 100,
98 CUDA_ERROR_INVALID_HANDLE = 400,
99 CUDA_ERROR_NOT_READY = 600,
100 CUDA_ERROR_TOO_MANY_PEERS = 711,
101} CUresult;
102
103typedef enum CUstream_flags_enum {
104 CU_STREAM_DEFAULT = 0x0,
105 CU_STREAM_NON_BLOCKING = 0x1,
106} CUstream_flags;
107
108typedef enum CUlimit_enum {
109 CU_LIMIT_STACK_SIZE = 0x0,
110 CU_LIMIT_PRINTF_FIFO_SIZE = 0x1,
111 CU_LIMIT_MALLOC_HEAP_SIZE = 0x2,
112 CU_LIMIT_DEV_RUNTIME_SYNC_DEPTH = 0x3,
113 CU_LIMIT_DEV_RUNTIME_PENDING_LAUNCH_COUNT = 0x4,
114 CU_LIMIT_MAX_L2_FETCH_GRANULARITY = 0x5,
115 CU_LIMIT_PERSISTING_L2_CACHE_SIZE = 0x6,
116 CU_LIMIT_MAX
117} CUlimit;
118
119typedef enum CUdevice_attribute_enum {
120 CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_BLOCK = 1,
121 CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_X = 2,
122 CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Y = 3,
123 CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Z = 4,
124 CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_X = 5,
125 CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_Y = 6,
126 CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_Z = 7,
127 CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK = 8,
128 CU_DEVICE_ATTRIBUTE_SHARED_MEMORY_PER_BLOCK = 8,
129 CU_DEVICE_ATTRIBUTE_TOTAL_CONSTANT_MEMORY = 9,
130 CU_DEVICE_ATTRIBUTE_WARP_SIZE = 10,
131 CU_DEVICE_ATTRIBUTE_MAX_PITCH = 11,
132 CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_BLOCK = 12,
133 CU_DEVICE_ATTRIBUTE_REGISTERS_PER_BLOCK = 12,
134 CU_DEVICE_ATTRIBUTE_CLOCK_RATE = 13,
135 CU_DEVICE_ATTRIBUTE_TEXTURE_ALIGNMENT = 14,
136 CU_DEVICE_ATTRIBUTE_GPU_OVERLAP = 15,
137 CU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT = 16,
138 CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT = 17,
139 CU_DEVICE_ATTRIBUTE_INTEGRATED = 18,
140 CU_DEVICE_ATTRIBUTE_CAN_MAP_HOST_MEMORY = 19,
141 CU_DEVICE_ATTRIBUTE_COMPUTE_MODE = 20,
142 CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_WIDTH = 21,
143 CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_WIDTH = 22,
144 CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_HEIGHT = 23,
145 CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH = 24,
146 CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT = 25,
147 CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH = 26,
148 CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_WIDTH = 27,
149 CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_HEIGHT = 28,
150 CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_LAYERS = 29,
151 CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_ARRAY_WIDTH = 27,
152 CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_ARRAY_HEIGHT = 28,
153 CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_ARRAY_NUMSLICES = 29,
154 CU_DEVICE_ATTRIBUTE_SURFACE_ALIGNMENT = 30,
155 CU_DEVICE_ATTRIBUTE_CONCURRENT_KERNELS = 31,
156 CU_DEVICE_ATTRIBUTE_ECC_ENABLED = 32,
157 CU_DEVICE_ATTRIBUTE_PCI_BUS_ID = 33,
158 CU_DEVICE_ATTRIBUTE_PCI_DEVICE_ID = 34,
159 CU_DEVICE_ATTRIBUTE_TCC_DRIVER = 35,
160 CU_DEVICE_ATTRIBUTE_MEMORY_CLOCK_RATE = 36,
161 CU_DEVICE_ATTRIBUTE_GLOBAL_MEMORY_BUS_WIDTH = 37,
162 CU_DEVICE_ATTRIBUTE_L2_CACHE_SIZE = 38,
163 CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_MULTIPROCESSOR = 39,
164 CU_DEVICE_ATTRIBUTE_ASYNC_ENGINE_COUNT = 40,
165 CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING = 41,
166 CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_WIDTH = 42,
167 CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_LAYERS = 43,
168 CU_DEVICE_ATTRIBUTE_CAN_TEX2D_GATHER = 44,
169 CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_WIDTH = 45,
170 CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_HEIGHT = 46,
171 CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH_ALTERNATE = 47,
172 CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT_ALTERNATE = 48,
173 CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH_ALTERNATE = 49,
174 CU_DEVICE_ATTRIBUTE_PCI_DOMAIN_ID = 50,
175 CU_DEVICE_ATTRIBUTE_TEXTURE_PITCH_ALIGNMENT = 51,
176 CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_WIDTH = 52,
177 CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_LAYERED_WIDTH = 53,
178 CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_LAYERED_LAYERS = 54,
179 CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_WIDTH = 55,
180 CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_WIDTH = 56,
181 CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_HEIGHT = 57,
182 CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_WIDTH = 58,
183 CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_HEIGHT = 59,
184 CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_DEPTH = 60,
185 CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_WIDTH = 61,
186 CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_LAYERS = 62,
187 CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_WIDTH = 63,
188 CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_HEIGHT = 64,
189 CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_LAYERS = 65,
190 CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_WIDTH = 66,
191 CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_WIDTH = 67,
192 CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_LAYERS = 68,
193 CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LINEAR_WIDTH = 69,
194 CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_WIDTH = 70,
195 CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_HEIGHT = 71,
196 CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_PITCH = 72,
197 CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_WIDTH = 73,
198 CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_HEIGHT = 74,
199 CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR = 75,
200 CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR = 76,
201 CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_MIPMAPPED_WIDTH = 77,
202 CU_DEVICE_ATTRIBUTE_STREAM_PRIORITIES_SUPPORTED = 78,
203 CU_DEVICE_ATTRIBUTE_GLOBAL_L1_CACHE_SUPPORTED = 79,
204 CU_DEVICE_ATTRIBUTE_LOCAL_L1_CACHE_SUPPORTED = 80,
205 CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_MULTIPROCESSOR = 81,
206 CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_MULTIPROCESSOR = 82,
207 CU_DEVICE_ATTRIBUTE_MANAGED_MEMORY = 83,
208 CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD = 84,
209 CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD_GROUP_ID = 85,
210 CU_DEVICE_ATTRIBUTE_HOST_NATIVE_ATOMIC_SUPPORTED = 86,
211 CU_DEVICE_ATTRIBUTE_SINGLE_TO_DOUBLE_PRECISION_PERF_RATIO = 87,
212 CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS = 88,
213 CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS = 89,
214 CU_DEVICE_ATTRIBUTE_COMPUTE_PREEMPTION_SUPPORTED = 90,
215 CU_DEVICE_ATTRIBUTE_CAN_USE_HOST_POINTER_FOR_REGISTERED_MEM = 91,
216 CU_DEVICE_ATTRIBUTE_CAN_USE_STREAM_MEM_OPS = 92,
217 CU_DEVICE_ATTRIBUTE_CAN_USE_64_BIT_STREAM_MEM_OPS = 93,
218 CU_DEVICE_ATTRIBUTE_CAN_USE_STREAM_WAIT_VALUE_NOR = 94,
219 CU_DEVICE_ATTRIBUTE_COOPERATIVE_LAUNCH = 95,
220 CU_DEVICE_ATTRIBUTE_COOPERATIVE_MULTI_DEVICE_LAUNCH = 96,
221 CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK_OPTIN = 97,
222 CU_DEVICE_ATTRIBUTE_CAN_FLUSH_REMOTE_WRITES = 98,
223 CU_DEVICE_ATTRIBUTE_HOST_REGISTER_SUPPORTED = 99,
224 CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES = 100,
225 CU_DEVICE_ATTRIBUTE_DIRECT_MANAGED_MEM_ACCESS_FROM_HOST = 101,
226 CU_DEVICE_ATTRIBUTE_VIRTUAL_ADDRESS_MANAGEMENT_SUPPORTED = 102,
227 CU_DEVICE_ATTRIBUTE_VIRTUAL_MEMORY_MANAGEMENT_SUPPORTED = 102,
228 CU_DEVICE_ATTRIBUTE_HANDLE_TYPE_POSIX_FILE_DESCRIPTOR_SUPPORTED = 103,
229 CU_DEVICE_ATTRIBUTE_HANDLE_TYPE_WIN32_HANDLE_SUPPORTED = 104,
230 CU_DEVICE_ATTRIBUTE_HANDLE_TYPE_WIN32_KMT_HANDLE_SUPPORTED = 105,
231 CU_DEVICE_ATTRIBUTE_MAX_BLOCKS_PER_MULTIPROCESSOR = 106,
232 CU_DEVICE_ATTRIBUTE_GENERIC_COMPRESSION_SUPPORTED = 107,
233 CU_DEVICE_ATTRIBUTE_MAX_PERSISTING_L2_CACHE_SIZE = 108,
234 CU_DEVICE_ATTRIBUTE_MAX_ACCESS_POLICY_WINDOW_SIZE = 109,
235 CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_WITH_CUDA_VMM_SUPPORTED = 110,
236 CU_DEVICE_ATTRIBUTE_RESERVED_SHARED_MEMORY_PER_BLOCK = 111,
237 CU_DEVICE_ATTRIBUTE_SPARSE_CUDA_ARRAY_SUPPORTED = 112,
238 CU_DEVICE_ATTRIBUTE_READ_ONLY_HOST_REGISTER_SUPPORTED = 113,
239 CU_DEVICE_ATTRIBUTE_TIMELINE_SEMAPHORE_INTEROP_SUPPORTED = 114,
240 CU_DEVICE_ATTRIBUTE_MEMORY_POOLS_SUPPORTED = 115,
241 CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_SUPPORTED = 116,
242 CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_FLUSH_WRITES_OPTIONS = 117,
243 CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_WRITES_ORDERING = 118,
244 CU_DEVICE_ATTRIBUTE_MEMPOOL_SUPPORTED_HANDLE_TYPES = 119,
245 CU_DEVICE_ATTRIBUTE_MAX,
246} CUdevice_attribute;
247
248typedef enum CUfunction_attribute_enum {
249 CU_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK = 0,
250} CUfunction_attribute;
251
252typedef enum CUctx_flags_enum {
253 CU_CTX_SCHED_BLOCKING_SYNC = 0x04,
254 CU_CTX_SCHED_MASK = 0x07,
255} CUctx_flags;
256
257typedef enum CUmemAttach_flags_enum {
258 CU_MEM_ATTACH_GLOBAL = 0x1,
259 CU_MEM_ATTACH_HOST = 0x2,
260 CU_MEM_ATTACH_SINGLE = 0x4,
261} CUmemAttach_flags;
262
263typedef enum CUcomputeMode_enum {
264 CU_COMPUTEMODE_DEFAULT = 0,
265 CU_COMPUTEMODE_PROHIBITED = 2,
266 CU_COMPUTEMODE_EXCLUSIVE_PROCESS = 3,
267} CUcompute_mode;
268
269typedef enum CUevent_flags_enum {
270 CU_EVENT_DEFAULT = 0x0,
271 CU_EVENT_BLOCKING_SYNC = 0x1,
272 CU_EVENT_DISABLE_TIMING = 0x2,
273 CU_EVENT_INTERPROCESS = 0x4
274} CUevent_flags;
275
276CUresult cuCtxGetDevice(CUdevice *);
277CUresult cuDeviceGet(CUdevice *, int);
278CUresult cuDeviceGetAttribute(int *, CUdevice_attribute, CUdevice);
279CUresult cuDeviceGetCount(int *);
280CUresult cuFuncGetAttribute(int *, CUfunction_attribute, CUfunction);
281
282// Device info
283CUresult cuDeviceGetName(char *, int, CUdevice);
284CUresult cuDeviceTotalMem(size_t *, CUdevice);
285CUresult cuDriverGetVersion(int *);
286
287CUresult cuGetErrorString(CUresult, const char **);
288CUresult cuInit(unsigned);
289CUresult cuLaunchKernel(CUfunction, unsigned, unsigned, unsigned, unsigned,
290 unsigned, unsigned, unsigned, CUstream, void **,
291 void **);
292
293CUresult cuMemAlloc(CUdeviceptr *, size_t);
294CUresult cuMemAllocHost(void **, size_t);
295CUresult cuMemAllocManaged(CUdeviceptr *, size_t, unsigned int);
296CUresult cuMemAllocAsync(CUdeviceptr *, size_t, CUstream);
297
298CUresult cuMemcpyDtoDAsync(CUdeviceptr, CUdeviceptr, size_t, CUstream);
299CUresult cuMemcpyDtoH(void *, CUdeviceptr, size_t);
300CUresult cuMemcpyDtoHAsync(void *, CUdeviceptr, size_t, CUstream);
301CUresult cuMemcpyHtoD(CUdeviceptr, const void *, size_t);
302CUresult cuMemcpyHtoDAsync(CUdeviceptr, const void *, size_t, CUstream);
303
304CUresult cuMemFree(CUdeviceptr);
305CUresult cuMemFreeHost(void *);
306CUresult cuMemFreeAsync(CUdeviceptr, CUstream);
307
308CUresult cuModuleGetFunction(CUfunction *, CUmodule, const char *);
309CUresult cuModuleGetGlobal(CUdeviceptr *, size_t *, CUmodule, const char *);
310
311CUresult cuModuleUnload(CUmodule);
312CUresult cuStreamCreate(CUstream *, unsigned);
313CUresult cuStreamDestroy(CUstream);
314CUresult cuStreamSynchronize(CUstream);
315CUresult cuStreamQuery(CUstream);
316CUresult cuCtxSetCurrent(CUcontext);
317CUresult cuDevicePrimaryCtxRelease(CUdevice);
318CUresult cuDevicePrimaryCtxGetState(CUdevice, unsigned *, int *);
319CUresult cuDevicePrimaryCtxSetFlags(CUdevice, unsigned);
320CUresult cuDevicePrimaryCtxRetain(CUcontext *, CUdevice);
321CUresult cuModuleLoadDataEx(CUmodule *, const void *, unsigned, void *,
322 void **);
323
324CUresult cuDeviceCanAccessPeer(int *, CUdevice, CUdevice);
325CUresult cuCtxEnablePeerAccess(CUcontext, unsigned);
326CUresult cuMemcpyPeerAsync(CUdeviceptr, CUcontext, CUdeviceptr, CUcontext,
327 size_t, CUstream);
328
329CUresult cuCtxGetLimit(size_t *, CUlimit);
330CUresult cuCtxSetLimit(CUlimit, size_t);
331
332CUresult cuEventCreate(CUevent *, unsigned int);
333CUresult cuEventRecord(CUevent, CUstream);
334CUresult cuStreamWaitEvent(CUstream, CUevent, unsigned int);
335CUresult cuEventSynchronize(CUevent);
336CUresult cuEventDestroy(CUevent);
337
338CUresult cuMemUnmap(CUdeviceptr ptr, size_t size);
339CUresult cuMemRelease(CUmemGenericAllocationHandle handle);
340CUresult cuMemAddressFree(CUdeviceptr ptr, size_t size);
341CUresult cuMemGetInfo(size_t *free, size_t *total);
342CUresult cuMemAddressReserve(CUdeviceptr *ptr, size_t size, size_t alignment,
343 CUdeviceptr addr, unsigned long long flags);
344CUresult cuMemMap(CUdeviceptr ptr, size_t size, size_t offset,
345 CUmemGenericAllocationHandle handle,
346 unsigned long long flags);
347CUresult cuMemCreate(CUmemGenericAllocationHandle *handle, size_t size,
348 const CUmemAllocationProp *prop, unsigned long long flags);
349CUresult cuMemSetAccess(CUdeviceptr ptr, size_t size,
350 const CUmemAccessDesc *desc, size_t count);
351CUresult cuMemGetAllocationGranularity(size_t *granularity,
352 const CUmemAllocationProp *prop,
353 CUmemAllocationGranularity_flags option);
354
355#endif
356

source code of offload/plugins-nextgen/cuda/dynamic_cuda/cuda.h