From 21e466b6fbc69ce5b14d26af3bf738a5a5433cc7 Mon Sep 17 00:00:00 2001 From: Timo Rothenpieler Date: Sun, 28 Jan 2018 14:43:39 +0100 Subject: [PATCH] Add cuCtxSetLimit CUDA function --- ffnvcodec.pc.in | 2 +- include/ffnvcodec/dynlink_cuda.h | 9 +++++++++ include/ffnvcodec/dynlink_loader.h | 2 ++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ffnvcodec.pc.in b/ffnvcodec.pc.in index b751663..c885d56 100644 --- a/ffnvcodec.pc.in +++ b/ffnvcodec.pc.in @@ -3,5 +3,5 @@ includedir=${prefix}/include Name: ffnvcodec Description: FFmpeg version of Nvidia Codec SDK headers -Version: 8.0.14 +Version: 8.0.14.1 Cflags: -I${includedir} diff --git a/include/ffnvcodec/dynlink_cuda.h b/include/ffnvcodec/dynlink_cuda.h index 32a588d..fb2c4b5 100644 --- a/include/ffnvcodec/dynlink_cuda.h +++ b/include/ffnvcodec/dynlink_cuda.h @@ -59,6 +59,14 @@ typedef enum CUmemorytype_enum { CU_MEMORYTYPE_DEVICE = 2 } CUmemorytype; +typedef enum CUlimit_enum { + CU_LIMIT_STACK_SIZE = 0, + CU_LIMIT_PRINTF_FIFO_SIZE = 1, + CU_LIMIT_MALLOC_HEAP_SIZE = 2, + CU_LIMIT_DEV_RUNTIME_SYNC_DEPTH = 3, + CU_LIMIT_DEV_RUNTIME_PENDING_LAUNCH_COUNT = 4 +} CUlimit; + typedef struct CUDA_MEMCPY2D_st { size_t srcXInBytes; size_t srcY; @@ -86,6 +94,7 @@ typedef CUresult CUDAAPI tcuDeviceGet(CUdevice *device, int ordinal); typedef CUresult CUDAAPI tcuDeviceGetName(char *name, int len, CUdevice dev); typedef CUresult CUDAAPI tcuDeviceComputeCapability(int *major, int *minor, CUdevice dev); typedef CUresult CUDAAPI tcuCtxCreate_v2(CUcontext *pctx, unsigned int flags, CUdevice dev); +typedef CUresult CUDAAPI tcuCtxSetLimit(CUlimit limit, size_t value); typedef CUresult CUDAAPI tcuCtxPushCurrent_v2(CUcontext *pctx); typedef CUresult CUDAAPI tcuCtxPopCurrent_v2(CUcontext *pctx); typedef CUresult CUDAAPI tcuCtxDestroy_v2(CUcontext ctx); diff --git a/include/ffnvcodec/dynlink_loader.h b/include/ffnvcodec/dynlink_loader.h index b291f81..d597413 100644 --- a/include/ffnvcodec/dynlink_loader.h +++ b/include/ffnvcodec/dynlink_loader.h @@ -142,6 +142,7 @@ typedef struct CudaFunctions { tcuDeviceGetName *cuDeviceGetName; tcuDeviceComputeCapability *cuDeviceComputeCapability; tcuCtxCreate_v2 *cuCtxCreate; + tcuCtxSetLimit *cuCtxSetLimit; tcuCtxPushCurrent_v2 *cuCtxPushCurrent; tcuCtxPopCurrent_v2 *cuCtxPopCurrent; tcuCtxDestroy_v2 *cuCtxDestroy; @@ -221,6 +222,7 @@ static inline int cuda_load_functions(CudaFunctions **functions, void *logctx) LOAD_SYMBOL(cuDeviceGetName, tcuDeviceGetName, "cuDeviceGetName"); LOAD_SYMBOL(cuDeviceComputeCapability, tcuDeviceComputeCapability, "cuDeviceComputeCapability"); LOAD_SYMBOL(cuCtxCreate, tcuCtxCreate_v2, "cuCtxCreate_v2"); + LOAD_SYMBOL(cuCtxSetLimit, tcuCtxSetLimit, "cuCtxSetLimit"); LOAD_SYMBOL(cuCtxPushCurrent, tcuCtxPushCurrent_v2, "cuCtxPushCurrent_v2"); LOAD_SYMBOL(cuCtxPopCurrent, tcuCtxPopCurrent_v2, "cuCtxPopCurrent_v2"); LOAD_SYMBOL(cuCtxDestroy, tcuCtxDestroy_v2, "cuCtxDestroy_v2");