1// clang-format off
2
3// Driver
4PER_CUDA_FUNCTION(init, cuInit, int);
5
6// Device management
7PER_CUDA_FUNCTION(device_get_count, cuDeviceGetCount, int *);
8PER_CUDA_FUNCTION(device_get, cuDeviceGet, void *, void *);
9PER_CUDA_FUNCTION(device_get_name, cuDeviceGetName, char *, int, void *);
10PER_CUDA_FUNCTION(device_get_attribute, cuDeviceGetAttribute, int *, uint32, void *);
11
12
13// Context management
14PER_CUDA_FUNCTION(context_create, cuCtxCreate_v2, void*, int, void *);
15PER_CUDA_FUNCTION(context_set_current, cuCtxSetCurrent, void *);
16PER_CUDA_FUNCTION(context_get_current, cuCtxGetCurrent, void **);
17PER_CUDA_FUNCTION(primary_context_retain, cuDevicePrimaryCtxRetain, void **, int);
18PER_CUDA_FUNCTION(context_set_limit, cuCtxSetLimit, int, std::size_t);
19
20// Stream management
21PER_CUDA_FUNCTION(stream_create, cuStreamCreate, void **, uint32);
22
23// Memory management
24PER_CUDA_FUNCTION(memcpy_host_to_device, cuMemcpyHtoD_v2, void *, void *, std::size_t);
25PER_CUDA_FUNCTION(memcpy_device_to_host, cuMemcpyDtoH_v2, void *, void *, std::size_t);
26PER_CUDA_FUNCTION(memcpy_device_to_device, cuMemcpyDtoD_v2, void *, void *, std::size_t);
27PER_CUDA_FUNCTION(memcpy_host_to_device_async, cuMemcpyHtoDAsync_v2, void *, void *, std::size_t, void *);
28PER_CUDA_FUNCTION(memcpy_device_to_host_async, cuMemcpyDtoHAsync_v2, void *, void *, std::size_t, void*);
29PER_CUDA_FUNCTION(malloc, cuMemAlloc_v2, void **, std::size_t);
30PER_CUDA_FUNCTION(malloc_managed, cuMemAllocManaged, void **, std::size_t, uint32);
31PER_CUDA_FUNCTION(memset, cuMemsetD8_v2, void *, uint8, std::size_t);
32PER_CUDA_FUNCTION(memsetd32, cuMemsetD32_v2, void *, uint32, std::size_t);
33PER_CUDA_FUNCTION(mem_free, cuMemFree_v2, void *);
34PER_CUDA_FUNCTION(mem_advise, cuMemAdvise, void *, std::size_t, uint32, uint32);
35PER_CUDA_FUNCTION(mem_get_info, cuMemGetInfo_v2, std::size_t *, std::size_t *);
36PER_CUDA_FUNCTION(mem_get_attribute, cuPointerGetAttribute, void *, uint32, void *);
37
38// Module and kernels
39PER_CUDA_FUNCTION(module_get_function, cuModuleGetFunction, void **, void *, const char *);
40PER_CUDA_FUNCTION(module_load_data_ex, cuModuleLoadDataEx, void **, const char *,
41 uint32, uint32 *, void **)
42PER_CUDA_FUNCTION(launch_kernel, cuLaunchKernel, void *, uint32, uint32, uint32,
43 uint32, uint32, uint32, uint32, void *, void **, void **);
44PER_CUDA_FUNCTION(kernel_get_attribute, cuFuncGetAttribute, int *, uint32, void *);
45PER_CUDA_FUNCTION(kernel_get_occupancy, cuOccupancyMaxActiveBlocksPerMultiprocessor, int *, void *, int, size_t);
46
47// Stream management
48PER_CUDA_FUNCTION(stream_synchronize, cuStreamSynchronize, void *);
49
50// Event management
51PER_CUDA_FUNCTION(event_create, cuEventCreate, void **, uint32)
52PER_CUDA_FUNCTION(event_destroy, cuEventDestroy, void *)
53PER_CUDA_FUNCTION(event_record, cuEventRecord, void *, void *)
54PER_CUDA_FUNCTION(event_synchronize, cuEventSynchronize, void *);
55PER_CUDA_FUNCTION(event_elapsed_time, cuEventElapsedTime, float *, void *, void *);
56
57// Vulkan interop
58PER_CUDA_FUNCTION(import_external_memory, cuImportExternalMemory, CUexternalMemory*, CUDA_EXTERNAL_MEMORY_HANDLE_DESC*)
59PER_CUDA_FUNCTION(external_memory_get_mapped_buffer,cuExternalMemoryGetMappedBuffer,CUdeviceptr *, CUexternalMemory, const CUDA_EXTERNAL_MEMORY_BUFFER_DESC *)
60PER_CUDA_FUNCTION(external_memory_get_mapped_mipmapped_array,cuExternalMemoryGetMappedMipmappedArray,CUmipmappedArray *, CUexternalMemory, const CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC *)
61PER_CUDA_FUNCTION(mipmapped_array_get_level,cuMipmappedArrayGetLevel,CUarray *, CUmipmappedArray, unsigned int)
62PER_CUDA_FUNCTION(surf_object_create,cuSurfObjectCreate,CUsurfObject *, const CUDA_RESOURCE_DESC *)
63PER_CUDA_FUNCTION(signal_external_semaphore_async,cuSignalExternalSemaphoresAsync,const CUexternalSemaphore * , const CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS * , unsigned int , CUstream)
64PER_CUDA_FUNCTION(wait_external_semaphore_async,cuWaitExternalSemaphoresAsync,const CUexternalSemaphore * , const CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS * , unsigned int , CUstream)
65PER_CUDA_FUNCTION(import_external_semaphore, cuImportExternalSemaphore,CUexternalSemaphore * , const CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC *)
66// clang-format on
67