2 * This copyright notice applies to this header file only:
6 * Permission is hereby granted, free of charge, to any person
7 * obtaining a copy of this software and associated documentation
8 * files (the "Software"), to deal in the Software without
9 * restriction, including without limitation the rights to use,
10 * copy, modify, merge, publish, distribute, sublicense, and/or sell
11 * copies of the software, and to permit persons to whom the
12 * software is furnished to do so, subject to the following
15 * The above copyright notice and this permission notice shall be
16 * included in all copies or substantial portions of the Software.
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
20 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
22 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
23 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
24 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25 * OTHER DEALINGS IN THE SOFTWARE.
28 #if !defined(AV_COMPAT_DYNLINK_CUDA_H) && !defined(CUDA_VERSION)
29 #define AV_COMPAT_DYNLINK_CUDA_H
33 #define CUDA_VERSION 7050
35 #if defined(_WIN32) || defined(__CYGWIN__)
36 #define CUDAAPI __stdcall
41 #define CU_CTX_SCHED_BLOCKING_SYNC 4
44 typedef void* CUarray;
45 typedef void* CUcontext;
46 typedef void* CUstream;
47 #if defined(__x86_64) || defined(AMD64) || defined(_M_AMD64)
48 typedef unsigned long long CUdeviceptr;
50 typedef unsigned int CUdeviceptr;
53 typedef enum cudaError_enum {
57 typedef enum CUmemorytype_enum {
58 CU_MEMORYTYPE_HOST = 1,
59 CU_MEMORYTYPE_DEVICE = 2
62 typedef struct CUDA_MEMCPY2D_st {
65 CUmemorytype srcMemoryType;
67 CUdeviceptr srcDevice;
73 CUmemorytype dstMemoryType;
75 CUdeviceptr dstDevice;
83 typedef CUresult CUDAAPI tcuInit(unsigned int Flags);
84 typedef CUresult CUDAAPI tcuDeviceGetCount(int *count);
85 typedef CUresult CUDAAPI tcuDeviceGet(CUdevice *device, int ordinal);
86 typedef CUresult CUDAAPI tcuDeviceGetName(char *name, int len, CUdevice dev);
87 typedef CUresult CUDAAPI tcuDeviceComputeCapability(int *major, int *minor, CUdevice dev);
88 typedef CUresult CUDAAPI tcuCtxCreate_v2(CUcontext *pctx, unsigned int flags, CUdevice dev);
89 typedef CUresult CUDAAPI tcuCtxPushCurrent_v2(CUcontext *pctx);
90 typedef CUresult CUDAAPI tcuCtxPopCurrent_v2(CUcontext *pctx);
91 typedef CUresult CUDAAPI tcuCtxDestroy_v2(CUcontext ctx);
92 typedef CUresult CUDAAPI tcuMemAlloc_v2(CUdeviceptr *dptr, size_t bytesize);
93 typedef CUresult CUDAAPI tcuMemFree_v2(CUdeviceptr dptr);
94 typedef CUresult CUDAAPI tcuMemcpy2D_v2(const CUDA_MEMCPY2D *pcopy);
95 typedef CUresult CUDAAPI tcuGetErrorName(CUresult error, const char** pstr);
96 typedef CUresult CUDAAPI tcuGetErrorString(CUresult error, const char** pstr);