nareshmlx/opencv-pr huggingface dataset:
**File:** modules/core/src/ocl.cpp
**Change Type:** modified
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...

**Code Changes:**
```diff
@@ -51,7 +51,10 @@
 #include <inttypes.h>
 #endif
 
+#include <opencv2/core/utils/configuration.private.hpp>
+
 #include "opencv2/core/ocl_genbase.hpp"
+#include "opencl_kernels_core.hpp"
 
 #define CV_OPENCL_ALWAYS_SHOW_BUILD_LOG 0
```

Review comment:
I believe this should be optional.
**File:** modules/dnn/CMakeLists.txt
**Change Type:** modified
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...

**Code Changes:**
```diff
@@ -21,6 +21,8 @@ ocv_warnings_disable(CMAKE_CXX_FLAGS -Wno-shadow -Wno-parentheses -Wmaybe-uninit
 )
 ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4701 /wd4100)
 
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/ocl4dnn/include ${OPENCL_INCLUDE_DIRS})
+
 if(MSVC)
   add_definitions( -D_CRT_SECURE_NO_WARNINGS=1 )
   ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4244 /wd4267 /wd4018 /wd4355 /wd4800 /wd4251 /wd4996 /wd4146
```

Review comment:
OpenCL should not be used directly. All OpenCL calls must be done via core module proxy functions.
**File:** modules/dnn/src/layers/concat_layer.cpp
**Change Type:** modified
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...

**Code Changes:**
```diff
@@ -43,6 +43,7 @@
 #include "../precomp.hpp"
 #include "layers_common.hpp"
 #include "op_halide.hpp"
+#include "opencl_kernels_dnn.hpp"
 
 namespace cv
 {
@@ -174,11 +175,62 @@ class ConcatLayerImpl : public ConcatLayer
         }
```

Review comment:
`ACCESS_READ` => `ACCESS_WRITE`
**File:** modules/dnn/src/layers/concat_layer.cpp
**Change Type:** modified
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...

**Code Changes:**
```diff
@@ -43,6 +43,7 @@
 #include "../precomp.hpp"
 #include "layers_common.hpp"
 #include "op_halide.hpp"
+#include "opencl_kernels_dnn.hpp"
 
 namespace cv
 {
@@ -174,11 +175,62 @@ class ConcatLayerImpl : public ConcatLayer
         }
```

Review comment:
`OCL_PERFORMANCE_CHECK(ocl::Device::getDefault().isIntel())`
**File:** modules/dnn/src/layers/fully_connected_layer.cpp
**Change Type:** modified
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...

**Code Changes:**
```diff
@@ -43,8 +43,13 @@
 #include "../precomp.hpp"
 #include "layers_common.hpp"
 #include "op_halide.hpp"
+#include "opencl_kernels_dnn.hpp"
 #include <opencv2/dnn/shape_utils.hpp>
 
+#ifdef HAVE_OPENCL
+using namespace cv::dnn::ocl4dnn;
+#endif
```

Review comment:
Add space between `>>`
**File:** modules/dnn/src/ocl4dnn/include/common.hpp
**Change Type:** added
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...

**Code Changes:**
```diff
@@ -0,0 +1,62 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
cv::alignSize() / cv::alignPtr()
**File:** modules/dnn/src/ocl4dnn/src/math_functions.cpp
**Change Type:** added
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...

**Code Changes:**
```diff
@@ -0,0 +1,538 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
There is strange order of operators. Please group assignments for width/height , format settings.
**File:** modules/dnn/src/ocl4dnn/src/math_functions.cpp
**Change Type:** added
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...

**Code Changes:**
```diff
@@ -0,0 +1,538 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
Why `cv::ocl::Image2D` doesn't work here? What is required?
**File:** modules/dnn/src/ocl4dnn/src/math_functions.cpp
**Change Type:** added
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...

**Code Changes:**
```diff
@@ -0,0 +1,538 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
OpenCL CPU devices are used for validation and debugging. Probably we should not forbid them.
**File:** modules/dnn/src/ocl4dnn/src/ocl4dnn_conv_spatial.cpp
**Change Type:** added
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...

**Code Changes:**
```diff
@@ -0,0 +1,1568 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
Windows OpenCL [build](http://pullrequest.opencv.org/buildbot/builders/precommit_opencl/builds/12131/steps/test_dnn-ippicv-opencl/logs/stdio) doesn't use auto-tuning, but this message is not showed. Some checks above are not working.
**File:** modules/dnn/src/ocl4dnn/src/ocl4dnn_conv_spatial.cpp
**Change Type:** added
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...

**Code Changes:**
```diff
@@ -0,0 +1,1568 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
This code looks very strange. Why not just use `UMat` to control objects lifetime at least? And to avoid manual `clEnqueueMapBuffer`/`clEnqueueUnMapBuffer` calls.
**File:** modules/dnn/src/ocl4dnn/src/ocl4dnn_conv_spatial.cpp
**Change Type:** added
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...

