Visual Studio 2015 warning and test fixes

This commit is contained in:
Maksim Shabunin
2015-10-16 17:10:00 +03:00
parent 1648e9292c
commit 6e9d0d9a0c
54 changed files with 242 additions and 229 deletions

View File

@@ -1051,7 +1051,7 @@ bool CascadeClassifierImpl::ocl_detectMultiScaleNoGrouping( const std::vector<fl
if( localsz.area() == 0 )
return false;
Size lbufSize = featureEvaluator->getLocalBufSize();
size_t localsize[] = { localsz.width, localsz.height };
size_t localsize[] = { (size_t)localsz.width, (size_t)localsz.height };
const int grp_per_CU = 12;
size_t globalsize[] = { grp_per_CU*ocl::Device::getDefault().maxComputeUnits()*localsize[0], localsize[1] };
bool ok = false;

View File

@@ -1092,7 +1092,7 @@ static bool ocl_compute_gradients_8UC1(int height, int width, InputArray _img, f
UMat img = _img.getUMat();
size_t localThreads[3] = { NTHREADS, 1, 1 };
size_t globalThreads[3] = { width, height, 1 };
size_t globalThreads[3] = { (size_t)width, (size_t)height, 1 };
char correctGamma = (correct_gamma) ? 1 : 0;
int grad_quadstep = (int)grad.step >> 3;
int qangle_elem_size = CV_ELEM_SIZE1(qangle.type());
@@ -1152,7 +1152,7 @@ static bool ocl_compute_hists(int nbins, int block_stride_x, int block_stride_y,
int qangle_step = (int)qangle.step / qangle_elem_size;
int blocks_in_group = 4;
size_t localThreads[3] = { blocks_in_group * 24, 2, 1 };
size_t localThreads[3] = { (size_t)blocks_in_group * 24, 2, 1 };
size_t globalThreads[3] = {((img_block_width * img_block_height + blocks_in_group - 1)/blocks_in_group) * localThreads[0], 2, 1 };
int hists_size = (nbins * CELLS_PER_BLOCK_X * CELLS_PER_BLOCK_Y * 12) * sizeof(float);
@@ -1271,7 +1271,7 @@ static bool ocl_extract_descrs_by_rows(int win_height, int win_width, int block_
int descriptors_quadstep = (int)descriptors.step >> 2;
size_t globalThreads[3] = { img_win_width * NTHREADS, img_win_height, 1 };
size_t globalThreads[3] = { (size_t)img_win_width * NTHREADS, (size_t)img_win_height, 1 };
size_t localThreads[3] = { NTHREADS, 1, 1 };
int idx = 0;
@@ -1305,7 +1305,7 @@ static bool ocl_extract_descrs_by_cols(int win_height, int win_width, int block_
int descriptors_quadstep = (int)descriptors.step >> 2;
size_t globalThreads[3] = { img_win_width * NTHREADS, img_win_height, 1 };
size_t globalThreads[3] = { (size_t)img_win_width * NTHREADS, (size_t)img_win_height, 1 };
size_t localThreads[3] = { NTHREADS, 1, 1 };
int idx = 0;
@@ -1704,8 +1704,8 @@ static bool ocl_classify_hists(int win_height, int win_width, int block_stride_y
int img_block_width = (width - CELLS_PER_BLOCK_X * CELL_WIDTH + block_stride_x) /
block_stride_x;
size_t globalThreads[3] = { img_win_width * nthreads, img_win_height, 1 };
size_t localThreads[3] = { nthreads, 1, 1 };
size_t globalThreads[3] = { (size_t)img_win_width * nthreads, (size_t)img_win_height, 1 };
size_t localThreads[3] = { (size_t)nthreads, 1, 1 };
idx = k.set(idx, block_hist_size);
idx = k.set(idx, img_win_width);