diff --git a/modules/gpu/src/cuda/element_operations.cu b/modules/gpu/src/cuda/element_operations.cu index f606f0c8c1..e277d829a1 100644 --- a/modules/gpu/src/cuda/element_operations.cu +++ b/modules/gpu/src/cuda/element_operations.cu @@ -2397,6 +2397,7 @@ namespace arithm } template void addWeighted(PtrStepSzb src1, double alpha, PtrStepSzb src2, double beta, double gamma, PtrStepSzb dst, cudaStream_t stream); +#ifndef OPENCV_TINY_GPU_MODULE template void addWeighted(PtrStepSzb src1, double alpha, PtrStepSzb src2, double beta, double gamma, PtrStepSzb dst, cudaStream_t stream); template void addWeighted(PtrStepSzb src1, double alpha, PtrStepSzb src2, double beta, double gamma, PtrStepSzb dst, cudaStream_t stream); template void addWeighted(PtrStepSzb src1, double alpha, PtrStepSzb src2, double beta, double gamma, PtrStepSzb dst, cudaStream_t stream); @@ -2451,9 +2452,10 @@ namespace arithm template void addWeighted(PtrStepSzb src1, double alpha, PtrStepSzb src2, double beta, double gamma, PtrStepSzb dst, cudaStream_t stream); template void addWeighted(PtrStepSzb src1, double alpha, PtrStepSzb src2, double beta, double gamma, PtrStepSzb dst, cudaStream_t stream); template void addWeighted(PtrStepSzb src1, double alpha, PtrStepSzb src2, double beta, double gamma, PtrStepSzb dst, cudaStream_t stream); +#endif - +#ifndef OPENCV_TINY_GPU_MODULE template void addWeighted(PtrStepSzb src1, double alpha, PtrStepSzb src2, double beta, double gamma, PtrStepSzb dst, cudaStream_t stream); template void addWeighted(PtrStepSzb src1, double alpha, PtrStepSzb src2, double beta, double gamma, PtrStepSzb dst, cudaStream_t stream); template void addWeighted(PtrStepSzb src1, double alpha, PtrStepSzb src2, double beta, double gamma, PtrStepSzb dst, cudaStream_t stream); @@ -2501,9 +2503,10 @@ namespace arithm template void addWeighted(PtrStepSzb src1, double alpha, PtrStepSzb src2, double beta, double gamma, PtrStepSzb dst, cudaStream_t stream); template void addWeighted(PtrStepSzb src1, double alpha, PtrStepSzb src2, double beta, double gamma, PtrStepSzb dst, cudaStream_t stream); template void addWeighted(PtrStepSzb src1, double alpha, PtrStepSzb src2, double beta, double gamma, PtrStepSzb dst, cudaStream_t stream); +#endif - +#ifndef OPENCV_TINY_GPU_MODULE template void addWeighted(PtrStepSzb src1, double alpha, PtrStepSzb src2, double beta, double gamma, PtrStepSzb dst, cudaStream_t stream); template void addWeighted(PtrStepSzb src1, double alpha, PtrStepSzb src2, double beta, double gamma, PtrStepSzb dst, cudaStream_t stream); template void addWeighted(PtrStepSzb src1, double alpha, PtrStepSzb src2, double beta, double gamma, PtrStepSzb dst, cudaStream_t stream); @@ -2543,9 +2546,10 @@ namespace arithm template void addWeighted(PtrStepSzb src1, double alpha, PtrStepSzb src2, double beta, double gamma, PtrStepSzb dst, cudaStream_t stream); template void addWeighted(PtrStepSzb src1, double alpha, PtrStepSzb src2, double beta, double gamma, PtrStepSzb dst, cudaStream_t stream); template void addWeighted(PtrStepSzb src1, double alpha, PtrStepSzb src2, double beta, double gamma, PtrStepSzb dst, cudaStream_t stream); +#endif - +#ifndef OPENCV_TINY_GPU_MODULE template void addWeighted(PtrStepSzb src1, double alpha, PtrStepSzb src2, double beta, double gamma, PtrStepSzb dst, cudaStream_t stream); template void addWeighted(PtrStepSzb src1, double alpha, PtrStepSzb src2, double beta, double gamma, PtrStepSzb dst, cudaStream_t stream); template void addWeighted(PtrStepSzb src1, double alpha, PtrStepSzb src2, double beta, double gamma, PtrStepSzb dst, cudaStream_t stream); @@ -2577,9 +2581,10 @@ namespace arithm template void addWeighted(PtrStepSzb src1, double alpha, PtrStepSzb src2, double beta, double gamma, PtrStepSzb dst, cudaStream_t stream); template void addWeighted(PtrStepSzb src1, double alpha, PtrStepSzb src2, double beta, double gamma, PtrStepSzb dst, cudaStream_t stream); template void addWeighted(PtrStepSzb src1, double alpha, PtrStepSzb src2, double beta, double gamma, PtrStepSzb dst, cudaStream_t stream); +#endif - +#ifndef OPENCV_TINY_GPU_MODULE template void addWeighted(PtrStepSzb src1, double alpha, PtrStepSzb src2, double beta, double gamma, PtrStepSzb dst, cudaStream_t stream); template void addWeighted(PtrStepSzb src1, double alpha, PtrStepSzb src2, double beta, double gamma, PtrStepSzb dst, cudaStream_t stream); template void addWeighted(PtrStepSzb src1, double alpha, PtrStepSzb src2, double beta, double gamma, PtrStepSzb dst, cudaStream_t stream); @@ -2603,15 +2608,18 @@ namespace arithm template void addWeighted(PtrStepSzb src1, double alpha, PtrStepSzb src2, double beta, double gamma, PtrStepSzb dst, cudaStream_t stream); template void addWeighted(PtrStepSzb src1, double alpha, PtrStepSzb src2, double beta, double gamma, PtrStepSzb dst, cudaStream_t stream); template void addWeighted(PtrStepSzb src1, double alpha, PtrStepSzb src2, double beta, double gamma, PtrStepSzb dst, cudaStream_t stream); +#endif - +#ifndef OPENCV_TINY_GPU_MODULE template void addWeighted(PtrStepSzb src1, double alpha, PtrStepSzb src2, double beta, double gamma, PtrStepSzb dst, cudaStream_t stream); template void addWeighted(PtrStepSzb src1, double alpha, PtrStepSzb src2, double beta, double gamma, PtrStepSzb dst, cudaStream_t stream); template void addWeighted(PtrStepSzb src1, double alpha, PtrStepSzb src2, double beta, double gamma, PtrStepSzb dst, cudaStream_t stream); template void addWeighted(PtrStepSzb src1, double alpha, PtrStepSzb src2, double beta, double gamma, PtrStepSzb dst, cudaStream_t stream); template void addWeighted(PtrStepSzb src1, double alpha, PtrStepSzb src2, double beta, double gamma, PtrStepSzb dst, cudaStream_t stream); +#endif template void addWeighted(PtrStepSzb src1, double alpha, PtrStepSzb src2, double beta, double gamma, PtrStepSzb dst, cudaStream_t stream); +#ifndef OPENCV_TINY_GPU_MODULE template void addWeighted(PtrStepSzb src1, double alpha, PtrStepSzb src2, double beta, double gamma, PtrStepSzb dst, cudaStream_t stream); template void addWeighted(PtrStepSzb src1, double alpha, PtrStepSzb src2, double beta, double gamma, PtrStepSzb dst, cudaStream_t stream); @@ -2621,9 +2629,11 @@ namespace arithm template void addWeighted(PtrStepSzb src1, double alpha, PtrStepSzb src2, double beta, double gamma, PtrStepSzb dst, cudaStream_t stream); template void addWeighted(PtrStepSzb src1, double alpha, PtrStepSzb src2, double beta, double gamma, PtrStepSzb dst, cudaStream_t stream); template void addWeighted(PtrStepSzb src1, double alpha, PtrStepSzb src2, double beta, double gamma, PtrStepSzb dst, cudaStream_t stream); +#endif +#ifndef OPENCV_TINY_GPU_MODULE template void addWeighted(PtrStepSzb src1, double alpha, PtrStepSzb src2, double beta, double gamma, PtrStepSzb dst, cudaStream_t stream); template void addWeighted(PtrStepSzb src1, double alpha, PtrStepSzb src2, double beta, double gamma, PtrStepSzb dst, cudaStream_t stream); template void addWeighted(PtrStepSzb src1, double alpha, PtrStepSzb src2, double beta, double gamma, PtrStepSzb dst, cudaStream_t stream); @@ -2631,6 +2641,7 @@ namespace arithm template void addWeighted(PtrStepSzb src1, double alpha, PtrStepSzb src2, double beta, double gamma, PtrStepSzb dst, cudaStream_t stream); template void addWeighted(PtrStepSzb src1, double alpha, PtrStepSzb src2, double beta, double gamma, PtrStepSzb dst, cudaStream_t stream); template void addWeighted(PtrStepSzb src1, double alpha, PtrStepSzb src2, double beta, double gamma, PtrStepSzb dst, cudaStream_t stream); +#endif } #endif /* CUDA_DISABLER */ diff --git a/modules/gpu/src/element_operations.cpp b/modules/gpu/src/element_operations.cpp index 354d614d42..fa98520ff8 100644 --- a/modules/gpu/src/element_operations.cpp +++ b/modules/gpu/src/element_operations.cpp @@ -3007,6 +3007,466 @@ namespace arithm void cv::gpu::addWeighted(const GpuMat& src1, double alpha, const GpuMat& src2, double beta, double gamma, GpuMat& dst, int ddepth, Stream& stream) { typedef void (*func_t)(PtrStepSzb src1, double alpha, PtrStepSzb src2, double beta, double gamma, PtrStepSzb dst, cudaStream_t stream); +#ifdef OPENCV_TINY_GPU_MODULE + static const func_t funcs[7][7][7] = + { + { + { + arithm::addWeighted, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/ + }, + { + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + }, + { + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + }, + { + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + }, + { + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + }, + { + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + }, + { + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + } + }, + { + { + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + }, + { + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + }, + { + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + }, + { + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + }, + { + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + }, + { + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + }, + { + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + } + }, + { + { + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + }, + { + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + }, + { + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + }, + { + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + }, + { + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + }, + { + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + }, + { + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + } + }, + { + { + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + }, + { + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + }, + { + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + }, + { + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + }, + { + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + }, + { + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + }, + { + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + } + }, + { + { + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + }, + { + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + }, + { + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + }, + { + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + }, + { + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + }, + { + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + }, + { + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + } + }, + { + { + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + }, + { + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + }, + { + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + }, + { + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + }, + { + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + }, + { + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + arithm::addWeighted, + 0/*arithm::addWeighted*/, + }, + { + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + } + }, + { + { + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + }, + { + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + }, + { + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + }, + { + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + }, + { + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + }, + { + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + }, + { + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + 0/*arithm::addWeighted*/, + } + } + }; +#else static const func_t funcs[7][7][7] = { { @@ -3465,6 +3925,7 @@ void cv::gpu::addWeighted(const GpuMat& src1, double alpha, const GpuMat& src2, } } }; +#endif int sdepth1 = src1.depth(); int sdepth2 = src2.depth();