removed needless divUp

This commit is contained in:
Ilya Lavrenov
2013-09-16 15:11:56 +04:00
parent f9c6123439
commit 58b84c2fc0
15 changed files with 64 additions and 367 deletions

View File

@@ -96,10 +96,7 @@ static void prefilter_xsobel(const oclMat &input, oclMat &output, int prefilterC
#define N_DISPARITIES 8
#define ROWSperTHREAD 21
#define BLOCK_W 128
static inline int divUp(int total, int grain)
{
return (total + grain - 1) / grain;
}
////////////////////////////////////////////////////////////////////////////
///////////////////////////////stereoBM_GPU////////////////////////////////
////////////////////////////////////////////////////////////////////////////
@@ -117,11 +114,10 @@ static void stereo_bm(const oclMat &left, const oclMat &right, oclMat &disp,
size_t local_mem_size = (N_DISPARITIES * (BLOCK_W + 2 * winsz2)) *
sizeof(cl_uint);
//size_t blockSize = 1;
size_t localThreads[] = { BLOCK_W, 1,1};
size_t globalThreads[] = { divUp(left.cols - maxdisp - 2 * winsz2, BLOCK_W) *BLOCK_W,
size_t localThreads[] = { BLOCK_W, 1, 1 };
size_t globalThreads[] = { left.cols - maxdisp - 2 * winsz2,
divUp(left.rows - 2 * winsz2, ROWSperTHREAD),
1
};
1 };
std::vector< std::pair<size_t, const void *> > args;
args.push_back(std::make_pair(sizeof(cl_mem), (void *)&left.data));
@@ -151,10 +147,9 @@ static void postfilter_textureness(oclMat &left, int winSize,
size_t blockSize = 1;
size_t localThreads[] = { BLOCK_W, blockSize ,1};
size_t globalThreads[] = { divUp(left.cols, BLOCK_W) *BLOCK_W,
size_t globalThreads[] = { left.cols,
divUp(left.rows, 2 * ROWSperTHREAD),
1
};
1 };
size_t local_mem_size = (localThreads[0] + localThreads[0] + (winSize / 2) * 2) * sizeof(float);