dnn(ocl4dnn): fix args for 'max_pool_forward' kernel
authorAlexander Alekhin <alexander.alekhin@intel.com>
Mon, 9 Jul 2018 15:02:20 +0000 (18:02 +0300)
committerAlexander Alekhin <alexander.alekhin@intel.com>
Mon, 9 Jul 2018 15:02:20 +0000 (18:02 +0300)
modules/dnn/src/ocl4dnn/src/ocl4dnn_pool.cpp

index b74bf4d..8b74248 100644 (file)
@@ -132,9 +132,10 @@ bool OCL4DNNPool<Dtype>::Forward(const UMat& bottom,
                 width_,
                 pooled_height_,
                 pooled_width_,
-                ocl::KernelArg::PtrWriteOnly(top),
-                ocl::KernelArg::PtrWriteOnly(top_mask)
+                ocl::KernelArg::PtrWriteOnly(top)
             );
+            if (computeMaxIdx)
+                oclk_max_pool_forward.set(8, ocl::KernelArg::PtrWriteOnly(top_mask));  // TODO remove magic number. Extend cv::ocl::Kernel API
 
             ret = oclk_max_pool_forward.run(1, global, local, false);
         }