Issue 1:
System information (version)

OpenCV => 4.1.0

Operating System / Platform => Windows 7 x64

Compiler => mingw 7.3.0 x64

Detailed description

Segfault when I try to transfer any args to kernel args method (While opencl is working when I use cv::UMat in the algorithms like cv::normalize, cv::reduce etc..) May be is there any algorithm in opencv to reduce Mat by 8 column groups?

Steps to reproduce

Using Qt 5.12.2 :

#include <opencv2/core/core.hpp>
#include <opencv2/core/ocl.hpp>
#include <opencv2/opencv.hpp>

QString kernelName = "column_reduce";
QString kernelSrc = QStringLiteral(
"__kernel void column_reduce "
"(__global float8* img_in, __global float* img_out, int width, __local float8* tmp)"
"{ "
" const int2 pos_global = {get_global_id(0), get_global_id(1)}; "
" const int pos_1d_global = pos_global.x * width + pos_global.y; "
" const int2 pos = {get_local_id(0), get_local_id(1)}; "
" const int pos_1d = pos.x * width + pos.y; "
" tmp[pos_1d] = img_in[pos_1d_global]; "
" barrier(CLK_LOCAL_MEM_FENCE); "
" float8 cols = tmp[pos_1d]; "
" float sum = cols.s0 + cols.s1 + cols.s2 + cols.s3 + "
" cols.s4 + cols.s5 + cols.s6 + cols.s7; "
" barrier(CLK_LOCAL_MEM_FENCE); "
" img_out[pos_1d_global] = sum; "
"} ");

cv::ocl::Kernel kernel(kernelName.toUtf8().constData(),
cv::ocl::ProgramSource(kernelSrc.toUtf8().constData()));
assert(! kernel.empty());

cv::Mat src = cv::Mat(100, 128/*divide on 8*/, CV_32F, cv::Scalar(1));
UMat src_umat = src.getUMat(cv::ACCESS_READ);
Mat _dst = Mat(src.rows, src.cols, src.type());
UMat dst_umat = _dst.getUMat(cv::ACCESS_RW);

ocl::KernelArg srcarg = ocl::KernelArg::ReadOnly(src_umat),
temparg = ocl::KernelArg::WriteOnlyNoSize(dst_umat);

kernel.args(srcarg, temparg); // << cause segfault

Error signature:

APPCRASH

module with error: amdocl64.dll

module with error version:	10.0.2766.5

exception code:	c0000005

exception offset:	00000000002f1619

os ver:	6.1.7601.2.1.0.256.48

lang code:	1049

additional info 1:	3dd5

additional info 2:	3dd52932c27223cd65366d12942569bf

additional info 3:	ec76

additional info 4:	ec76e410f94e0c815bd57985ba687292

Issue 2:
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.

Please set them or make sure they are set and tested correctly in the CMake files:

CUDA_CUDA_LIBRARY (ADVANCED)

linked by target "example_gpu_alpha_comp" in directory /home/shravankumar/apps/opencv-3.2.0/samples/gpu

linked by target "example_gpu_bgfg_segm" in directory /home/shravankumar/apps/opencv-3.2.0/samples/gpu

linked by target "example_gpu_cascadeclassifier" in directory /home/shravankumar/apps/opencv-3.2.0/samples/gpu

linked by target "example_gpu_cascadeclassifier_nvidia_api" in directory /home/shravankumar/apps/opencv-3.2.0/samples/gpu

linked by target "example_gpu_driver_api_multi" in directory /home/shravankumar/apps/opencv-3.2.0/samples/gpu

linked by target "example_gpu_driver_api_stereo_multi" in directory /home/shravankumar/apps/opencv-3.2.0/samples/gpu

linked by target "example_gpu_farneback_optical_flow" in directory /home/shravankumar/apps/opencv-3.2.0/samples/gpu

linked by target "example_gpu_generalized_hough" in directory /home/shravankumar/apps/opencv-3.2.0/samples/gpu

linked by target "example_gpu_hog" in directory /home/shravankumar/apps/opencv-3.2.0/samples/gpu

linked by target "example_gpu_houghlines" in directory /home/shravankumar/apps/opencv-3.2.0/samples/gpu

linked by target "example_gpu_morphology" in directory /home/shravankumar/apps/opencv-3.2.0/samples/gpu

linked by target "example_gpu_multi" in directory /home/shravankumar/apps/opencv-3.2.0/samples/gpu

linked by target "example_gpu_opengl" in directory /home/shravankumar/apps/opencv-3.2.0/samples/gpu

linked by target "example_gpu_optical_flow" in directory /home/shravankumar/apps/opencv-3.2.0/samples/gpu

linked by target "example_gpu_opticalflow_nvidia_api" in directory /home/shravankumar/apps/opencv-3.2.0/samples/gpu

linked by target "example_gpu_pyrlk_optical_flow" in directory /home/shravankumar/apps/opencv-3.2.0/samples/gpu

linked by target "example_gpu_stereo_match" in directory /home/shravankumar/apps/opencv-3.2.0/samples/gpu

linked by target "example_gpu_stereo_multi" in directory /home/shravankumar/apps/opencv-3.2.0/samples/gpu

linked by target "example_gpu_super_resolution" in directory /home/shravankumar/apps/opencv-3.2.0/samples/gpu

linked by target "example_gpu_surf_keypoint_matcher" in directory /home/shravankumar/apps/opencv-3.2.0/samples/gpu

linked by target "example_gpu_video_reader" in directory /home/shravankumar/apps/opencv-3.2.0/samples/gpu

linked by target "example_gpu_video_writer" in directory /home/shravankumar/apps/opencv-3.2.0/samples/gpu

-- Configuring incomplete, errors occurred!