gstreamer/subprojects/gst-plugins-bad/gst-libs/gst/cuda/cuda-gst.h
Seungha Yang 75e8f80999 cuda: Hide runtime compiler related header and symbols
That's already abstracted via gst_cuda_nvrtc_compile() method
and therefore, we do not need to expose such symbols yet.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2884>
2022-08-18 05:20:08 +09:00

204 lines
7.1 KiB
C

#pragma once
#include "cuda-prelude.h"
#include <cuda.h>
#include <cudaGL.h>
G_BEGIN_DECLS
/* cuda.h */
GST_CUDA_API
CUresult CUDAAPI CuInit (unsigned int Flags);
GST_CUDA_API
CUresult CUDAAPI CuGetErrorName (CUresult error,
const char **pStr);
GST_CUDA_API
CUresult CUDAAPI CuGetErrorString (CUresult error,
const char **pStr);
GST_CUDA_API
CUresult CUDAAPI CuCtxCreate (CUcontext * pctx,
unsigned int flags,
CUdevice dev);
GST_CUDA_API
CUresult CUDAAPI CuCtxDestroy (CUcontext ctx);
GST_CUDA_API
CUresult CUDAAPI CuCtxPopCurrent (CUcontext * pctx);
GST_CUDA_API
CUresult CUDAAPI CuCtxPushCurrent (CUcontext ctx);
GST_CUDA_API
CUresult CUDAAPI CuCtxEnablePeerAccess (CUcontext peerContext,
unsigned int Flags);
GST_CUDA_API
CUresult CUDAAPI CuCtxDisablePeerAccess (CUcontext peerContext);
GST_CUDA_API
CUresult CUDAAPI CuGraphicsMapResources (unsigned int count,
CUgraphicsResource * resources,
CUstream hStream);
GST_CUDA_API
CUresult CUDAAPI CuGraphicsUnmapResources (unsigned int count,
CUgraphicsResource * resources,
CUstream hStream);
GST_CUDA_API
CUresult CUDAAPI CuGraphicsSubResourceGetMappedArray (CUarray * pArray,
CUgraphicsResource resource,
unsigned int arrayIndex,
unsigned int mipLevel);
GST_CUDA_API
CUresult CUDAAPI CuGraphicsResourceGetMappedPointer (CUdeviceptr * pDevPtr,
size_t * pSize,
CUgraphicsResource resource);
GST_CUDA_API
CUresult CUDAAPI CuGraphicsUnregisterResource (CUgraphicsResource resource);
GST_CUDA_API
CUresult CUDAAPI CuMemAlloc (CUdeviceptr * dptr,
unsigned int bytesize);
GST_CUDA_API
CUresult CUDAAPI CuMemAllocPitch (CUdeviceptr * dptr,
size_t * pPitch,
size_t WidthInBytes,
size_t Height,
unsigned int ElementSizeBytes);
GST_CUDA_API
CUresult CUDAAPI CuMemAllocHost (void **pp,
unsigned int bytesize);
GST_CUDA_API
CUresult CUDAAPI CuMemcpy2D (const CUDA_MEMCPY2D * pCopy);
GST_CUDA_API
CUresult CUDAAPI CuMemcpy2DAsync (const CUDA_MEMCPY2D *pCopy, CUstream hStream);
GST_CUDA_API
CUresult CUDAAPI CuMemFree (CUdeviceptr dptr);
GST_CUDA_API
CUresult CUDAAPI CuMemFreeHost (void *p);
GST_CUDA_API
CUresult CUDAAPI CuStreamCreate (CUstream *phStream,
unsigned int Flags);
GST_CUDA_API
CUresult CUDAAPI CuStreamDestroy (CUstream hStream);
GST_CUDA_API
CUresult CUDAAPI CuStreamSynchronize (CUstream hStream);
GST_CUDA_API
CUresult CUDAAPI CuDeviceGet (CUdevice * device,
int ordinal);
GST_CUDA_API
CUresult CUDAAPI CuDeviceGetCount (int *count);
GST_CUDA_API
CUresult CUDAAPI CuDeviceGetName (char *name,
int len,
CUdevice dev);
GST_CUDA_API
CUresult CUDAAPI CuDeviceGetAttribute (int *pi,
CUdevice_attribute attrib,
CUdevice dev);
GST_CUDA_API
CUresult CUDAAPI CuDeviceCanAccessPeer (int *canAccessPeer,
CUdevice dev,
CUdevice peerDev);
GST_CUDA_API
CUresult CUDAAPI CuDriverGetVersion (int * driverVersion);
GST_CUDA_API
CUresult CUDAAPI CuModuleLoadData (CUmodule* module,
const void *image);
GST_CUDA_API
CUresult CUDAAPI CuModuleUnload (CUmodule module);
GST_CUDA_API
CUresult CUDAAPI CuModuleGetFunction (CUfunction* hfunc,
CUmodule hmod,
const char* name);
GST_CUDA_API
CUresult CUDAAPI CuTexObjectCreate (CUtexObject *pTexObject,
const CUDA_RESOURCE_DESC *pResDesc,
const CUDA_TEXTURE_DESC *pTexDesc,
const CUDA_RESOURCE_VIEW_DESC *pResViewDesc);
GST_CUDA_API
CUresult CUDAAPI CuTexObjectDestroy (CUtexObject texObject);
GST_CUDA_API
CUresult CUDAAPI CuLaunchKernel (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);
/* cudaGL.h */
GST_CUDA_API
CUresult CUDAAPI CuGraphicsGLRegisterImage (CUgraphicsResource * pCudaResource,
unsigned int image,
unsigned int target,
unsigned int Flags);
GST_CUDA_API
CUresult CUDAAPI CuGraphicsGLRegisterBuffer (CUgraphicsResource * pCudaResource,
unsigned int buffer,
unsigned int Flags);
GST_CUDA_API
CUresult CUDAAPI CuGraphicsResourceSetMapFlags (CUgraphicsResource resource,
unsigned int flags);
GST_CUDA_API
CUresult CUDAAPI CuGLGetDevices (unsigned int * pCudaDeviceCount,
CUdevice * pCudaDevices,
unsigned int cudaDeviceCount,
CUGLDeviceList deviceList);
#ifdef GST_CUDA_HAS_D3D
/* cudaD3D11.h */
GST_CUDA_API
CUresult CUDAAPI CuGraphicsD3D11RegisterResource(CUgraphicsResource * pCudaResource,
gpointer pD3DResource,
unsigned int Flags);
GST_CUDA_API
CUresult CUDAAPI CuD3D11GetDevice(CUdevice * device,
gpointer pAdapter);
GST_CUDA_API
CUresult CUDAAPI CuD3D11GetDevices(unsigned int * pCudaDeviceCount,
CUdevice* pCudaDevices,
unsigned int cudaDeviceCount,
gpointer pD3D11Device,
CUD3D11DeviceList deviceList);
#endif
G_END_DECLS