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 typedef void* CUstream;
47 #if defined(__x86_64) || defined(AMD64) || defined(_M_AMD64)
48 typedef unsigned long long CUdeviceptr;
49 #else
50 typedef unsigned int CUdeviceptr;
51 #endif
52 
53 typedef enum cudaError_enum {
55 } CUresult;
56 
57 typedef enum CUmemorytype_enum {
60 } CUmemorytype;
61 
62 typedef struct CUDA_MEMCPY2D_st {
63  size_t srcXInBytes;
64  size_t srcY;
66  const void *srcHost;
69  size_t srcPitch;
70 
71  size_t dstXInBytes;
72  size_t dstY;
74  void *dstHost;
77  size_t dstPitch;
78 
79  size_t WidthInBytes;
80  size_t Height;
82 
83 typedef CUresult CUDAAPI tcuInit(unsigned int Flags);
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);
92 typedef CUresult CUDAAPI tcuMemAlloc_v2(CUdeviceptr *dptr, size_t bytesize);
95 typedef CUresult CUDAAPI tcuGetErrorName(CUresult error, const char** pstr);
96 typedef CUresult CUDAAPI tcuGetErrorString(CUresult error, const char** pstr);
97 
98 #endif
size_t srcXInBytes
Definition: dynlink_cuda.h:63
size_t dstPitch
Definition: dynlink_cuda.h:77
CUdeviceptr srcDevice
Definition: dynlink_cuda.h:67
size_t dstXInBytes
Definition: dynlink_cuda.h:71
static int flags
Definition: log.c:55
size_t WidthInBytes
Definition: dynlink_cuda.h:79
size_t srcPitch
Definition: dynlink_cuda.h:69
GLsizei count
Definition: opengl_enc.c:109
CUmemorytype dstMemoryType
Definition: dynlink_cuda.h:73
CUarray dstArray
Definition: dynlink_cuda.h:76
AVFormatContext * ctx
Definition: movenc.c:48
static void error(const char *err)
CUmemorytype srcMemoryType
Definition: dynlink_cuda.h:65
CUdeviceptr dstDevice
Definition: dynlink_cuda.h:75
const void * srcHost
Definition: dynlink_cuda.h:66
CUarray srcArray
Definition: dynlink_cuda.h:68
int len
const char * name
Definition: opengl_enc.c:103
void * dstHost
Definition: dynlink_cuda.h:74