fix some mismatch on cpu device running OCL
This commit is contained in:
parent
cb63bbf001
commit
d5aaea2749
@ -251,9 +251,9 @@ __kernel void stereoKernel(__global unsigned char *left, __global unsigned char
|
||||
|
||||
barrier(CLK_LOCAL_MEM_FENCE); //before MinSSD function
|
||||
|
||||
uint2 minSSD = MinSSD(col_ssd_cache + get_local_id(0), col_ssd, radius);
|
||||
if (X < cwidth - radius && Y < cheight - radius)
|
||||
{
|
||||
uint2 minSSD = MinSSD(col_ssd_cache + get_local_id(0), col_ssd, radius);
|
||||
if (minSSD.x < minSSDImage[0])
|
||||
{
|
||||
disparImage[0] = (unsigned char)(d + minSSD.y);
|
||||
@ -264,7 +264,7 @@ __kernel void stereoKernel(__global unsigned char *left, __global unsigned char
|
||||
for(int row = 1; row < end_row; row++)
|
||||
{
|
||||
int idx1 = y_tex * img_step + x_tex;
|
||||
int idx2 = (y_tex + (2 * radius + 1)) * img_step + x_tex;
|
||||
int idx2 = min(y_tex + (2 * radius + 1), cheight - 1) * img_step + x_tex;
|
||||
|
||||
barrier(CLK_GLOBAL_MEM_FENCE);
|
||||
barrier(CLK_LOCAL_MEM_FENCE);
|
||||
@ -278,10 +278,10 @@ __kernel void stereoKernel(__global unsigned char *left, __global unsigned char
|
||||
|
||||
barrier(CLK_LOCAL_MEM_FENCE);
|
||||
|
||||
uint2 minSSD = MinSSD(col_ssd_cache + get_local_id(0), col_ssd, radius);
|
||||
if (X < cwidth - radius && row < cheight - radius - Y)
|
||||
{
|
||||
int idx = row * cminSSD_step;
|
||||
uint2 minSSD = MinSSD(col_ssd_cache + get_local_id(0), col_ssd, radius);
|
||||
if (minSSD.x < minSSDImage[idx])
|
||||
{
|
||||
disparImage[disp_step * row] = (unsigned char)(d + minSSD.y);
|
||||
|
Loading…
x
Reference in New Issue
Block a user