From 2e47a1a61be525a408629f0f19b490083773c0b4 Mon Sep 17 00:00:00 2001 From: Vladislav Vinogradov Date: Wed, 4 Mar 2015 16:27:20 +0300 Subject: [PATCH] reduce pyramids instantiates for tiny build --- modules/gpu/src/cuda/pyr_down.cu | 2 ++ modules/gpu/src/cuda/pyr_up.cu | 2 ++ modules/gpu/src/pyramids.cpp | 24 ++++++++++++++++++++++++ 3 files changed, 28 insertions(+) diff --git a/modules/gpu/src/cuda/pyr_down.cu b/modules/gpu/src/cuda/pyr_down.cu index eac7928..af0e18d 100644 --- a/modules/gpu/src/cuda/pyr_down.cu +++ b/modules/gpu/src/cuda/pyr_down.cu @@ -197,6 +197,7 @@ namespace cv { namespace gpu { namespace device template void pyrDown_gpu(PtrStepSzb src, PtrStepSzb dst, cudaStream_t stream); template void pyrDown_gpu(PtrStepSzb src, PtrStepSzb dst, cudaStream_t stream); +#ifndef OPENCV_TINY_GPU_MODULE //template void pyrDown_gpu(PtrStepSzb src, PtrStepSzb dst, cudaStream_t stream); //template void pyrDown_gpu(PtrStepSzb src, PtrStepSzb dst, cudaStream_t stream); //template void pyrDown_gpu(PtrStepSzb src, PtrStepSzb dst, cudaStream_t stream); @@ -216,6 +217,7 @@ namespace cv { namespace gpu { namespace device //template void pyrDown_gpu(PtrStepSzb src, PtrStepSzb dst, cudaStream_t stream); //template void pyrDown_gpu(PtrStepSzb src, PtrStepSzb dst, cudaStream_t stream); //template void pyrDown_gpu(PtrStepSzb src, PtrStepSzb dst, cudaStream_t stream); +#endif template void pyrDown_gpu(PtrStepSzb src, PtrStepSzb dst, cudaStream_t stream); //template void pyrDown_gpu(PtrStepSzb src, PtrStepSzb dst, cudaStream_t stream); diff --git a/modules/gpu/src/cuda/pyr_up.cu b/modules/gpu/src/cuda/pyr_up.cu index b14d124..ffb6276 100644 --- a/modules/gpu/src/cuda/pyr_up.cu +++ b/modules/gpu/src/cuda/pyr_up.cu @@ -166,6 +166,7 @@ namespace cv { namespace gpu { namespace device template void pyrUp_gpu(PtrStepSzb src, PtrStepSzb dst, cudaStream_t stream); template void pyrUp_gpu(PtrStepSzb src, PtrStepSzb dst, cudaStream_t stream); +#ifndef OPENCV_TINY_GPU_MODULE //template void pyrUp_gpu(PtrStepSzb src, PtrStepSzb dst, cudaStream_t stream); //template void pyrUp_gpu(PtrStepSzb src, PtrStepSzb dst, cudaStream_t stream); //template void pyrUp_gpu(PtrStepSzb src, PtrStepSzb dst, cudaStream_t stream); @@ -185,6 +186,7 @@ namespace cv { namespace gpu { namespace device //template void pyrUp_gpu(PtrStepSzb src, PtrStepSzb dst, cudaStream_t stream); //template void pyrUp_gpu(PtrStepSzb src, PtrStepSzb dst, cudaStream_t stream); //template void pyrUp_gpu(PtrStepSzb src, PtrStepSzb dst, cudaStream_t stream); +#endif template void pyrUp_gpu(PtrStepSzb src, PtrStepSzb dst, cudaStream_t stream); //template void pyrUp_gpu(PtrStepSzb src, PtrStepSzb dst, cudaStream_t stream); diff --git a/modules/gpu/src/pyramids.cpp b/modules/gpu/src/pyramids.cpp index 85fb990..b4d4676 100644 --- a/modules/gpu/src/pyramids.cpp +++ b/modules/gpu/src/pyramids.cpp @@ -68,6 +68,17 @@ void cv::gpu::pyrDown(const GpuMat& src, GpuMat& dst, Stream& stream) typedef void (*func_t)(PtrStepSzb src, PtrStepSzb dst, cudaStream_t stream); +#ifdef OPENCV_TINY_GPU_MODULE + static const func_t funcs[6][4] = + { + {pyrDown_gpu , 0 /*pyrDown_gpu*/ , pyrDown_gpu , pyrDown_gpu }, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {pyrDown_gpu , 0 /*pyrDown_gpu*/ , pyrDown_gpu , pyrDown_gpu } + }; +#else static const func_t funcs[6][4] = { {pyrDown_gpu , 0 /*pyrDown_gpu*/ , pyrDown_gpu , pyrDown_gpu }, @@ -77,6 +88,7 @@ void cv::gpu::pyrDown(const GpuMat& src, GpuMat& dst, Stream& stream) {0 /*pyrDown_gpu*/ , 0 /*pyrDown_gpu*/ , 0 /*pyrDown_gpu*/ , 0 /*pyrDown_gpu*/ }, {pyrDown_gpu , 0 /*pyrDown_gpu*/ , pyrDown_gpu , pyrDown_gpu } }; +#endif CV_Assert(src.depth() <= CV_32F && src.channels() <= 4); @@ -106,6 +118,17 @@ void cv::gpu::pyrUp(const GpuMat& src, GpuMat& dst, Stream& stream) typedef void (*func_t)(PtrStepSzb src, PtrStepSzb dst, cudaStream_t stream); +#ifdef OPENCV_TINY_GPU_MODULE + static const func_t funcs[6][4] = + { + {pyrUp_gpu , 0 /*pyrUp_gpu*/ , pyrUp_gpu , pyrUp_gpu }, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {pyrUp_gpu , 0 /*pyrUp_gpu*/ , pyrUp_gpu , pyrUp_gpu } + }; +#else static const func_t funcs[6][4] = { {pyrUp_gpu , 0 /*pyrUp_gpu*/ , pyrUp_gpu , pyrUp_gpu }, @@ -115,6 +138,7 @@ void cv::gpu::pyrUp(const GpuMat& src, GpuMat& dst, Stream& stream) {0 /*pyrUp_gpu*/ , 0 /*pyrUp_gpu*/ , 0 /*pyrUp_gpu*/ , 0 /*pyrUp_gpu*/ }, {pyrUp_gpu , 0 /*pyrUp_gpu*/ , pyrUp_gpu , pyrUp_gpu } }; +#endif CV_Assert(src.depth() <= CV_32F && src.channels() <= 4); -- 2.7.4