From df697f65209713976715944b735c67a6a1012c2e Mon Sep 17 00:00:00 2001 From: Yan Wang Date: Thu, 22 Jan 2015 16:36:16 +0800 Subject: [PATCH] Optimize runLBPClassifierStumpSimple by built-in mad24. Signed-off-by: Yan Wang --- modules/objdetect/src/opencl/cascadedetect.cl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/objdetect/src/opencl/cascadedetect.cl b/modules/objdetect/src/opencl/cascadedetect.cl index ce676426f5..465fa0c65d 100644 --- a/modules/objdetect/src/opencl/cascadedetect.cl +++ b/modules/objdetect/src/opencl/cascadedetect.cl @@ -397,8 +397,8 @@ __kernel void runLBPClassifierStumpSimple( for( tileIdx = groupIdx; tileIdx < totalTiles; tileIdx += ngroups ) { - int iy = ((tileIdx / ntiles.x)*local_size_y + ly)*ystep; - int ix = ((tileIdx % ntiles.x)*local_size_x + lx)*ystep; + int iy = mad24((tileIdx / ntiles.x), local_size_y, ly) * ystep; + int ix = mad24((tileIdx % ntiles.x), local_size_x, lx) * ystep; if( ix < worksize.x && iy < worksize.y ) {