[IE CLDNN] Fix result storing in leftover's branch (#2050)
authorIlya Znamenskiy <ilya.znamenskiy@intel.com>
Thu, 3 Sep 2020 15:47:32 +0000 (18:47 +0300)
committerGitHub <noreply@github.com>
Thu, 3 Sep 2020 15:47:32 +0000 (18:47 +0300)
inference-engine/thirdparty/clDNN/kernel_selector/core/actual_kernels/softmax/softmax_kernel_items_class_optimized.cpp
inference-engine/thirdparty/clDNN/kernel_selector/core/cl_kernels/softmax_gpu_items_class_optimized.cl

index 6b2ec1e..4af7fc0 100644 (file)
@@ -76,6 +76,7 @@ JitConstants SoftmaxKerneItemsClassOptimized::GetJitConstants(const softmax_para
     auto jit = SoftmaxItemsClassKernelBase::GetJitConstants(params, kd);
 
     jit.AddConstant(MakeJitConstant("WORKITEMS_PER_CLASSES", workitems_per_classes));
+    jit.AddConstant(MakeJitConstant("HAS_DRIVER_PROBLEMS", params.engineInfo.bIMADSupport));
 
     return jit;
 }
index dd64255..103ea53 100644 (file)
@@ -63,12 +63,24 @@ KERNEL(softmax_items_class_optimized)(__global INPUT0_TYPE* input, __global OUTP
     ACCUMULATOR_TYPE denominator = 0.0;
     for (uint cls = 0; cls < FULL_ITERATIONS_NUM; cls++)
     {
+// This is a temporary solution for unresolved problem when ocl kernels compilation step doesn't produce actual binaries 
+// for current kernel but driver doesn't report any errors (JIRA CVS-32211)
+#if HAS_DRIVER_PROBLEMS
+        data[cls] = data[cls] == max_value ? 1.0 : native_exp(data[cls] - max_value);
+#else
         data[cls] = native_exp(data[cls] - max_value);
+#endif
         denominator += data[cls];
     }
     if(simd_lane < LEFTOVERS)
     {
+// This is a temporary solution for unresolved problem when ocl kernels compilation step doesn't produce actual binaries 
+// for current kernel but driver doesn't report any errors (JIRA CVS-32211)
+#if HAS_DRIVER_PROBLEMS
+        data[DATA_PER_WORKITEM-1] = data[DATA_PER_WORKITEM-1] == max_value ? 1.0 : native_exp(data[DATA_PER_WORKITEM-1] - max_value);
+#else
         data[DATA_PER_WORKITEM-1] = native_exp(data[DATA_PER_WORKITEM-1] - max_value);
+#endif
         denominator += data[DATA_PER_WORKITEM-1];
     }