// Copyright (C) 2018-2024, Tellusim Technologies Inc. All rights reserved
// https://tellusim.com/

#ifndef __TELLUSIM_PLUGINS_PLATFORM_CU_H__
#define __TELLUSIM_PLUGINS_PLATFORM_CU_H__

#include <cuda/cuda.h>

/*
 */
namespace Tellusim {
	
	/**
	 * Cuda
	 */
	namespace CU {
		
		/// initialize Cuda functions
		bool init();
	}
	
	/// Cuda types
	typedef CUresult (CUDAAPI *PFN_cuGetErrorString)(CUresult error, const char **pStr);
	typedef CUresult (CUDAAPI *PFN_cuGetErrorName)(CUresult error, const char **pStr);
	typedef CUresult (CUDAAPI *PFN_cuInit)(uint32_t Flags);
	typedef CUresult (CUDAAPI *PFN_cuDriverGetVersion)(int32_t *driverVersion);
	typedef CUresult (CUDAAPI *PFN_cuDeviceGet)(CUdevice *device, int32_t ordinal);
	typedef CUresult (CUDAAPI *PFN_cuDeviceGetCount)(int32_t *count);
	typedef CUresult (CUDAAPI *PFN_cuDeviceGetName)(char *name, int32_t len, CUdevice dev);
	typedef CUresult (CUDAAPI *PFN_cuDeviceGetUuid)(CUuuid *uuid, CUdevice dev);
	typedef CUresult (CUDAAPI *PFN_cuDeviceTotalMem)(size_t *bytes, CUdevice dev);
	typedef CUresult (CUDAAPI *PFN_cuDeviceGetAttribute)(int32_t *pi, CUdevice_attribute attrib, CUdevice dev);
	typedef CUresult (CUDAAPI *PFN_cuDevicePrimaryCtxRetain)(CUcontext *pctx, CUdevice dev);
	typedef CUresult (CUDAAPI *PFN_cuDevicePrimaryCtxRelease)(CUdevice dev);
	typedef CUresult (CUDAAPI *PFN_cuDevicePrimaryCtxSetFlags)(CUdevice dev, uint32_t flags);
	typedef CUresult (CUDAAPI *PFN_cuDevicePrimaryCtxGetState)(CUdevice dev, uint32_t *flags, int32_t *active);
	typedef CUresult (CUDAAPI *PFN_cuDevicePrimaryCtxReset)(CUdevice dev);
	typedef CUresult (CUDAAPI *PFN_cuCtxCreate)(CUcontext *pctx, uint32_t flags, CUdevice dev);
	typedef CUresult (CUDAAPI *PFN_cuCtxDestroy)(CUcontext ctx);
	typedef CUresult (CUDAAPI *PFN_cuCtxPushCurrent)(CUcontext ctx);
	typedef CUresult (CUDAAPI *PFN_cuCtxPopCurrent)(CUcontext *pctx);
	typedef CUresult (CUDAAPI *PFN_cuCtxSetCurrent)(CUcontext ctx);
	typedef CUresult (CUDAAPI *PFN_cuCtxGetCurrent)(CUcontext *pctx);
	typedef CUresult (CUDAAPI *PFN_cuCtxGetDevice)(CUdevice *device);
	typedef CUresult (CUDAAPI *PFN_cuCtxGetFlags)(uint32_t *flags);
	typedef CUresult (CUDAAPI *PFN_cuCtxSynchronize)(void);
	typedef CUresult (CUDAAPI *PFN_cuCtxSetLimit)(CUlimit limit, size_t value);
	typedef CUresult (CUDAAPI *PFN_cuCtxGetLimit)(size_t *pvalue, CUlimit limit);
	typedef CUresult (CUDAAPI *PFN_cuCtxGetCacheConfig)(CUfunc_cache *pconfig);
	typedef CUresult (CUDAAPI *PFN_cuCtxSetCacheConfig)(CUfunc_cache config);
	typedef CUresult (CUDAAPI *PFN_cuCtxGetSharedMemConfig)(CUsharedconfig *pConfig);
	typedef CUresult (CUDAAPI *PFN_cuCtxSetSharedMemConfig)(CUsharedconfig config);
	typedef CUresult (CUDAAPI *PFN_cuCtxGetApiVersion)(CUcontext ctx, uint32_t *version);
	typedef CUresult (CUDAAPI *PFN_cuCtxGetStreamPriorityRange)(int32_t *leastPriority, int32_t *greatestPriority);
	typedef CUresult (CUDAAPI *PFN_cuModuleLoad)(CUmodule *module, const char *fname);
	typedef CUresult (CUDAAPI *PFN_cuModuleLoadData)(CUmodule *module, const void *image);
	typedef CUresult (CUDAAPI *PFN_cuModuleLoadDataEx)(CUmodule *module, const void *image, uint32_t numOptions, CUjit_option *options, void **optionValues);
	typedef CUresult (CUDAAPI *PFN_cuModuleLoadFatBinary)(CUmodule *module, const void *fatCubin);
	typedef CUresult (CUDAAPI *PFN_cuModuleUnload)(CUmodule hmod);
	typedef CUresult (CUDAAPI *PFN_cuModuleGetFunction)(CUfunction *hfunc, CUmodule hmod, const char *name);
	typedef CUresult (CUDAAPI *PFN_cuModuleGetGlobal)(CUdeviceptr *dptr, size_t *bytes, CUmodule hmod, const char *name);
	typedef CUresult (CUDAAPI *PFN_cuModuleGetTexRef)(CUtexref *pTexRef, CUmodule hmod, const char *name);
	typedef CUresult (CUDAAPI *PFN_cuModuleGetSurfRef)(CUsurfref *pSurfRef, CUmodule hmod, const char *name);
	typedef CUresult (CUDAAPI *PFN_cuLinkCreate)(uint32_t numOptions, CUjit_option *options, void **optionValues, CUlinkState *stateOut);
	typedef CUresult (CUDAAPI *PFN_cuLinkAddData)(CUlinkState state, CUjitInputType type, void *data, size_t size, const char *name, uint32_t numOptions, CUjit_option *options, void **optionValues);
	typedef CUresult (CUDAAPI *PFN_cuLinkAddFile)(CUlinkState state, CUjitInputType type, const char *path, uint32_t numOptions, CUjit_option *options, void **optionValues);
	typedef CUresult (CUDAAPI *PFN_cuLinkComplete)(CUlinkState state, void **cubinOut, size_t *sizeOut);
	typedef CUresult (CUDAAPI *PFN_cuLinkDestroy)(CUlinkState state);
	typedef CUresult (CUDAAPI *PFN_cuMemGetInfo)(size_t *free, size_t *total);
	typedef CUresult (CUDAAPI *PFN_cuMemAlloc)(CUdeviceptr *dptr, size_t bytesize);
	typedef CUresult (CUDAAPI *PFN_cuMemAllocPitch)(CUdeviceptr *dptr, size_t *pPitch, size_t WidthInBytes, size_t Height, uint32_t ElementSizeBytes);
	typedef CUresult (CUDAAPI *PFN_cuMemFree)(CUdeviceptr dptr);
	typedef CUresult (CUDAAPI *PFN_cuMemGetAddressRange)(CUdeviceptr *pbase, size_t *psize, CUdeviceptr dptr);
	typedef CUresult (CUDAAPI *PFN_cuMemAllocHost)(void **pp, size_t bytesize);
	typedef CUresult (CUDAAPI *PFN_cuMemFreeHost)(void *p);
	typedef CUresult (CUDAAPI *PFN_cuMemHostAlloc)(void **pp, size_t bytesize, uint32_t Flags);
	typedef CUresult (CUDAAPI *PFN_cuMemHostGetDevicePointer)(CUdeviceptr *pdptr, void *p, uint32_t Flags);
	typedef CUresult (CUDAAPI *PFN_cuMemHostGetFlags)(uint32_t *pFlags, void *p);
	typedef CUresult (CUDAAPI *PFN_cuMemAllocManaged)(CUdeviceptr *dptr, size_t bytesize, uint32_t flags);
	typedef CUresult (CUDAAPI *PFN_cuDeviceGetByPCIBusId)(CUdevice *dev, const char *pciBusId);
	typedef CUresult (CUDAAPI *PFN_cuDeviceGetPCIBusId)(char *pciBusId, int32_t len, CUdevice dev);
	typedef CUresult (CUDAAPI *PFN_cuIpcGetEventHandle)(CUipcEventHandle *pHandle, CUevent event);
	typedef CUresult (CUDAAPI *PFN_cuIpcOpenEventHandle)(CUevent *phEvent, CUipcEventHandle handle);
	typedef CUresult (CUDAAPI *PFN_cuIpcGetMemHandle)(CUipcMemHandle *pHandle, CUdeviceptr dptr);
	typedef CUresult (CUDAAPI *PFN_cuIpcOpenMemHandle)(CUdeviceptr *pdptr, CUipcMemHandle handle, uint32_t Flags);
	typedef CUresult (CUDAAPI *PFN_cuIpcCloseMemHandle)(CUdeviceptr dptr);
	typedef CUresult (CUDAAPI *PFN_cuMemHostRegister)(void *p, size_t bytesize, uint32_t Flags);
	typedef CUresult (CUDAAPI *PFN_cuMemHostUnregister)(void *p);
	typedef CUresult (CUDAAPI *PFN_cuMemcpy)(CUdeviceptr dst, CUdeviceptr src, size_t ByteCount);
	typedef CUresult (CUDAAPI *PFN_cuMemcpyPeer)(CUdeviceptr dstDevice, CUcontext dstContext, CUdeviceptr srcDevice, CUcontext srcContext, size_t ByteCount);
	typedef CUresult (CUDAAPI *PFN_cuMemcpyHtoD)(CUdeviceptr dstDevice, const void *srcHost, size_t ByteCount);
	typedef CUresult (CUDAAPI *PFN_cuMemcpyDtoH)(void *dstHost, CUdeviceptr srcDevice, size_t ByteCount);
	typedef CUresult (CUDAAPI *PFN_cuMemcpyDtoD)(CUdeviceptr dstDevice, CUdeviceptr srcDevice, size_t ByteCount);
	typedef CUresult (CUDAAPI *PFN_cuMemcpyDtoA)(CUarray dstArray, size_t dstOffset, CUdeviceptr srcDevice, size_t ByteCount);
	typedef CUresult (CUDAAPI *PFN_cuMemcpyAtoD)(CUdeviceptr dstDevice, CUarray srcArray, size_t srcOffset, size_t ByteCount);
	typedef CUresult (CUDAAPI *PFN_cuMemcpyHtoA)(CUarray dstArray, size_t dstOffset, const void *srcHost, size_t ByteCount);
	typedef CUresult (CUDAAPI *PFN_cuMemcpyAtoH)(void *dstHost, CUarray srcArray, size_t srcOffset, size_t ByteCount);
	typedef CUresult (CUDAAPI *PFN_cuMemcpyAtoA)(CUarray dstArray, size_t dstOffset, CUarray srcArray, size_t srcOffset, size_t ByteCount);
	typedef CUresult (CUDAAPI *PFN_cuMemcpy2D)(const CUDA_MEMCPY2D *pCopy);
	typedef CUresult (CUDAAPI *PFN_cuMemcpy2DUnaligned)(const CUDA_MEMCPY2D *pCopy);
	typedef CUresult (CUDAAPI *PFN_cuMemcpy3D)(const CUDA_MEMCPY3D *pCopy);
	typedef CUresult (CUDAAPI *PFN_cuMemcpy3DPeer)(const CUDA_MEMCPY3D_PEER *pCopy);
	typedef CUresult (CUDAAPI *PFN_cuMemcpyAsync)(CUdeviceptr dst, CUdeviceptr src, size_t ByteCount, CUstream hStream);
	typedef CUresult (CUDAAPI *PFN_cuMemcpyPeerAsync)(CUdeviceptr dstDevice, CUcontext dstContext, CUdeviceptr srcDevice, CUcontext srcContext, size_t ByteCount, CUstream hStream);
	typedef CUresult (CUDAAPI *PFN_cuMemcpyHtoDAsync)(CUdeviceptr dstDevice, const void *srcHost, size_t ByteCount, CUstream hStream);
	typedef CUresult (CUDAAPI *PFN_cuMemcpyDtoHAsync)(void *dstHost, CUdeviceptr srcDevice, size_t ByteCount, CUstream hStream);
	typedef CUresult (CUDAAPI *PFN_cuMemcpyDtoDAsync)(CUdeviceptr dstDevice, CUdeviceptr srcDevice, size_t ByteCount, CUstream hStream);
	typedef CUresult (CUDAAPI *PFN_cuMemcpyHtoAAsync)(CUarray dstArray, size_t dstOffset, const void *srcHost, size_t ByteCount, CUstream hStream);
	typedef CUresult (CUDAAPI *PFN_cuMemcpyAtoHAsync)(void *dstHost, CUarray srcArray, size_t srcOffset, size_t ByteCount, CUstream hStream);
	typedef CUresult (CUDAAPI *PFN_cuMemcpy2DAsync)(const CUDA_MEMCPY2D *pCopy, CUstream hStream);
	typedef CUresult (CUDAAPI *PFN_cuMemcpy3DAsync)(const CUDA_MEMCPY3D *pCopy, CUstream hStream);
	typedef CUresult (CUDAAPI *PFN_cuMemcpy3DPeerAsync)(const CUDA_MEMCPY3D_PEER *pCopy, CUstream hStream);
	typedef CUresult (CUDAAPI *PFN_cuMemsetD8)(CUdeviceptr dstDevice, uint8_t uc, size_t N);
	typedef CUresult (CUDAAPI *PFN_cuMemsetD16)(CUdeviceptr dstDevice, uint16_t us, size_t N);
	typedef CUresult (CUDAAPI *PFN_cuMemsetD32)(CUdeviceptr dstDevice, uint32_t ui, size_t N);
	typedef CUresult (CUDAAPI *PFN_cuMemsetD2D8)(CUdeviceptr dstDevice, size_t dstPitch, uint8_t uc, size_t Width, size_t Height);
	typedef CUresult (CUDAAPI *PFN_cuMemsetD2D16)(CUdeviceptr dstDevice, size_t dstPitch, uint16_t us, size_t Width, size_t Height);
	typedef CUresult (CUDAAPI *PFN_cuMemsetD2D32)(CUdeviceptr dstDevice, size_t dstPitch, uint32_t ui, size_t Width, size_t Height);
	typedef CUresult (CUDAAPI *PFN_cuMemsetD8Async)(CUdeviceptr dstDevice, uint8_t uc, size_t N, CUstream hStream);
	typedef CUresult (CUDAAPI *PFN_cuMemsetD16Async)(CUdeviceptr dstDevice, uint16_t us, size_t N, CUstream hStream);
	typedef CUresult (CUDAAPI *PFN_cuMemsetD32Async)(CUdeviceptr dstDevice, uint32_t ui, size_t N, CUstream hStream);
	typedef CUresult (CUDAAPI *PFN_cuMemsetD2D8Async)(CUdeviceptr dstDevice, size_t dstPitch, uint8_t uc, size_t Width, size_t Height, CUstream hStream);
	typedef CUresult (CUDAAPI *PFN_cuMemsetD2D16Async)(CUdeviceptr dstDevice, size_t dstPitch, uint16_t us, size_t Width, size_t Height, CUstream hStream);
	typedef CUresult (CUDAAPI *PFN_cuMemsetD2D32Async)(CUdeviceptr dstDevice, size_t dstPitch, uint32_t ui, size_t Width, size_t Height, CUstream hStream);
	typedef CUresult (CUDAAPI *PFN_cuArrayCreate)(CUarray *pHandle, const CUDA_ARRAY_DESCRIPTOR *pAllocateArray);
	typedef CUresult (CUDAAPI *PFN_cuArrayGetDescriptor)(CUDA_ARRAY_DESCRIPTOR *pArrayDescriptor, CUarray hArray);
	typedef CUresult (CUDAAPI *PFN_cuArrayDestroy)(CUarray hArray);
	typedef CUresult (CUDAAPI *PFN_cuArray3DCreate)(CUarray *pHandle, const CUDA_ARRAY3D_DESCRIPTOR *pAllocateArray);
	typedef CUresult (CUDAAPI *PFN_cuArray3DGetDescriptor)(CUDA_ARRAY3D_DESCRIPTOR *pArrayDescriptor, CUarray hArray);
	typedef CUresult (CUDAAPI *PFN_cuMipmappedArrayCreate)(CUmipmappedArray *pHandle, const CUDA_ARRAY3D_DESCRIPTOR *pMipmappedArrayDesc, uint32_t numMipmapLevels);
	typedef CUresult (CUDAAPI *PFN_cuMipmappedArrayGetLevel)(CUarray *pLevelArray, CUmipmappedArray hMipmappedArray, uint32_t level);
	typedef CUresult (CUDAAPI *PFN_cuMipmappedArrayDestroy)(CUmipmappedArray hMipmappedArray);
	typedef CUresult (CUDAAPI *PFN_cuPointerGetAttribute)(void *data, CUpointer_attribute attribute, CUdeviceptr ptr);
	typedef CUresult (CUDAAPI *PFN_cuMemPrefetchAsync)(CUdeviceptr devPtr, size_t count, CUdevice dstDevice, CUstream hStream);
	typedef CUresult (CUDAAPI *PFN_cuMemAdvise)(CUdeviceptr devPtr, size_t count, CUmem_advise advice, CUdevice device);
	typedef CUresult (CUDAAPI *PFN_cuMemRangeGetAttribute)(void *data, size_t dataSize, CUmem_range_attribute attribute, CUdeviceptr devPtr, size_t count);
	typedef CUresult (CUDAAPI *PFN_cuMemRangeGetAttributes)(void **data, size_t *dataSizes, CUmem_range_attribute *attributes, size_t numAttributes, CUdeviceptr devPtr, size_t count);
	typedef CUresult (CUDAAPI *PFN_cuPointerSetAttribute)(const void *value, CUpointer_attribute attribute, CUdeviceptr ptr);
	typedef CUresult (CUDAAPI *PFN_cuPointerGetAttributes)(uint32_t numAttributes, CUpointer_attribute *attributes, void **data, CUdeviceptr ptr);
	typedef CUresult (CUDAAPI *PFN_cuStreamCreate)(CUstream *phStream, uint32_t Flags);
	typedef CUresult (CUDAAPI *PFN_cuStreamCreateWithPriority)(CUstream *phStream, uint32_t flags, int32_t priority);
	typedef CUresult (CUDAAPI *PFN_cuStreamGetPriority)(CUstream hStream, int32_t *priority);
	typedef CUresult (CUDAAPI *PFN_cuStreamGetFlags)(CUstream hStream, uint32_t *flags);
	typedef CUresult (CUDAAPI *PFN_cuStreamGetCtx)(CUstream hStream, CUcontext *pctx);
	typedef CUresult (CUDAAPI *PFN_cuStreamWaitEvent)(CUstream hStream, CUevent hEvent, uint32_t Flags);
	typedef CUresult (CUDAAPI *PFN_cuStreamAddCallback)(CUstream hStream, CUstreamCallback callback, void *userData, uint32_t flags);
	typedef CUresult (CUDAAPI *PFN_cuStreamBeginCapture)(CUstream hStream);
	typedef CUresult (CUDAAPI *PFN_cuStreamEndCapture)(CUstream hStream, CUgraph *phGraph);
	typedef CUresult (CUDAAPI *PFN_cuStreamIsCapturing)(CUstream hStream, CUstreamCaptureStatus *captureStatus);
	typedef CUresult (CUDAAPI *PFN_cuStreamAttachMemAsync)(CUstream hStream, CUdeviceptr dptr, size_t length, uint32_t flags);
	typedef CUresult (CUDAAPI *PFN_cuStreamQuery)(CUstream hStream);
	typedef CUresult (CUDAAPI *PFN_cuStreamSynchronize)(CUstream hStream);
	typedef CUresult (CUDAAPI *PFN_cuStreamDestroy)(CUstream hStream);
	typedef CUresult (CUDAAPI *PFN_cuEventCreate)(CUevent *phEvent, uint32_t Flags);
	typedef CUresult (CUDAAPI *PFN_cuEventRecord)(CUevent hEvent, CUstream hStream);
	typedef CUresult (CUDAAPI *PFN_cuEventQuery)(CUevent hEvent);
	typedef CUresult (CUDAAPI *PFN_cuEventSynchronize)(CUevent hEvent);
	typedef CUresult (CUDAAPI *PFN_cuEventDestroy)(CUevent hEvent);
	typedef CUresult (CUDAAPI *PFN_cuEventElapsedTime)(float32_t *pMilliseconds, CUevent hStart, CUevent hEnd);
	typedef CUresult (CUDAAPI *PFN_cuImportExternalMemory)(CUexternalMemory *extMem_out, const CUDA_EXTERNAL_MEMORY_HANDLE_DESC *memHandleDesc);
	typedef CUresult (CUDAAPI *PFN_cuExternalMemoryGetMappedBuffer)(CUdeviceptr *devPtr, CUexternalMemory extMem, const CUDA_EXTERNAL_MEMORY_BUFFER_DESC *bufferDesc);
	typedef CUresult (CUDAAPI *PFN_cuExternalMemoryGetMappedMipmappedArray)(CUmipmappedArray *mipmap, CUexternalMemory extMem, const CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC *mipmapDesc);
	typedef CUresult (CUDAAPI *PFN_cuDestroyExternalMemory)(CUexternalMemory extMem);
	typedef CUresult (CUDAAPI *PFN_cuImportExternalSemaphore)(CUexternalSemaphore *extSem_out, const CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC *semHandleDesc);
	typedef CUresult (CUDAAPI *PFN_cuSignalExternalSemaphoresAsync)(const CUexternalSemaphore *extSemArray, const CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS *paramsArray, uint32_t numExtSems, CUstream stream);
	typedef CUresult (CUDAAPI *PFN_cuWaitExternalSemaphoresAsync)(const CUexternalSemaphore *extSemArray, const CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS *paramsArray, uint32_t numExtSems, CUstream stream);
	typedef CUresult (CUDAAPI *PFN_cuDestroyExternalSemaphore)(CUexternalSemaphore extSem);
	typedef CUresult (CUDAAPI *PFN_cuStreamWaitValue32)(CUstream stream, CUdeviceptr addr, cuuint32_t value, uint32_t flags);
	typedef CUresult (CUDAAPI *PFN_cuStreamWaitValue64)(CUstream stream, CUdeviceptr addr, cuuint64_t value, uint32_t flags);
	typedef CUresult (CUDAAPI *PFN_cuStreamWriteValue32)(CUstream stream, CUdeviceptr addr, cuuint32_t value, uint32_t flags);
	typedef CUresult (CUDAAPI *PFN_cuStreamWriteValue64)(CUstream stream, CUdeviceptr addr, cuuint64_t value, uint32_t flags);
	typedef CUresult (CUDAAPI *PFN_cuStreamBatchMemOp)(CUstream stream, uint32_t count, CUstreamBatchMemOpParams *paramArray, uint32_t flags);
	typedef CUresult (CUDAAPI *PFN_cuFuncGetAttribute)(int32_t *pi, CUfunction_attribute attrib, CUfunction hfunc);
	typedef CUresult (CUDAAPI *PFN_cuFuncSetAttribute)(CUfunction hfunc, CUfunction_attribute attrib, int32_t value);
	typedef CUresult (CUDAAPI *PFN_cuFuncSetCacheConfig)(CUfunction hfunc, CUfunc_cache config);
	typedef CUresult (CUDAAPI *PFN_cuFuncSetSharedMemConfig)(CUfunction hfunc, CUsharedconfig config);
	typedef CUresult (CUDAAPI *PFN_cuLaunchKernel)(CUfunction f, uint32_t gridDimX, uint32_t gridDimY, uint32_t gridDimZ, uint32_t blockDimX, uint32_t blockDimY, uint32_t blockDimZ, uint32_t sharedMemBytes, CUstream hStream, void **kernelParams, void **extra);
	typedef CUresult (CUDAAPI *PFN_cuLaunchCooperativeKernel)(CUfunction f, uint32_t gridDimX, uint32_t gridDimY, uint32_t gridDimZ, uint32_t blockDimX, uint32_t blockDimY, uint32_t blockDimZ, uint32_t sharedMemBytes, CUstream hStream, void **kernelParams);
	typedef CUresult (CUDAAPI *PFN_cuLaunchCooperativeKernelMultiDevice)(CUDA_LAUNCH_PARAMS *launchParamsList, uint32_t numDevices, uint32_t flags);
	typedef CUresult (CUDAAPI *PFN_cuLaunchHostFunc)(CUstream hStream, CUhostFn fn, void *userData);
	typedef CUresult (CUDAAPI *PFN_cuGraphCreate)(CUgraph *phGraph, uint32_t flags);
	typedef CUresult (CUDAAPI *PFN_cuGraphAddKernelNode)(CUgraphNode *phGraphNode, CUgraph hGraph, CUgraphNode *dependencies, size_t numDependencies, const CUDA_KERNEL_NODE_PARAMS *nodeParams);
	typedef CUresult (CUDAAPI *PFN_cuGraphKernelNodeGetParams)(CUgraphNode hNode, CUDA_KERNEL_NODE_PARAMS *nodeParams);
	typedef CUresult (CUDAAPI *PFN_cuGraphKernelNodeSetParams)(CUgraphNode hNode, const CUDA_KERNEL_NODE_PARAMS *nodeParams);
	typedef CUresult (CUDAAPI *PFN_cuGraphAddMemcpyNode)(CUgraphNode *phGraphNode, CUgraph hGraph, CUgraphNode *dependencies, size_t numDependencies, const CUDA_MEMCPY3D *copyParams, CUcontext ctx);
	typedef CUresult (CUDAAPI *PFN_cuGraphMemcpyNodeGetParams)(CUgraphNode hNode, CUDA_MEMCPY3D *nodeParams);
	typedef CUresult (CUDAAPI *PFN_cuGraphMemcpyNodeSetParams)(CUgraphNode hNode, const CUDA_MEMCPY3D *nodeParams);
	typedef CUresult (CUDAAPI *PFN_cuGraphAddMemsetNode)(CUgraphNode *phGraphNode, CUgraph hGraph, CUgraphNode *dependencies, size_t numDependencies, const CUDA_MEMSET_NODE_PARAMS *memsetParams, CUcontext ctx);
	typedef CUresult (CUDAAPI *PFN_cuGraphMemsetNodeGetParams)(CUgraphNode hNode, CUDA_MEMSET_NODE_PARAMS *nodeParams);
	typedef CUresult (CUDAAPI *PFN_cuGraphMemsetNodeSetParams)(CUgraphNode hNode, const CUDA_MEMSET_NODE_PARAMS *nodeParams);
	typedef CUresult (CUDAAPI *PFN_cuGraphAddHostNode)(CUgraphNode *phGraphNode, CUgraph hGraph, CUgraphNode *dependencies, size_t numDependencies, const CUDA_HOST_NODE_PARAMS *nodeParams);
	typedef CUresult (CUDAAPI *PFN_cuGraphHostNodeGetParams)(CUgraphNode hNode, CUDA_HOST_NODE_PARAMS *nodeParams);
	typedef CUresult (CUDAAPI *PFN_cuGraphHostNodeSetParams)(CUgraphNode hNode, const CUDA_HOST_NODE_PARAMS *nodeParams);
	typedef CUresult (CUDAAPI *PFN_cuGraphAddChildGraphNode)(CUgraphNode *phGraphNode, CUgraph hGraph, CUgraphNode *dependencies, size_t numDependencies, CUgraph childGraph);
	typedef CUresult (CUDAAPI *PFN_cuGraphChildGraphNodeGetGraph)(CUgraphNode hNode, CUgraph *phGraph);
	typedef CUresult (CUDAAPI *PFN_cuGraphAddEmptyNode)(CUgraphNode *phGraphNode, CUgraph hGraph, CUgraphNode *dependencies, size_t numDependencies);
	typedef CUresult (CUDAAPI *PFN_cuGraphClone)(CUgraph *phGraphClone, CUgraph originalGraph);
	typedef CUresult (CUDAAPI *PFN_cuGraphNodeFindInClone)(CUgraphNode *phNode, CUgraphNode hOriginalNode, CUgraph hClonedGraph);
	typedef CUresult (CUDAAPI *PFN_cuGraphNodeGetType)(CUgraphNode hNode, CUgraphNodeType *type);
	typedef CUresult (CUDAAPI *PFN_cuGraphGetNodes)(CUgraph hGraph, CUgraphNode *nodes, size_t *numNodes);
	typedef CUresult (CUDAAPI *PFN_cuGraphGetRootNodes)(CUgraph hGraph, CUgraphNode *rootNodes, size_t *numRootNodes);
	typedef CUresult (CUDAAPI *PFN_cuGraphGetEdges)(CUgraph hGraph, CUgraphNode *from, CUgraphNode *to, size_t *numEdges);
	typedef CUresult (CUDAAPI *PFN_cuGraphNodeGetDependencies)(CUgraphNode hNode, CUgraphNode *dependencies, size_t *numDependencies);
	typedef CUresult (CUDAAPI *PFN_cuGraphNodeGetDependentNodes)(CUgraphNode hNode, CUgraphNode *dependentNodes, size_t *numDependentNodes);
	typedef CUresult (CUDAAPI *PFN_cuGraphAddDependencies)(CUgraph hGraph, CUgraphNode *from, CUgraphNode *to, size_t numDependencies);
	typedef CUresult (CUDAAPI *PFN_cuGraphRemoveDependencies)(CUgraph hGraph, CUgraphNode *from, CUgraphNode *to, size_t numDependencies);
	typedef CUresult (CUDAAPI *PFN_cuGraphDestroyNode)(CUgraphNode hNode);
	typedef CUresult (CUDAAPI *PFN_cuGraphInstantiate)(CUgraphExec *phGraphExec, CUgraph hGraph, CUgraphNode *phErrorNode, char *logBuffer, size_t bufferSize);
	typedef CUresult (CUDAAPI *PFN_cuGraphLaunch)(CUgraphExec hGraphExec, CUstream hStream);
	typedef CUresult (CUDAAPI *PFN_cuGraphExecDestroy)(CUgraphExec hGraphExec);
	typedef CUresult (CUDAAPI *PFN_cuGraphDestroy)(CUgraph hGraph);
	typedef CUresult (CUDAAPI *PFN_cuOccupancyMaxActiveBlocksPerMultiprocessor)(int32_t *numBlocks, CUfunction func, int32_t blockSize, size_t dynamicSMemSize);
	typedef CUresult (CUDAAPI *PFN_cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags)(int32_t *numBlocks, CUfunction func, int32_t blockSize, size_t dynamicSMemSize, uint32_t flags);
	typedef CUresult (CUDAAPI *PFN_cuOccupancyMaxPotentialBlockSize)(int32_t *minGridSize, int32_t *blockSize, CUfunction func, CUoccupancyB2DSize blockSizeToDynamicSMemSize, size_t dynamicSMemSize, int32_t blockSizeLimit);
	typedef CUresult (CUDAAPI *PFN_cuOccupancyMaxPotentialBlockSizeWithFlags)(int32_t *minGridSize, int32_t *blockSize, CUfunction func, CUoccupancyB2DSize blockSizeToDynamicSMemSize, size_t dynamicSMemSize, int32_t blockSizeLimit, uint32_t flags);
	typedef CUresult (CUDAAPI *PFN_cuTexRefSetArray)(CUtexref hTexRef, CUarray hArray, uint32_t Flags);
	typedef CUresult (CUDAAPI *PFN_cuTexRefSetMipmappedArray)(CUtexref hTexRef, CUmipmappedArray hMipmappedArray, uint32_t Flags);
	typedef CUresult (CUDAAPI *PFN_cuTexRefSetAddress)(size_t *ByteOffset, CUtexref hTexRef, CUdeviceptr dptr, size_t bytes);
	typedef CUresult (CUDAAPI *PFN_cuTexRefSetAddress2D)(CUtexref hTexRef, const CUDA_ARRAY_DESCRIPTOR *desc, CUdeviceptr dptr, size_t Pitch);
	typedef CUresult (CUDAAPI *PFN_cuTexRefSetFormat)(CUtexref hTexRef, CUarray_format fmt, int32_t NumPackedComponents);
	typedef CUresult (CUDAAPI *PFN_cuTexRefSetAddressMode)(CUtexref hTexRef, int32_t dim, CUaddress_mode am);
	typedef CUresult (CUDAAPI *PFN_cuTexRefSetFilterMode)(CUtexref hTexRef, CUfilter_mode fm);
	typedef CUresult (CUDAAPI *PFN_cuTexRefSetMipmapFilterMode)(CUtexref hTexRef, CUfilter_mode fm);
	typedef CUresult (CUDAAPI *PFN_cuTexRefSetMipmapLevelBias)(CUtexref hTexRef, float32_t bias);
	typedef CUresult (CUDAAPI *PFN_cuTexRefSetMipmapLevelClamp)(CUtexref hTexRef, float32_t minMipmapLevelClamp, float32_t maxMipmapLevelClamp);
	typedef CUresult (CUDAAPI *PFN_cuTexRefSetMaxAnisotropy)(CUtexref hTexRef, uint32_t maxAniso);
	typedef CUresult (CUDAAPI *PFN_cuTexRefSetBorderColor)(CUtexref hTexRef, float32_t *pBorderColor);
	typedef CUresult (CUDAAPI *PFN_cuTexRefSetFlags)(CUtexref hTexRef, uint32_t Flags);
	typedef CUresult (CUDAAPI *PFN_cuTexRefGetAddress)(CUdeviceptr *pdptr, CUtexref hTexRef);
	typedef CUresult (CUDAAPI *PFN_cuTexRefGetArray)(CUarray *phArray, CUtexref hTexRef);
	typedef CUresult (CUDAAPI *PFN_cuTexRefGetMipmappedArray)(CUmipmappedArray *phMipmappedArray, CUtexref hTexRef);
	typedef CUresult (CUDAAPI *PFN_cuTexRefGetAddressMode)(CUaddress_mode *pam, CUtexref hTexRef, int32_t dim);
	typedef CUresult (CUDAAPI *PFN_cuTexRefGetFilterMode)(CUfilter_mode *pfm, CUtexref hTexRef);
	typedef CUresult (CUDAAPI *PFN_cuTexRefGetFormat)(CUarray_format *pFormat, int32_t *pNumChannels, CUtexref hTexRef);
	typedef CUresult (CUDAAPI *PFN_cuTexRefGetMipmapFilterMode)(CUfilter_mode *pfm, CUtexref hTexRef);
	typedef CUresult (CUDAAPI *PFN_cuTexRefGetMipmapLevelBias)(float32_t *pbias, CUtexref hTexRef);
	typedef CUresult (CUDAAPI *PFN_cuTexRefGetMipmapLevelClamp)(float32_t *pminMipmapLevelClamp, float32_t *pmaxMipmapLevelClamp, CUtexref hTexRef);
	typedef CUresult (CUDAAPI *PFN_cuTexRefGetMaxAnisotropy)(int32_t *pmaxAniso, CUtexref hTexRef);
	typedef CUresult (CUDAAPI *PFN_cuTexRefGetBorderColor)(float32_t *pBorderColor, CUtexref hTexRef);
	typedef CUresult (CUDAAPI *PFN_cuTexRefGetFlags)(uint32_t *pFlags, CUtexref hTexRef);
	typedef CUresult (CUDAAPI *PFN_cuSurfRefSetArray)(CUsurfref hSurfRef, CUarray hArray, uint32_t Flags);
	typedef CUresult (CUDAAPI *PFN_cuSurfRefGetArray)(CUarray *phArray, CUsurfref hSurfRef);
	typedef CUresult (CUDAAPI *PFN_cuTexObjectCreate)(CUtexObject *pTexObject, const CUDA_RESOURCE_DESC *pResDesc, const CUDA_TEXTURE_DESC *pTexDesc, const CUDA_RESOURCE_VIEW_DESC *pResViewDesc);
	typedef CUresult (CUDAAPI *PFN_cuTexObjectDestroy)(CUtexObject texObject);
	typedef CUresult (CUDAAPI *PFN_cuTexObjectGetResourceDesc)(CUDA_RESOURCE_DESC *pResDesc, CUtexObject texObject);
	typedef CUresult (CUDAAPI *PFN_cuTexObjectGetTextureDesc)(CUDA_TEXTURE_DESC *pTexDesc, CUtexObject texObject);
	typedef CUresult (CUDAAPI *PFN_cuTexObjectGetResourceViewDesc)(CUDA_RESOURCE_VIEW_DESC *pResViewDesc, CUtexObject texObject);
	typedef CUresult (CUDAAPI *PFN_cuSurfObjectCreate)(CUsurfObject *pSurfObject, const CUDA_RESOURCE_DESC *pResDesc);
	typedef CUresult (CUDAAPI *PFN_cuSurfObjectDestroy)(CUsurfObject surfObject);
	typedef CUresult (CUDAAPI *PFN_cuSurfObjectGetResourceDesc)(CUDA_RESOURCE_DESC *pResDesc, CUsurfObject surfObject);
	typedef CUresult (CUDAAPI *PFN_cuDeviceCanAccessPeer)(int32_t *canAccessPeer, CUdevice dev, CUdevice peerDev);
	typedef CUresult (CUDAAPI *PFN_cuCtxEnablePeerAccess)(CUcontext peerContext, uint32_t Flags);
	typedef CUresult (CUDAAPI *PFN_cuCtxDisablePeerAccess)(CUcontext peerContext);
	typedef CUresult (CUDAAPI *PFN_cuDeviceGetP2PAttribute)(int* value, CUdevice_P2PAttribute attrib, CUdevice srcDevice, CUdevice dstDevice);
	typedef CUresult (CUDAAPI *PFN_cuGraphicsUnregisterResource)(CUgraphicsResource resource);
	typedef CUresult (CUDAAPI *PFN_cuGraphicsSubResourceGetMappedArray)(CUarray *pArray, CUgraphicsResource resource, uint32_t arrayIndex, uint32_t mipLevel);
	typedef CUresult (CUDAAPI *PFN_cuGraphicsResourceGetMappedMipmappedArray)(CUmipmappedArray *pMipmappedArray, CUgraphicsResource resource);
	typedef CUresult (CUDAAPI *PFN_cuGraphicsResourceGetMappedPointer)(CUdeviceptr *pDevPtr, size_t *pSize, CUgraphicsResource resource);
	typedef CUresult (CUDAAPI *PFN_cuGraphicsResourceSetMapFlags)(CUgraphicsResource resource, uint32_t flags);
	typedef CUresult (CUDAAPI *PFN_cuGraphicsMapResources)(uint32_t count, CUgraphicsResource *resources, CUstream hStream);
	typedef CUresult (CUDAAPI *PFN_cuGraphicsUnmapResources)(uint32_t count, CUgraphicsResource *resources, CUstream hStream);
	typedef CUresult (CUDAAPI *PFN_cuGetExportTable)(const void **ppExportTable, const CUuuid *pExportTableId);
	
