Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
96d48331
Commit
96d48331
authored
Aug 10, 2016
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7076 from sovrasov:mkl_lapack
parents
92396740
a113d9bc
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
7 deletions
+31
-7
CMakeLists.txt
CMakeLists.txt
+1
-1
OpenCVFindLibsPerf.cmake
cmake/OpenCVFindLibsPerf.cmake
+12
-2
cvconfig.h.in
cmake/templates/cvconfig.h.in
+6
-0
hal_internal.cpp
modules/core/src/hal_internal.cpp
+12
-4
No files found.
CMakeLists.txt
View file @
96d48331
...
...
@@ -224,7 +224,7 @@ OCV_OPTION(WITH_VA "Include VA support" OFF
OCV_OPTION
(
WITH_VA_INTEL
"Include Intel VA-API/OpenCL support"
OFF
IF
(
UNIX AND NOT ANDROID
)
)
OCV_OPTION
(
WITH_GDAL
"Include GDAL Support"
OFF
IF
(
NOT ANDROID AND NOT IOS AND NOT WINRT
)
)
OCV_OPTION
(
WITH_GPHOTO2
"Include gPhoto2 library support"
ON
IF
(
UNIX AND NOT ANDROID
)
)
OCV_OPTION
(
WITH_LAPACK
"Include Lapack library support"
ON
IF
(
UNIX AND
NOT ANDROID
)
)
OCV_OPTION
(
WITH_LAPACK
"Include Lapack library support"
ON
IF
(
NOT ANDROID
)
)
# OpenCV build components
# ===================================================
...
...
cmake/OpenCVFindLibsPerf.cmake
View file @
96d48331
...
...
@@ -7,11 +7,21 @@ if(WITH_LAPACK)
find_package
(
LAPACK
)
if
(
LAPACK_FOUND
)
find_path
(
LAPACKE_INCLUDE_DIR
"lapacke.h"
)
if
(
LAPACKE_INCLUDE_DIR
)
find_path
(
MKL_LAPACKE_INCLUDE_DIR
"mkl_lapack.h"
)
if
(
LAPACKE_INCLUDE_DIR OR MKL_LAPACKE_INCLUDE_DIR
)
find_path
(
CBLAS_INCLUDE_DIR
"cblas.h"
)
if
(
CBLAS_INCLUDE_DIR
)
find_path
(
MKL_CBLAS_INCLUDE_DIR
"mkl_cblas.h"
)
if
(
CBLAS_INCLUDE_DIR OR MKL_CBLAS_INCLUDE_DIR
)
set
(
HAVE_LAPACK 1
)
if
(
CBLAS_INCLUDE_DIR
)
ocv_include_directories
(
${
LAPACKE_INCLUDE_DIR
}
${
CBLAS_INCLUDE_DIR
}
)
set
(
HAVE_LAPACK_GENERIC 1
)
elseif
(
MKL_CBLAS_INCLUDE_DIR
)
ocv_include_directories
(
${
MKL_LAPACKE_INCLUDE_DIR
}
${
MKL_CBLAS_INCLUDE_DIR
}
)
set
(
HAVE_LAPACK_MKL 1
)
endif
()
list
(
APPEND OPENCV_LINKER_LIBS
${
LAPACK_LIBRARIES
}
)
endif
()
endif
()
...
...
cmake/templates/cvconfig.h.in
View file @
96d48331
...
...
@@ -204,5 +204,11 @@
/* Lapack */
#cmakedefine HAVE_LAPACK
/* Lapack Generic */
#cmakedefine HAVE_LAPACK_GENERIC
/* Lapack MKL */
#cmakedefine HAVE_LAPACK_MKL
/* FP16 */
#cmakedefine HAVE_FP16
modules/core/src/hal_internal.cpp
View file @
96d48331
...
...
@@ -46,9 +46,17 @@
#ifdef HAVE_LAPACK
#ifdef HAVE_LAPACK_MKL
#include <mkl_cblas.h>
#include <mkl_lapack.h>
#endif
#ifdef HAVE_LAPACK_GENERIC
#include <lapacke.h>
#include <cblas.h>
#endif
#include <cmath>
#include <lapacke.h>
#include <cblas.h>
#include <algorithm>
#include <typeinfo>
#include <limits>
...
...
@@ -150,7 +158,7 @@ lapack_LU(fptype* a, size_t a_step, int m, fptype* b, size_t b_step, int n, int*
template
<
typename
fptype
>
static
inline
int
lapack_Cholesky
(
fptype
*
a
,
size_t
a_step
,
int
m
,
fptype
*
b
,
size_t
b_step
,
int
n
,
bool
*
info
)
{
int
lapackStatus
;
int
lapackStatus
=
0
;
int
lda
=
a_step
/
sizeof
(
fptype
);
char
L
[]
=
{
'L'
,
'\0'
};
...
...
@@ -227,7 +235,7 @@ lapack_SVD(fptype* a, size_t a_step, fptype *w, fptype* u, size_t u_step, fptype
else
if
(
typeid
(
fptype
)
==
typeid
(
double
))
dgesdd_
(
mode
,
&
m
,
&
n
,
(
double
*
)
a
,
&
lda
,
(
double
*
)
w
,
(
double
*
)
u
,
&
ldu
,
(
double
*
)
vt
,
&
ldv
,
(
double
*
)
&
work1
,
&
lwork
,
iworkBuf
,
info
);
lwork
=
round
(
work1
);
//optimal buffer size
lwork
=
(
int
)
round
(
work1
);
//optimal buffer size
fptype
*
buffer
=
new
fptype
[
lwork
+
1
];
if
(
typeid
(
fptype
)
==
typeid
(
float
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment