Rostislav Vasilikhin 8 years ago
parent 0a30f64f12
commit 726efee4d2
  1. 10
      modules/core/src/matmul.cpp

@ -1013,7 +1013,7 @@ void cv::gemm( InputArray matA, InputArray matB, double alpha,
GEMMBlockMulFunc blockMulFunc; GEMMBlockMulFunc blockMulFunc;
GEMMStoreFunc storeFunc; GEMMStoreFunc storeFunc;
Mat *matD = &D, tmat; Mat *matD = &D, tmat;
int tmat_size = 0; size_t tmat_size = 0;
const uchar* Cdata = C.data; const uchar* Cdata = C.data;
size_t Cstep = C.data ? (size_t)C.step : 0; size_t Cstep = C.data ? (size_t)C.step : 0;
AutoBuffer<uchar> buf; AutoBuffer<uchar> buf;
@ -1046,7 +1046,7 @@ void cv::gemm( InputArray matA, InputArray matB, double alpha,
if( D.data == A.data || D.data == B.data ) if( D.data == A.data || D.data == B.data )
{ {
tmat_size = d_size.width*d_size.height*CV_ELEM_SIZE(type); tmat_size = (size_t)d_size.width*d_size.height*CV_ELEM_SIZE(type);
// Allocate tmat later, once the size of buf is known // Allocate tmat later, once the size of buf is known
matD = &tmat; matD = &tmat;
} }
@ -1137,7 +1137,7 @@ void cv::gemm( InputArray matA, InputArray matB, double alpha,
int is_b_t = flags & GEMM_2_T; int is_b_t = flags & GEMM_2_T;
int elem_size = CV_ELEM_SIZE(type); int elem_size = CV_ELEM_SIZE(type);
int dk0_1, dk0_2; int dk0_1, dk0_2;
int a_buf_size = 0, b_buf_size, d_buf_size; size_t a_buf_size = 0, b_buf_size, d_buf_size;
uchar* a_buf = 0; uchar* a_buf = 0;
uchar* b_buf = 0; uchar* b_buf = 0;
uchar* d_buf = 0; uchar* d_buf = 0;
@ -1178,8 +1178,8 @@ void cv::gemm( InputArray matA, InputArray matB, double alpha,
dn0 = block_size / dk0; dn0 = block_size / dk0;
dk0_1 = (dn0+dn0/8+2) & -2; dk0_1 = (dn0+dn0/8+2) & -2;
b_buf_size = (dk0+dk0/8+1)*dk0_1*elem_size; b_buf_size = (size_t)(dk0+dk0/8+1)*dk0_1*elem_size;
d_buf_size = (dk0+dk0/8+1)*dk0_1*work_elem_size; d_buf_size = (size_t)(dk0+dk0/8+1)*dk0_1*work_elem_size;
if( is_a_t ) if( is_a_t )
{ {

Loading…
Cancel
Save