	/// Cuda functions
	extern PFN_cuGetErrorString cuGetErrorString;
	extern PFN_cuGetErrorName cuGetErrorName;
	extern PFN_cuInit cuInit;
	extern PFN_cuDriverGetVersion cuDriverGetVersion;
	extern PFN_cuDeviceGet cuDeviceGet;
	extern PFN_cuDeviceGetCount cuDeviceGetCount;
	extern PFN_cuDeviceGetName cuDeviceGetName;
	extern PFN_cuDeviceGetUuid cuDeviceGetUuid;
	extern PFN_cuDeviceTotalMem cuDeviceTotalMem;
	extern PFN_cuDeviceGetAttribute cuDeviceGetAttribute;
	extern PFN_cuDevicePrimaryCtxRetain cuDevicePrimaryCtxRetain;
	extern PFN_cuDevicePrimaryCtxRelease cuDevicePrimaryCtxRelease;
	extern PFN_cuDevicePrimaryCtxSetFlags cuDevicePrimaryCtxSetFlags;
	extern PFN_cuDevicePrimaryCtxGetState cuDevicePrimaryCtxGetState;
	extern PFN_cuDevicePrimaryCtxReset cuDevicePrimaryCtxReset;
	extern PFN_cuCtxCreate cuCtxCreate;
	extern PFN_cuCtxDestroy cuCtxDestroy;
	extern PFN_cuCtxPushCurrent cuCtxPushCurrent;
	extern PFN_cuCtxPopCurrent cuCtxPopCurrent;
	extern PFN_cuCtxSetCurrent cuCtxSetCurrent;
	extern PFN_cuCtxGetCurrent cuCtxGetCurrent;
	extern PFN_cuCtxGetDevice cuCtxGetDevice;
	extern PFN_cuCtxGetFlags cuCtxGetFlags;
	extern PFN_cuCtxSynchronize cuCtxSynchronize;
	extern PFN_cuCtxSetLimit cuCtxSetLimit;
	extern PFN_cuCtxGetLimit cuCtxGetLimit;
	extern PFN_cuCtxGetCacheConfig cuCtxGetCacheConfig;
	extern PFN_cuCtxSetCacheConfig cuCtxSetCacheConfig;
	extern PFN_cuCtxGetSharedMemConfig cuCtxGetSharedMemConfig;
	extern PFN_cuCtxSetSharedMemConfig cuCtxSetSharedMemConfig;
	extern PFN_cuCtxGetApiVersion cuCtxGetApiVersion;
	extern PFN_cuCtxGetStreamPriorityRange cuCtxGetStreamPriorityRange;
	extern PFN_cuModuleLoad cuModuleLoad;
	extern PFN_cuModuleLoadData cuModuleLoadData;
	extern PFN_cuModuleLoadDataEx cuModuleLoadDataEx;
	extern PFN_cuModuleLoadFatBinary cuModuleLoadFatBinary;
	extern PFN_cuModuleUnload cuModuleUnload;
	extern PFN_cuModuleGetFunction cuModuleGetFunction;
	extern PFN_cuModuleGetGlobal cuModuleGetGlobal;
	extern PFN_cuModuleGetTexRef cuModuleGetTexRef;
	extern PFN_cuModuleGetSurfRef cuModuleGetSurfRef;
	extern PFN_cuLinkCreate cuLinkCreate;
	extern PFN_cuLinkAddData cuLinkAddData;
	extern PFN_cuLinkAddFile cuLinkAddFile;
	extern PFN_cuLinkComplete cuLinkComplete;
	extern PFN_cuLinkDestroy cuLinkDestroy;
	extern PFN_cuMemGetInfo cuMemGetInfo;
	extern PFN_cuMemAlloc cuMemAlloc;
	extern PFN_cuMemAllocPitch cuMemAllocPitch;
	extern PFN_cuMemFree cuMemFree;
	extern PFN_cuMemGetAddressRange cuMemGetAddressRange;
	extern PFN_cuMemAllocHost cuMemAllocHost;
	extern PFN_cuMemFreeHost cuMemFreeHost;
	extern PFN_cuMemHostAlloc cuMemHostAlloc;
	extern PFN_cuMemHostGetDevicePointer cuMemHostGetDevicePointer;
	extern PFN_cuMemHostGetFlags cuMemHostGetFlags;
	extern PFN_cuMemAllocManaged cuMemAllocManaged;
	extern PFN_cuDeviceGetByPCIBusId cuDeviceGetByPCIBusId;
	extern PFN_cuDeviceGetPCIBusId cuDeviceGetPCIBusId;
	extern PFN_cuIpcGetEventHandle cuIpcGetEventHandle;
	extern PFN_cuIpcOpenEventHandle cuIpcOpenEventHandle;
	extern PFN_cuIpcGetMemHandle cuIpcGetMemHandle;
	extern PFN_cuIpcOpenMemHandle cuIpcOpenMemHandle;
	extern PFN_cuIpcCloseMemHandle cuIpcCloseMemHandle;
	extern PFN_cuMemHostRegister cuMemHostRegister;
	extern PFN_cuMemHostUnregister cuMemHostUnregister;
	extern PFN_cuMemcpy cuMemcpy;
	extern PFN_cuMemcpyPeer cuMemcpyPeer;
	extern PFN_cuMemcpyHtoD cuMemcpyHtoD;
	extern PFN_cuMemcpyDtoH cuMemcpyDtoH;
	extern PFN_cuMemcpyDtoD cuMemcpyDtoD;
	extern PFN_cuMemcpyDtoA cuMemcpyDtoA;
	extern PFN_cuMemcpyAtoD cuMemcpyAtoD;
	extern PFN_cuMemcpyHtoA cuMemcpyHtoA;
	extern PFN_cuMemcpyAtoH cuMemcpyAtoH;
	extern PFN_cuMemcpyAtoA cuMemcpyAtoA;
	extern PFN_cuMemcpy2D cuMemcpy2D;
	extern PFN_cuMemcpy2DUnaligned cuMemcpy2DUnaligned;
	extern PFN_cuMemcpy3D cuMemcpy3D;
	extern PFN_cuMemcpy3DPeer cuMemcpy3DPeer;
	extern PFN_cuMemcpyAsync cuMemcpyAsync;
	extern PFN_cuMemcpyPeerAsync cuMemcpyPeerAsync;
	extern PFN_cuMemcpyHtoDAsync cuMemcpyHtoDAsync;
	extern PFN_cuMemcpyDtoHAsync cuMemcpyDtoHAsync;
	extern PFN_cuMemcpyDtoDAsync cuMemcpyDtoDAsync;
	extern PFN_cuMemcpyHtoAAsync cuMemcpyHtoAAsync;
	extern PFN_cuMemcpyAtoHAsync cuMemcpyAtoHAsync;
	extern PFN_cuMemcpy2DAsync cuMemcpy2DAsync;
	extern PFN_cuMemcpy3DAsync cuMemcpy3DAsync;
	extern PFN_cuMemcpy3DPeerAsync cuMemcpy3DPeerAsync;
	extern PFN_cuMemsetD8 cuMemsetD8;
	extern PFN_cuMemsetD16 cuMemsetD16;
	extern PFN_cuMemsetD32 cuMemsetD32;
	extern PFN_cuMemsetD2D8 cuMemsetD2D8;
	extern PFN_cuMemsetD2D16 cuMemsetD2D16;
	extern PFN_cuMemsetD2D32 cuMemsetD2D32;
	extern PFN_cuMemsetD8Async cuMemsetD8Async;
	extern PFN_cuMemsetD16Async cuMemsetD16Async;
	extern PFN_cuMemsetD32Async cuMemsetD32Async;
	extern PFN_cuMemsetD2D8Async cuMemsetD2D8Async;
	extern PFN_cuMemsetD2D16Async cuMemsetD2D16Async;
	extern PFN_cuMemsetD2D32Async cuMemsetD2D32Async;
	extern PFN_cuArrayCreate cuArrayCreate;
	extern PFN_cuArrayGetDescriptor cuArrayGetDescriptor;
	extern PFN_cuArrayDestroy cuArrayDestroy;
	extern PFN_cuArray3DCreate cuArray3DCreate;
	extern PFN_cuArray3DGetDescriptor cuArray3DGetDescriptor;
	extern PFN_cuMipmappedArrayCreate cuMipmappedArrayCreate;
	extern PFN_cuMipmappedArrayGetLevel cuMipmappedArrayGetLevel;
	extern PFN_cuMipmappedArrayDestroy cuMipmappedArrayDestroy;
	extern PFN_cuPointerGetAttribute cuPointerGetAttribute;
	extern PFN_cuMemPrefetchAsync cuMemPrefetchAsync;
	extern PFN_cuMemAdvise cuMemAdvise;
	extern PFN_cuMemRangeGetAttribute cuMemRangeGetAttribute;
	extern PFN_cuMemRangeGetAttributes cuMemRangeGetAttributes;
	extern PFN_cuPointerSetAttribute cuPointerSetAttribute;
	extern PFN_cuPointerGetAttributes cuPointerGetAttributes;
	extern PFN_cuStreamCreate cuStreamCreate;
	extern PFN_cuStreamCreateWithPriority cuStreamCreateWithPriority;
	extern PFN_cuStreamGetPriority cuStreamGetPriority;
	extern PFN_cuStreamGetFlags cuStreamGetFlags;
	extern PFN_cuStreamGetCtx cuStreamGetCtx;
	extern PFN_cuStreamWaitEvent cuStreamWaitEvent;
	extern PFN_cuStreamAddCallback cuStreamAddCallback;
	extern PFN_cuStreamBeginCapture cuStreamBeginCapture;
	extern PFN_cuStreamEndCapture cuStreamEndCapture;
	extern PFN_cuStreamIsCapturing cuStreamIsCapturing;
	extern PFN_cuStreamAttachMemAsync cuStreamAttachMemAsync;
	extern PFN_cuStreamQuery cuStreamQuery;
	extern PFN_cuStreamSynchronize cuStreamSynchronize;
	extern PFN_cuStreamDestroy cuStreamDestroy;
	extern PFN_cuEventCreate cuEventCreate;
	extern PFN_cuEventRecord cuEventRecord;
	extern PFN_cuEventQuery cuEventQuery;
	extern PFN_cuEventSynchronize cuEventSynchronize;
	extern PFN_cuEventDestroy cuEventDestroy;
	extern PFN_cuEventElapsedTime cuEventElapsedTime;
	extern PFN_cuImportExternalMemory cuImportExternalMemory;
	extern PFN_cuExternalMemoryGetMappedBuffer cuExternalMemoryGetMappedBuffer;
	extern PFN_cuExternalMemoryGetMappedMipmappedArray cuExternalMemoryGetMappedMipmappedArray;
	extern PFN_cuDestroyExternalMemory cuDestroyExternalMemory;
	extern PFN_cuImportExternalSemaphore cuImportExternalSemaphore;
	extern PFN_cuSignalExternalSemaphoresAsync cuSignalExternalSemaphoresAsync;
	extern PFN_cuWaitExternalSemaphoresAsync cuWaitExternalSemaphoresAsync;
	extern PFN_cuDestroyExternalSemaphore cuDestroyExternalSemaphore;
	extern PFN_cuStreamWaitValue32 cuStreamWaitValue32;
	extern PFN_cuStreamWaitValue64 cuStreamWaitValue64;
	extern PFN_cuStreamWriteValue32 cuStreamWriteValue32;
	extern PFN_cuStreamWriteValue64 cuStreamWriteValue64;
	extern PFN_cuStreamBatchMemOp cuStreamBatchMemOp;
	extern PFN_cuFuncGetAttribute cuFuncGetAttribute;
	extern PFN_cuFuncSetAttribute cuFuncSetAttribute;
	extern PFN_cuFuncSetCacheConfig cuFuncSetCacheConfig;
	extern PFN_cuFuncSetSharedMemConfig cuFuncSetSharedMemConfig;
	extern PFN_cuLaunchKernel cuLaunchKernel;
	extern PFN_cuLaunchCooperativeKernel cuLaunchCooperativeKernel;
	extern PFN_cuLaunchCooperativeKernelMultiDevice cuLaunchCooperativeKernelMultiDevice;
	extern PFN_cuLaunchHostFunc cuLaunchHostFunc;
	extern PFN_cuGraphCreate cuGraphCreate;
	extern PFN_cuGraphAddKernelNode cuGraphAddKernelNode;
	extern PFN_cuGraphKernelNodeGetParams cuGraphKernelNodeGetParams;
	extern PFN_cuGraphKernelNodeSetParams cuGraphKernelNodeSetParams;
	extern PFN_cuGraphAddMemcpyNode cuGraphAddMemcpyNode;
	extern PFN_cuGraphMemcpyNodeGetParams cuGraphMemcpyNodeGetParams;
	extern PFN_cuGraphMemcpyNodeSetParams cuGraphMemcpyNodeSetParams;
	extern PFN_cuGraphAddMemsetNode cuGraphAddMemsetNode;
	extern PFN_cuGraphMemsetNodeGetParams cuGraphMemsetNodeGetParams;
	extern PFN_cuGraphMemsetNodeSetParams cuGraphMemsetNodeSetParams;
	extern PFN_cuGraphAddHostNode cuGraphAddHostNode;
	extern PFN_cuGraphHostNodeGetParams cuGraphHostNodeGetParams;
	extern PFN_cuGraphHostNodeSetParams cuGraphHostNodeSetParams;
	extern PFN_cuGraphAddChildGraphNode cuGraphAddChildGraphNode;
	extern PFN_cuGraphChildGraphNodeGetGraph cuGraphChildGraphNodeGetGraph;
	extern PFN_cuGraphAddEmptyNode cuGraphAddEmptyNode;
	extern PFN_cuGraphClone cuGraphClone;
	extern PFN_cuGraphNodeFindInClone cuGraphNodeFindInClone;
	extern PFN_cuGraphNodeGetType cuGraphNodeGetType;
	extern PFN_cuGraphGetNodes cuGraphGetNodes;
	extern PFN_cuGraphGetRootNodes cuGraphGetRootNodes;
	extern PFN_cuGraphGetEdges cuGraphGetEdges;
	extern PFN_cuGraphNodeGetDependencies cuGraphNodeGetDependencies;
	extern PFN_cuGraphNodeGetDependentNodes cuGraphNodeGetDependentNodes;
	extern PFN_cuGraphAddDependencies cuGraphAddDependencies;
	extern PFN_cuGraphRemoveDependencies cuGraphRemoveDependencies;
	extern PFN_cuGraphDestroyNode cuGraphDestroyNode;
	extern PFN_cuGraphInstantiate cuGraphInstantiate;
	extern PFN_cuGraphLaunch cuGraphLaunch;
	extern PFN_cuGraphExecDestroy cuGraphExecDestroy;
	extern PFN_cuGraphDestroy cuGraphDestroy;
	extern PFN_cuOccupancyMaxActiveBlocksPerMultiprocessor cuOccupancyMaxActiveBlocksPerMultiprocessor;
	extern PFN_cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags;
	extern PFN_cuOccupancyMaxPotentialBlockSize cuOccupancyMaxPotentialBlockSize;
	extern PFN_cuOccupancyMaxPotentialBlockSizeWithFlags cuOccupancyMaxPotentialBlockSizeWithFlags;
	extern PFN_cuTexRefSetArray cuTexRefSetArray;
	extern PFN_cuTexRefSetMipmappedArray cuTexRefSetMipmappedArray;
	extern PFN_cuTexRefSetAddress cuTexRefSetAddress;
	extern PFN_cuTexRefSetAddress2D cuTexRefSetAddress2D;
	extern PFN_cuTexRefSetFormat cuTexRefSetFormat;
	extern PFN_cuTexRefSetAddressMode cuTexRefSetAddressMode;
	extern PFN_cuTexRefSetFilterMode cuTexRefSetFilterMode;
	extern PFN_cuTexRefSetMipmapFilterMode cuTexRefSetMipmapFilterMode;
	extern PFN_cuTexRefSetMipmapLevelBias cuTexRefSetMipmapLevelBias;
	extern PFN_cuTexRefSetMipmapLevelClamp cuTexRefSetMipmapLevelClamp;
	extern PFN_cuTexRefSetMaxAnisotropy cuTexRefSetMaxAnisotropy;
	extern PFN_cuTexRefSetBorderColor cuTexRefSetBorderColor;
	extern PFN_cuTexRefSetFlags cuTexRefSetFlags;
	extern PFN_cuTexRefGetAddress cuTexRefGetAddress;
	extern PFN_cuTexRefGetArray cuTexRefGetArray;
	extern PFN_cuTexRefGetMipmappedArray cuTexRefGetMipmappedArray;
	extern PFN_cuTexRefGetAddressMode cuTexRefGetAddressMode;
	extern PFN_cuTexRefGetFilterMode cuTexRefGetFilterMode;
	extern PFN_cuTexRefGetFormat cuTexRefGetFormat;
	extern PFN_cuTexRefGetMipmapFilterMode cuTexRefGetMipmapFilterMode;
	extern PFN_cuTexRefGetMipmapLevelBias cuTexRefGetMipmapLevelBias;
	extern PFN_cuTexRefGetMipmapLevelClamp cuTexRefGetMipmapLevelClamp;
	extern PFN_cuTexRefGetMaxAnisotropy cuTexRefGetMaxAnisotropy;
	extern PFN_cuTexRefGetBorderColor cuTexRefGetBorderColor;
	extern PFN_cuTexRefGetFlags cuTexRefGetFlags;
	extern PFN_cuSurfRefSetArray cuSurfRefSetArray;
	extern PFN_cuSurfRefGetArray cuSurfRefGetArray;
	extern PFN_cuTexObjectCreate cuTexObjectCreate;
	extern PFN_cuTexObjectDestroy cuTexObjectDestroy;
	extern PFN_cuTexObjectGetResourceDesc cuTexObjectGetResourceDesc;
	extern PFN_cuTexObjectGetTextureDesc cuTexObjectGetTextureDesc;
	extern PFN_cuTexObjectGetResourceViewDesc cuTexObjectGetResourceViewDesc;
	extern PFN_cuSurfObjectCreate cuSurfObjectCreate;
	extern PFN_cuSurfObjectDestroy cuSurfObjectDestroy;
	extern PFN_cuSurfObjectGetResourceDesc cuSurfObjectGetResourceDesc;
	extern PFN_cuDeviceCanAccessPeer cuDeviceCanAccessPeer;
	extern PFN_cuCtxEnablePeerAccess cuCtxEnablePeerAccess;
	extern PFN_cuCtxDisablePeerAccess cuCtxDisablePeerAccess;
	extern PFN_cuDeviceGetP2PAttribute cuDeviceGetP2PAttribute;
	extern PFN_cuGraphicsUnregisterResource cuGraphicsUnregisterResource;
	extern PFN_cuGraphicsSubResourceGetMappedArray cuGraphicsSubResourceGetMappedArray;
	extern PFN_cuGraphicsResourceGetMappedMipmappedArray cuGraphicsResourceGetMappedMipmappedArray;
	extern PFN_cuGraphicsResourceGetMappedPointer cuGraphicsResourceGetMappedPointer;
	extern PFN_cuGraphicsResourceSetMapFlags cuGraphicsResourceSetMapFlags;
	extern PFN_cuGraphicsMapResources cuGraphicsMapResources;
	extern PFN_cuGraphicsUnmapResources cuGraphicsUnmapResources;
	extern PFN_cuGetExportTable cuGetExportTable;
}

#endif /* __TELLUSIM_PLUGINS_PLATFORM_CU_H__ */
