FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
dynlink_cuda.h
Go to the documentation of this file.
1 /*
2  * This copyright notice applies to this header file only:
3  *
4  * Copyright (c) 2016
5  *
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
13  * conditions:
14  *
15  * The above copyright notice and this permission notice shall be
16  * included in all copies or substantial portions of the Software.
17  *
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.
26  */
27 
28 #if !defined(AV_COMPAT_DYNLINK_CUDA_H) && !defined(CUDA_VERSION)
29 #define AV_COMPAT_DYNLINK_CUDA_H
30 
31 #include <stddef.h>
32 
33 #define CUDA_VERSION 7050
34 
35 #if defined(_WIN32) || defined(__CYGWIN__)
36 #define CUDAAPI __stdcall
37 #else
38 #define CUDAAPI
39 #endif
40 
41 #define CU_CTX_SCHED_BLOCKING_SYNC 4
42 
43 typedef int CUdevice;
44 typedef void* CUarray;
45 typedef void* CUcontext;
46 #if defined(__x86_64) || defined(AMD64) || defined(_M_AMD64)
47 typedef unsigned long long CUdeviceptr;
48 #else
49 typedef unsigned int CUdeviceptr;
50 #endif
51 
52 typedef enum cudaError_enum {
54 } CUresult;
55 
56 typedef enum CUmemorytype_enum {
59 } CUmemorytype;
60 
61 typedef struct CUDA_MEMCPY2D_st {
62  size_t srcXInBytes;
63  size_t srcY;
65  const void *srcHost;
68  size_t srcPitch;
69 
70  size_t dstXInBytes;
71  size_t dstY;
73  void *dstHost;
76  size_t dstPitch;
77 
78  size_t WidthInBytes;
79  size_t Height;
81 
82 typedef CUresult CUDAAPI tcuInit(unsigned int Flags);
84 typedef CUresult CUDAAPI tcuDeviceGet(CUdevice *device, int ordinal);
85 typedef CUresult CUDAAPI tcuDeviceGetName(char *name, int len, CUdevice dev);
86 typedef CUresult CUDAAPI tcuDeviceComputeCapability(int *major, int *minor, CUdevice dev);
87 typedef CUresult CUDAAPI tcuCtxCreate_v2(CUcontext *pctx, unsigned int flags, CUdevice dev);
91 typedef CUresult CUDAAPI tcuMemAlloc_v2(CUdeviceptr *dptr, size_t bytesize);
94 typedef CUresult CUDAAPI tcuGetErrorName(CUresult error, const char** pstr);
95 typedef CUresult CUDAAPI tcuGetErrorString(CUresult error, const char** pstr);
96 
97 #endif
size_t srcXInBytes
Definition: dynlink_cuda.h:62
size_t dstPitch
Definition: dynlink_cuda.h:76
CUdeviceptr srcDevice
Definition: dynlink_cuda.h:66
size_t dstXInBytes
Definition: dynlink_cuda.h:70
static int flags
Definition: log.c:57
size_t WidthInBytes
Definition: dynlink_cuda.h:78
size_t srcPitch
Definition: dynlink_cuda.h:68
GLsizei count
Definition: opengl_enc.c:109
CUmemorytype dstMemoryType
Definition: dynlink_cuda.h:72
CUarray dstArray
Definition: dynlink_cuda.h:75
AVFormatContext * ctx
Definition: movenc.c:48
static void error(const char *err)
CUmemorytype srcMemoryType
Definition: dynlink_cuda.h:64
CUdeviceptr dstDevice
Definition: dynlink_cuda.h:74
const void * srcHost
Definition: dynlink_cuda.h:65
CUarray srcArray
Definition: dynlink_cuda.h:67
int len
const char * name
Definition: opengl_enc.c:103
void * dstHost
Definition: dynlink_cuda.h:73