Merge pull request #6867 from alalek:fix_lapack
This commit is contained in:
commit
9b3d65c5e4
@ -6,14 +6,17 @@
|
||||
if(WITH_LAPACK)
|
||||
find_package(LAPACK)
|
||||
if(LAPACK_FOUND)
|
||||
find_path(LAPACK_INCLUDE_DIR "lapacke.h")
|
||||
if(LAPACK_INCLUDE_DIR)
|
||||
find_path(LAPACKE_INCLUDE_DIR "lapacke.h")
|
||||
if(LAPACKE_INCLUDE_DIR)
|
||||
find_path(CBLAS_INCLUDE_DIR "cblas.h")
|
||||
if(CBLAS_INCLUDE_DIR)
|
||||
set(HAVE_LAPACK 1)
|
||||
ocv_include_directories(${LAPACK_INCLUDE_DIR})
|
||||
ocv_include_directories(${LAPACKE_INCLUDE_DIR} ${CBLAS_INCLUDE_DIR})
|
||||
list(APPEND OPENCV_LINKER_LIBS ${LAPACK_LIBRARIES})
|
||||
endif()
|
||||
endif(LAPACK_FOUND)
|
||||
endif(WITH_LAPACK)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# --- TBB ---
|
||||
if(WITH_TBB)
|
||||
|
@ -399,9 +399,9 @@ lapack_gemm_c(const fptype *src1, size_t src1_step, const fptype *src2, size_t s
|
||||
set_value((std::complex<fptype>*)dst, lddst, std::complex<fptype>(0.0, 0.0), d_m, d_n);
|
||||
|
||||
if(typeid(fptype) == typeid(float))
|
||||
cblas_cgemm(CblasRowMajor, transA, transB, a_m, d_n, a_n, &cAlpha, (void*)src1, ldsrc1, (void*)src2, ldsrc2, &cBeta, (void*)dst, lddst);
|
||||
cblas_cgemm(CblasRowMajor, transA, transB, a_m, d_n, a_n, (float*)reinterpret_cast<fptype(&)[2]>(cAlpha), (float*)src1, ldsrc1, (float*)src2, ldsrc2, (float*)reinterpret_cast<fptype(&)[2]>(cBeta), (float*)dst, lddst);
|
||||
else if(typeid(fptype) == typeid(double))
|
||||
cblas_zgemm(CblasRowMajor, transA, transB, a_m, d_n, a_n, &cAlpha, (void*)src1, ldsrc1, (void*)src2, ldsrc2, &cBeta, (void*)dst, lddst);
|
||||
cblas_zgemm(CblasRowMajor, transA, transB, a_m, d_n, a_n, (double*)reinterpret_cast<fptype(&)[2]>(cAlpha), (double*)src1, ldsrc1, (double*)src2, ldsrc2, (double*)reinterpret_cast<fptype(&)[2]>(cBeta), (double*)dst, lddst);
|
||||
|
||||
return CV_HAL_ERROR_OK;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user