3 * This library is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU Library General Public
5 * License as published by the Free Software Foundation; either
6 * version 2 of the License, or (at your option) any later version.
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Library General Public License for more details.
13 * You should have received a copy of the GNU Library General Public
14 * License along with this library; if not, write to the
15 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
16 * Boston, MA 02110-1301, USA.
19 #ifndef __GST_CUDA_STUB_H__
20 #define __GST_CUDA_STUB_H__
26 typedef gpointer CUcontext;
27 typedef gpointer CUgraphicsResource;
28 typedef gpointer CUstream;
29 typedef gpointer CUarray;
30 typedef gpointer CUmodule;
31 typedef gpointer CUfunction;
32 typedef gpointer CUmipmappedArray;
34 typedef guint64 CUtexObject;
35 typedef guintptr CUdeviceptr;
36 typedef gint CUdevice;
45 CU_MEMORYTYPE_HOST = 1,
46 CU_MEMORYTYPE_DEVICE = 2,
47 CU_MEMORYTYPE_ARRAY = 3,
48 CU_MEMORYTYPE_UNIFIED = 4,
53 CU_DEVICE_ATTRIBUTE_TEXTURE_ALIGNMENT = 14,
54 CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR = 75,
55 CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR = 76,
60 CU_GRAPHICS_REGISTER_FLAGS_NONE = 0x00,
61 CU_GRAPHICS_REGISTER_FLAGS_READ_ONLY = 0x01,
62 CU_GRAPHICS_REGISTER_FLAGS_WRITE_DISCARD = 0x02,
63 CU_GRAPHICS_REGISTER_FLAGS_SURFACE_LOAD_STORE = 0x04,
64 CU_GRAPHICS_REGISTER_FLAGS_TEXTURE_GATHER = 0x08,
65 } CUgraphicsRegisterFlags;
69 CU_GRAPHICS_MAP_RESOURCE_FLAGS_NONE = 0x00,
70 CU_GRAPHICS_MAP_RESOURCE_FLAGS_READ_ONLY = 0x01,
71 CU_GRAPHICS_MAP_RESOURCE_FLAGS_WRITE_DISCARD = 0x02,
72 } CUgraphicsMapResourceFlags;
76 CU_STREAM_DEFAULT = 0x0,
77 CU_STREAM_NON_BLOCKING = 0x1
82 CU_TR_FILTER_MODE_POINT = 0,
83 CU_TR_FILTER_MODE_LINEAR = 1
88 CU_TR_ADDRESS_MODE_WRAP = 0,
89 CU_TR_ADDRESS_MODE_CLAMP = 1,
90 CU_TR_ADDRESS_MODE_MIRROR = 2,
91 CU_TR_ADDRESS_MODE_BORDER = 3
96 CU_RESOURCE_TYPE_ARRAY = 0,
97 CU_RESOURCE_TYPE_MIPMAPPED_ARRAY = 1,
98 CU_RESOURCE_TYPE_LINEAR = 2,
99 CU_RESOURCE_TYPE_PITCH2D = 3
104 CU_AD_FORMAT_UNSIGNED_INT8 = 1,
105 CU_AD_FORMAT_UNSIGNED_INT16 = 2,
110 CU_RES_VIEW_FORMAT_NONE = 0,
111 } CUresourceViewFormat;
117 CUmemorytype srcMemoryType;
118 gconstpointer srcHost;
119 CUdeviceptr srcDevice;
125 CUmemorytype dstMemoryType;
127 CUdeviceptr dstDevice;
137 CU_GL_DEVICE_LIST_ALL = 0x01,
142 CU_D3D11_DEVICE_LIST_ALL = 0x01,
143 CU_D3D11_DEVICE_LIST_CURRENT_FRAME = 0x02,
144 CU_D3D11_DEVICE_LIST_NEXT_FRAME = 0x03,
149 CUaddress_mode addressMode[3];
150 CUfilter_mode filterMode;
153 CUfilter_mode mipmapFilterMode;
154 gfloat mipmapLevelBias;
155 gfloat minMipmapLevelClamp;
156 gfloat maxMipmapLevelClamp;
157 gfloat borderColor[4];
163 CUresourcetype resType;
170 CUmipmappedArray hMipmappedArray;
174 CUarray_format format;
180 CUarray_format format;
192 } CUDA_RESOURCE_DESC;
196 CUresourceViewFormat format;
200 guint firstMipmapLevel;
201 guint lastMipmapLevel;
205 } CUDA_RESOURCE_VIEW_DESC;
207 #define CUDA_VERSION 10000
210 #define CUDAAPI __stdcall
215 #define cuCtxCreate cuCtxCreate_v2
216 #define cuCtxDestroy cuCtxDestroy_v2
217 #define cuCtxPopCurrent cuCtxPopCurrent_v2
218 #define cuCtxPushCurrent cuCtxPushCurrent_v2
219 #define cuGraphicsResourceGetMappedPointer cuGraphicsResourceGetMappedPointer_v2
220 #define cuGraphicsResourceSetMapFlags cuGraphicsResourceSetMapFlags_v2
222 #define cuMemAlloc cuMemAlloc_v2
223 #define cuMemAllocPitch cuMemAllocPitch_v2
224 #define cuMemAllocHost cuMemAllocHost_v2
225 #define cuMemcpy2D cuMemcpy2D_v2
226 #define cuMemcpy2DAsync cuMemcpy2DAsync_v2
227 #define cuMemFree cuMemFree_v2
228 #define cuGLGetDevices cuGLGetDevices_v2
230 #define CU_TRSF_READ_AS_INTEGER 1
234 #endif /* __GST_CUDA_STUB_H__ */