**Code Changes:**
```diff
@@ -0,0 +1,1568 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
`std::numeric_limits<float>::infinity()`
**File:** modules/dnn/src/opencl/math.cl
**Change Type:** added
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...

**Code Changes:**
```diff
@@ -0,0 +1,55 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
There is already OpenCV functions for functionality of these kernels. There is no strong reason to add duplicates.
**File:** modules/dnn/src/opencl/ocl4dnn_lrn.cl
**Change Type:** added
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...

**Code Changes:**
```diff
@@ -0,0 +1,96 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
Probably this comment is not relevant anymore
**File:** modules/dnn/src/opencl/softmax.cl
**Change Type:** modified
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...

**Code Changes:**
```diff
@@ -70,6 +70,10 @@ __kernel void kernel_channel_div(const int count,
   if(index < count) {
     int n = index / channels / spatial_dim;
     int s = index % spatial_dim;
-    data[index] /= channel_sum[n * spatial_dim + s];
+    T v = data[index] / channel_sum[n * spatial_dim + s];
+#ifdef LOG_SOFTMAX
+    v = log(v);
+#endif
+    data[index] = v;
```

Review comment:
`logsoftmax` should be passed via macro definition in build options
**File:** modules/dnn/src/opencl/softmax_loss.cl
**Change Type:** added
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...

**Code Changes:**
```diff
@@ -0,0 +1,182 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
`normalization_mode` should be passed via build macro too
**File:** modules/dnn/src/ocl4dnn/src/ocl4dnn_conv_spatial.cpp
**Change Type:** added
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...

**Code Changes:**
```diff
@@ -0,0 +1,1568 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
Program compilation may fail due unsupported option: `-cl-no-subgroup-ifp` (it is described in OpenCL 2.1 only, OpenCV supports 1.2+ and should not fail on OpenCL 1.1). 1. Using of this option should be optional (or detected separately). 2. OpenCL program compilation errors should be handled properly. (It fails in another place with "Basic kernel failed verification" message) Problem is observed on this configuration: ``` OpenCL Platforms: Intel(R) OpenCL iGPU: Intel(R) HD Graphics 520 (OpenCL 2.0 ) CPU: Intel(R) Core(TM) i5-6300U CPU @ 2.40GHz (OpenCL 2.0 (Build 10094)) Current OpenCL device: Type = iGPU Name = Intel(R) HD Graphics 520 Version = OpenCL 2.0 Driver version = 20.19.15.4463 Compute units = 24 Max work group size = 256 Local memory size = 64 kB Max memory allocation size = 805 MB 264 kB Double support = No Host unified memory = Yes Has AMD Blas = No Has AMD Fft = No Preferred vector width char = 1 Preferred vector width short = 1 Preferred vector width int = 1 Preferred vector width long = 1 Preferred vector width float = 1 Preferred vector width double = 0 ```
**File:** modules/dnn/src/ocl4dnn/src/ocl4dnn_conv_spatial.cpp
**Change Type:** added
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...

**Code Changes:**
```diff
@@ -0,0 +1,1568 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
BTW, In previous patch it creates 'spatialkernels' in the top-level directory of current disk on Windows.
**File:** modules/dnn/src/ocl4dnn/src/ocl4dnn_conv_spatial.cpp
**Change Type:** added
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...

**Code Changes:**
```diff
@@ -0,0 +1,1568 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
"spatialkernels" is created to cache the tuned convolution kernel in the benchmarking, once the tuning is done, convolution kernel is saved under this directory and ocl4dnn can load these kernels directly in the next run.
**File:** modules/dnn/src/ocl4dnn/src/ocl4dnn_conv_spatial.cpp
**Change Type:** added
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...

**Code Changes:**
```diff
@@ -0,0 +1,1568 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
I know this, the problem is **in the top-level directory of current disk** (`C:\spatialkernels`).
**File:** modules/dnn/CMakeLists.txt
**Change Type:** modified
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...

**Code Changes:**
```diff
@@ -21,6 +21,8 @@ ocv_warnings_disable(CMAKE_CXX_FLAGS -Wno-shadow -Wno-parentheses -Wmaybe-uninit
 )
 ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4701 /wd4100)
 
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/ocl4dnn/include ${OPENCL_INCLUDE_DIRS})
+
 if(MSVC)
   add_definitions( -D_CRT_SECURE_NO_WARNINGS=1 )
   ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4244 /wd4267 /wd4018 /wd4355 /wd4800 /wd4251 /wd4996 /wd4146
```

Review comment:
Yes, dynamic loading OpenCL library is true for Linux and Windows. But for Mac, the cmake log on buildbot is below: -- OpenCL: <Link with OpenCL library> -- Link libraries: -framework OpenCL That's a way for static link, so if I remove ${OPENCL_LIBRARIES} for APPLE, the mac build on buildbot will be failed.
**File:** modules/core/src/ocl.cpp
**Change Type:** modified
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...

**Code Changes:**
```diff
@@ -51,7 +51,10 @@
 #include <inttypes.h>
 #endif
 
+#include <opencv2/core/utils/configuration.private.hpp>
+
 #include "opencv2/core/ocl_genbase.hpp"
+#include "opencl_kernels_core.hpp"
 
 #define CV_OPENCL_ALWAYS_SHOW_BUILD_LOG 0
```

Review comment:
yes, this flag is optional. In ocl4dnn we need this flag to get cl profiling info, but it looks that we don't have a way to set this flag through any interface. Before we use getenv("ENABLE_OPENCL_PROFILING") to control this flag, but it doesn't look like a good way because buildbot doesn't recognize this flag.
**File:** modules/dnn/src/ocl4dnn/src/ocl4dnn_conv_spatial.cpp
**Change Type:** added
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...

**Code Changes:**
```diff
@@ -0,0 +1,1568 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
One concern to use kernel.run() is that global work size may be changed in this function, so the ocl kernels may not work properly due to global work size change.
**File:** modules/dnn/src/ocl4dnn/src/math_functions.cpp
**Change Type:** added
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...

**Code Changes:**
```diff
@@ -0,0 +1,538 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
ocl4dnnGEMMCopyBufferToImage isn't just copy the umat data as is, it may transpose the matrix and add extra padding for purpose. So cv::ocl::Image2D isn't suitable in this case.
**File:** modules/dnn/src/ocl4dnn/src/ocl4dnn_conv_spatial.cpp
**Change Type:** added
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...

**Code Changes:**
```diff
@@ -0,0 +1,1568 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
with latest update, The cache dir path on windows is "$USERPROFILE\spatialkernels", for buildbot, the path is "C:\Users\build\spatialkernels\", so this issue should be fixed.
**File:** modules/dnn/CMakeLists.txt
**Change Type:** modified
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...

**Code Changes:**
```diff
@@ -21,6 +21,8 @@ ocv_warnings_disable(CMAKE_CXX_FLAGS -Wno-shadow -Wno-parentheses -Wmaybe-uninit
 )
 ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4701 /wd4100)
 
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/ocl4dnn/include ${OPENCL_INCLUDE_DIRS})
+
 if(MSVC)
   add_definitions( -D_CRT_SECURE_NO_WARNINGS=1 )
   ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4244 /wd4267 /wd4018 /wd4355 /wd4800 /wd4251 /wd4996 /wd4146
