From c1a59b8d8066e475e2e9f9da03f29e5e45d9096c Mon Sep 17 00:00:00 2001 From: yao Date: Fri, 28 Jun 2013 13:38:58 +0800 Subject: [PATCH] more fix to HOG --- modules/ocl/src/opencl/objdetect_hog.cl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/ocl/src/opencl/objdetect_hog.cl b/modules/ocl/src/opencl/objdetect_hog.cl index b9103380d6..8ca12704e5 100644 --- a/modules/ocl/src/opencl/objdetect_hog.cl +++ b/modules/ocl/src/opencl/objdetect_hog.cl @@ -133,7 +133,9 @@ __kernel void compute_hists_lut_kernel( final_hist[(cell_x * 2 + cell_y) * cnbins + bin_id] = hist_[0] + hist_[1] + hist_[2]; } +#ifdef CPU barrier(CLK_LOCAL_MEM_FENCE); +#endif int tid = (cell_y * CELLS_PER_BLOCK_Y + cell_x) * 12 + cell_thread_x; if ((tid < cblock_hist_size) && (gid < blocks_total)) @@ -225,8 +227,9 @@ __kernel void compute_hists_kernel( final_hist[(cell_x * 2 + cell_y) * cnbins + bin_id] = hist_[0] + hist_[1] + hist_[2]; } +#ifdef CPU barrier(CLK_LOCAL_MEM_FENCE); - +#endif int tid = (cell_y * CELLS_PER_BLOCK_Y + cell_x) * 12 + cell_thread_x; if ((tid < cblock_hist_size) && (gid < blocks_total)) {