19 void mexFunction(
int nlhs, mxArray *plhs[],
int nrhs,
const mxArray *prhs[])
22 nargchk((nrhs==1 || nrhs==2) && nlhs<=1);
25 vector<MxArray> rhs(prhs, prhs+nrhs);
26 string method(rhs[0].toString());
29 if (method ==
"checkHardwareSupport") {
32 s.
set(
"MMX", checkHardwareSupport(CV_CPU_MMX));
33 s.
set(
"SSE", checkHardwareSupport(CV_CPU_SSE));
34 s.
set(
"SSE2", checkHardwareSupport(CV_CPU_SSE2));
35 s.
set(
"SSE3", checkHardwareSupport(CV_CPU_SSE3));
36 s.
set(
"SSSE3", checkHardwareSupport(CV_CPU_SSSE3));
37 s.
set(
"SSE4_1", checkHardwareSupport(CV_CPU_SSE4_1));
38 s.
set(
"SSE4_2", checkHardwareSupport(CV_CPU_SSE4_2));
39 s.
set(
"POPCNT", checkHardwareSupport(CV_CPU_POPCNT));
40 s.
set(
"AVX", checkHardwareSupport(CV_CPU_AVX));
41 s.
set(
"AVX2", checkHardwareSupport(CV_CPU_AVX2));
42 s.
set(
"FMA3", checkHardwareSupport(CV_CPU_FMA3));
43 s.
set(
"AVX_512F", checkHardwareSupport(CV_CPU_AVX_512F));
44 s.
set(
"AVX_512BW", checkHardwareSupport(CV_CPU_AVX_512BW));
45 s.
set(
"AVX_512CD", checkHardwareSupport(CV_CPU_AVX_512CD));
46 s.
set(
"AVX_512DQ", checkHardwareSupport(CV_CPU_AVX_512DQ));
47 s.
set(
"AVX_512ER", checkHardwareSupport(CV_CPU_AVX_512ER));
48 s.
set(
"AVX_512IFMA512", checkHardwareSupport(CV_CPU_AVX_512IFMA512));
49 s.
set(
"AVX_512PF", checkHardwareSupport(CV_CPU_AVX_512PF));
50 s.
set(
"AVX_512VBMI", checkHardwareSupport(CV_CPU_AVX_512VBMI));
51 s.
set(
"AVX_512VL", checkHardwareSupport(CV_CPU_AVX_512VL));
52 s.
set(
"NEON", checkHardwareSupport(CV_CPU_NEON));
55 else if (method ==
"getBuildInformation") {
57 plhs[0] =
MxArray(getBuildInformation());
59 else if (method ==
"getNumberOfCPUs") {
61 plhs[0] =
MxArray(getNumberOfCPUs());
63 else if (method ==
"getNumThreads") {
65 plhs[0] =
MxArray(getNumThreads());
67 else if (method ==
"setNumThreads") {
69 setNumThreads(rhs[1].toInt());
71 else if (method ==
"useOptimized") {
73 plhs[0] =
MxArray(useOptimized());
75 else if (method ==
"setUseOptimized") {
77 setUseOptimized(rhs[1].toBool());
80 mexErrMsgIdAndTxt(
"mexopencv:error",
81 "Unrecognized operation %s", method.c_str());
void set(mwIndex index, const T &value)
Template for numeric array element write accessor.
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
Main entry called from Matlab.
mxArray object wrapper for data conversion and manipulation.
void nargchk(bool cond)
Alias for input/ouput arguments number check.
static MxArray Struct(const char **fields=NULL, int nfields=0, mwSize m=1, mwSize n=1)
Create a new struct array.
Global constant definitions.