Skip to content

Commit c5e4af7

Browse files
committed
Add cuArrayCreate
It's slightly surprising that we've got this far without it, but I need it to create 2D arrays to use with the Optical Flow FRUC library.
1 parent c12df23 commit c5e4af7

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

include/ffnvcodec/dynlink_cuda.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,14 @@ typedef struct CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st {
359359

360360
typedef CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS;
361361

362+
typedef struct CUDA_ARRAY_DESCRIPTOR_st {
363+
size_t Width;
364+
size_t Height;
365+
366+
CUarray_format Format;
367+
unsigned int NumChannels;
368+
} CUDA_ARRAY_DESCRIPTOR;
369+
362370
typedef struct CUDA_ARRAY3D_DESCRIPTOR_st {
363371
size_t Width;
364372
size_t Height;
@@ -480,6 +488,7 @@ typedef CUresult CUDAAPI tcuDestroyExternalSemaphore(CUexternalSemaphore extSem)
480488
typedef CUresult CUDAAPI tcuSignalExternalSemaphoresAsync(const CUexternalSemaphore* extSemArray, const CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS* paramsArray, unsigned int numExtSems, CUstream stream);
481489
typedef CUresult CUDAAPI tcuWaitExternalSemaphoresAsync(const CUexternalSemaphore* extSemArray, const CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS* paramsArray, unsigned int numExtSems, CUstream stream);
482490

491+
typedef CUresult CUDAAPI tcuArrayCreate(CUarray *pHandle, const CUDA_ARRAY_DESCRIPTOR* pAllocateArray);
483492
typedef CUresult CUDAAPI tcuArray3DCreate(CUarray *pHandle, const CUDA_ARRAY3D_DESCRIPTOR* pAllocateArray);
484493
typedef CUresult CUDAAPI tcuArrayDestroy(CUarray hArray);
485494

include/ffnvcodec/dynlink_loader.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ typedef struct CudaFunctions {
217217
tcuSignalExternalSemaphoresAsync *cuSignalExternalSemaphoresAsync;
218218
tcuWaitExternalSemaphoresAsync *cuWaitExternalSemaphoresAsync;
219219

220+
tcuArrayCreate *cuArrayCreate;
220221
tcuArray3DCreate *cuArray3DCreate;
221222
tcuArrayDestroy *cuArrayDestroy;
222223

@@ -380,6 +381,7 @@ static inline int cuda_load_functions(CudaFunctions **functions, void *logctx)
380381
LOAD_SYMBOL_OPT(cuSignalExternalSemaphoresAsync, tcuSignalExternalSemaphoresAsync, "cuSignalExternalSemaphoresAsync");
381382
LOAD_SYMBOL_OPT(cuWaitExternalSemaphoresAsync, tcuWaitExternalSemaphoresAsync, "cuWaitExternalSemaphoresAsync");
382383

384+
LOAD_SYMBOL(cuArrayCreate, tcuArrayCreate, "cuArrayCreate_v2");
383385
LOAD_SYMBOL(cuArray3DCreate, tcuArray3DCreate, "cuArray3DCreate_v2");
384386
LOAD_SYMBOL(cuArrayDestroy, tcuArrayDestroy, "cuArrayDestroy");
385387

0 commit comments

Comments
 (0)