```

Review comment:
For Linux and windows, remove "-std=c++11" in CMAKE_CXX_FLAGS is ok, code compiles successfully. For Mac, It causes compile failure. so compiler may not support C++11 well on Mac. So I removed this flag for windows/Linux and keep it for Mac.
**File:** modules/dnn/src/layers/concat_layer.cpp
**Change Type:** modified
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...
**Review Line:** 179

**Code Changes:**
```diff
@@ -174,11 +175,62 @@ class ConcatLayerImpl : public ConcatLayer
         }
     };
 
+#ifdef HAVE_OPENCL
+    bool forward_ocl(std::vector<Mat*> &inputs, std::vector<Mat> &outputs, std::vector<Mat> &internals)
+    {
+        CV_TRACE_FUNCTION();
+        CV_TRACE_ARG_VALUE(name, "name", name.c_str());
+
+        int cAxis = clamp(axis, inputs[0]->dims);
```

Review comment:
yes, we should change the interface later to better support umat.
**File:** modules/dnn/src/opencl/softmax_loss.cl
**Change Type:** added
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...

**Code Changes:**
```diff
@@ -0,0 +1,182 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
fixed in new updates.
**File:** modules/dnn/src/opencl/softmax.cl
**Change Type:** modified
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...

**Code Changes:**
```diff
@@ -70,6 +70,10 @@ __kernel void kernel_channel_div(const int count,
   if(index < count) {
     int n = index / channels / spatial_dim;
     int s = index % spatial_dim;
-    data[index] /= channel_sum[n * spatial_dim + s];
+    T v = data[index] / channel_sum[n * spatial_dim + s];
+#ifdef LOG_SOFTMAX
+    v = log(v);
+#endif
+    data[index] = v;
```

Review comment:
fixed in new updates.
**File:** modules/dnn/src/opencl/math.cl
**Change Type:** added
**Context:** PR #9114: add libdnn acceleration to dnn module - libdnn provide ocl acceleration to current dnn module. Currently it provide ocl kernels for 5 layers...

**Code Changes:**
```diff
@@ -0,0 +1,55 @@
+/*M///////////////////////////////////////////////////////////////////////////////////////
+//
+//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
+//
+//  By downloading, copying, installing or using the software you agree to this license.
+//  If you do not agree to this license, do not download, install,
+//  copy or use the software.
+//
+//
```

Review comment:
fixed in new updates. have removed these kernels