-
Notifications
You must be signed in to change notification settings - Fork 875
/
Copy pathcuda.h
60 lines (50 loc) · 1.43 KB
/
cuda.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#ifndef _OPENCV3_CUDA_H_
#define _OPENCV3_CUDA_H_
#ifdef __cplusplus
#include <opencv2/opencv.hpp>
#include <opencv2/core/cuda.hpp>
extern "C" {
#endif
#include "../core.h"
#ifdef __cplusplus
typedef cv::cuda::GpuMat* GpuMat;
typedef cv::cuda::Stream* Stream;
#else
typedef void* GpuMat;
typedef void* Stream;
#endif
// Wrapper for the vector of GpuMat aka std::vector<GpuMat>
typedef struct GpuMats {
GpuMat* mats;
int length;
} GpuMats;
GpuMat GpuMat_New();
GpuMat GpuMat_NewFromMat(Mat mat);
GpuMat GpuMat_NewWithSize(int rows, int cols, int type);
void GpuMat_Upload(GpuMat m, Mat data, Stream s);
void GpuMat_Download(GpuMat m, Mat dst, Stream s);
void GpuMat_Close(GpuMat m);
int GpuMat_Empty(GpuMat m);
void GpuMat_ConvertTo(GpuMat m, GpuMat dst, int type, Stream s);
void GpuMat_ConvertFp16(GpuMat m, GpuMat dst);
void GpuMat_CopyTo(GpuMat m, GpuMat dst, Stream s);
GpuMat GpuMat_Reshape(GpuMat m, int cn, int rows);
int GpuMat_Cols(GpuMat m);
int GpuMat_Rows(GpuMat m);
int GpuMat_Channels(GpuMat m);
int GpuMat_Type(GpuMat m);
void PrintCudaDeviceInfo(int device);
void PrintShortCudaDeviceInfo(int device);
int GetCudaEnabledDeviceCount();
int GetCudaDevice();
void SetCudaDevice(int device);
void ResetCudaDevice();
bool CudaDeviceSupports(int features);
Stream Stream_New();
void Stream_Close(Stream s);
bool Stream_QueryIfComplete(Stream s);
void Stream_WaitForCompletion(Stream s);
#ifdef __cplusplus
}
#endif
#endif //_OPENCV3_CUDA_H_