Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
6d7a61cb
Commit
6d7a61cb
authored
Mar 04, 2015
by
Vladislav Vinogradov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reduce copy_make_border instantiates for tiny build
parent
b44b1ab4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
0 deletions
+20
-0
copy_make_border.cu
modules/gpu/src/cuda/copy_make_border.cu
+8
-0
imgproc.cpp
modules/gpu/src/imgproc.cpp
+12
-0
No files found.
modules/gpu/src/cuda/copy_make_border.cu
View file @
6d7a61cb
...
@@ -90,17 +90,24 @@ namespace cv { namespace gpu { namespace device
...
@@ -90,17 +90,24 @@ namespace cv { namespace gpu { namespace device
CopyMakeBorderDispatcher<BrdReplicate, vec_type>::call,
CopyMakeBorderDispatcher<BrdReplicate, vec_type>::call,
CopyMakeBorderDispatcher<BrdConstant, vec_type>::call,
CopyMakeBorderDispatcher<BrdConstant, vec_type>::call,
CopyMakeBorderDispatcher<BrdReflect, vec_type>::call,
CopyMakeBorderDispatcher<BrdReflect, vec_type>::call,
#ifdef OPENCV_TINY_GPU_MODULE
0,
#else
CopyMakeBorderDispatcher<BrdWrap, vec_type>::call
CopyMakeBorderDispatcher<BrdWrap, vec_type>::call
#endif
};
};
callers[borderMode](PtrStepSz<vec_type>(src), PtrStepSz<vec_type>(dst), top, left, borderValue, stream);
callers[borderMode](PtrStepSz<vec_type>(src), PtrStepSz<vec_type>(dst), top, left, borderValue, stream);
}
}
template void copyMakeBorder_gpu<uchar, 1>(const PtrStepSzb& src, const PtrStepSzb& dst, int top, int left, int borderMode, const uchar* borderValue, cudaStream_t stream);
template void copyMakeBorder_gpu<uchar, 1>(const PtrStepSzb& src, const PtrStepSzb& dst, int top, int left, int borderMode, const uchar* borderValue, cudaStream_t stream);
#ifndef OPENCV_TINY_GPU_MODULE
template void copyMakeBorder_gpu<uchar, 2>(const PtrStepSzb& src, const PtrStepSzb& dst, int top, int left, int borderMode, const uchar* borderValue, cudaStream_t stream);
template void copyMakeBorder_gpu<uchar, 2>(const PtrStepSzb& src, const PtrStepSzb& dst, int top, int left, int borderMode, const uchar* borderValue, cudaStream_t stream);
#endif
template void copyMakeBorder_gpu<uchar, 3>(const PtrStepSzb& src, const PtrStepSzb& dst, int top, int left, int borderMode, const uchar* borderValue, cudaStream_t stream);
template void copyMakeBorder_gpu<uchar, 3>(const PtrStepSzb& src, const PtrStepSzb& dst, int top, int left, int borderMode, const uchar* borderValue, cudaStream_t stream);
template void copyMakeBorder_gpu<uchar, 4>(const PtrStepSzb& src, const PtrStepSzb& dst, int top, int left, int borderMode, const uchar* borderValue, cudaStream_t stream);
template void copyMakeBorder_gpu<uchar, 4>(const PtrStepSzb& src, const PtrStepSzb& dst, int top, int left, int borderMode, const uchar* borderValue, cudaStream_t stream);
#ifndef OPENCV_TINY_GPU_MODULE
//template void copyMakeBorder_gpu<schar, 1>(const PtrStepSzb& src, const PtrStepSzb& dst, int top, int left, int borderMode, const schar* borderValue, cudaStream_t stream);
//template void copyMakeBorder_gpu<schar, 1>(const PtrStepSzb& src, const PtrStepSzb& dst, int top, int left, int borderMode, const schar* borderValue, cudaStream_t stream);
//template void copyMakeBorder_gpu<schar, 2>(const PtrStepSzb& src, const PtrStepSzb& dst, int top, int left, int borderMode, const schar* borderValue, cudaStream_t stream);
//template void copyMakeBorder_gpu<schar, 2>(const PtrStepSzb& src, const PtrStepSzb& dst, int top, int left, int borderMode, const schar* borderValue, cudaStream_t stream);
//template void copyMakeBorder_gpu<schar, 3>(const PtrStepSzb& src, const PtrStepSzb& dst, int top, int left, int borderMode, const schar* borderValue, cudaStream_t stream);
//template void copyMakeBorder_gpu<schar, 3>(const PtrStepSzb& src, const PtrStepSzb& dst, int top, int left, int borderMode, const schar* borderValue, cudaStream_t stream);
...
@@ -120,6 +127,7 @@ namespace cv { namespace gpu { namespace device
...
@@ -120,6 +127,7 @@ namespace cv { namespace gpu { namespace device
//template void copyMakeBorder_gpu<int, 2>(const PtrStepSzb& src, const PtrStepSzb& dst, int top, int left, int borderMode, const int* borderValue, cudaStream_t stream);
//template void copyMakeBorder_gpu<int, 2>(const PtrStepSzb& src, const PtrStepSzb& dst, int top, int left, int borderMode, const int* borderValue, cudaStream_t stream);
//template void copyMakeBorder_gpu<int, 3>(const PtrStepSzb& src, const PtrStepSzb& dst, int top, int left, int borderMode, const int* borderValue, cudaStream_t stream);
//template void copyMakeBorder_gpu<int, 3>(const PtrStepSzb& src, const PtrStepSzb& dst, int top, int left, int borderMode, const int* borderValue, cudaStream_t stream);
//template void copyMakeBorder_gpu<int, 4>(const PtrStepSzb& src, const PtrStepSzb& dst, int top, int left, int borderMode, const int* borderValue, cudaStream_t stream);
//template void copyMakeBorder_gpu<int, 4>(const PtrStepSzb& src, const PtrStepSzb& dst, int top, int left, int borderMode, const int* borderValue, cudaStream_t stream);
#endif
template void copyMakeBorder_gpu<float, 1>(const PtrStepSzb& src, const PtrStepSzb& dst, int top, int left, int borderMode, const float* borderValue, cudaStream_t stream);
template void copyMakeBorder_gpu<float, 1>(const PtrStepSzb& src, const PtrStepSzb& dst, int top, int left, int borderMode, const float* borderValue, cudaStream_t stream);
//template void copyMakeBorder_gpu<float, 2>(const PtrStepSzb& src, const PtrStepSzb& dst, int top, int left, int borderMode, const float* borderValue, cudaStream_t stream);
//template void copyMakeBorder_gpu<float, 2>(const PtrStepSzb& src, const PtrStepSzb& dst, int top, int left, int borderMode, const float* borderValue, cudaStream_t stream);
...
...
modules/gpu/src/imgproc.cpp
View file @
6d7a61cb
...
@@ -336,6 +336,17 @@ void cv::gpu::copyMakeBorder(const GpuMat& src, GpuMat& dst, int top, int bottom
...
@@ -336,6 +336,17 @@ void cv::gpu::copyMakeBorder(const GpuMat& src, GpuMat& dst, int top, int bottom
#endif
#endif
{
{
typedef
void
(
*
caller_t
)(
const
PtrStepSzb
&
src
,
const
PtrStepSzb
&
dst
,
int
top
,
int
left
,
int
borderType
,
const
Scalar
&
value
,
cudaStream_t
stream
);
typedef
void
(
*
caller_t
)(
const
PtrStepSzb
&
src
,
const
PtrStepSzb
&
dst
,
int
top
,
int
left
,
int
borderType
,
const
Scalar
&
value
,
cudaStream_t
stream
);
#ifdef OPENCV_TINY_GPU_MODULE
static
const
caller_t
callers
[
6
][
4
]
=
{
{
copyMakeBorder_caller
<
uchar
,
1
>
,
0
/*copyMakeBorder_caller<uchar, 2>*/
,
copyMakeBorder_caller
<
uchar
,
3
>
,
copyMakeBorder_caller
<
uchar
,
4
>
},
{
0
,
0
,
0
,
0
},
{
0
,
0
,
0
,
0
},
{
0
,
0
,
0
,
0
},
{
0
,
0
,
0
,
0
},
{
copyMakeBorder_caller
<
float
,
1
>
,
0
/*copyMakeBorder_caller<float, 2>*/
,
copyMakeBorder_caller
<
float
,
3
>
,
copyMakeBorder_caller
<
float
,
4
>
}
};
#else
static
const
caller_t
callers
[
6
][
4
]
=
static
const
caller_t
callers
[
6
][
4
]
=
{
{
{
copyMakeBorder_caller
<
uchar
,
1
>
,
copyMakeBorder_caller
<
uchar
,
2
>
,
copyMakeBorder_caller
<
uchar
,
3
>
,
copyMakeBorder_caller
<
uchar
,
4
>
},
{
copyMakeBorder_caller
<
uchar
,
1
>
,
copyMakeBorder_caller
<
uchar
,
2
>
,
copyMakeBorder_caller
<
uchar
,
3
>
,
copyMakeBorder_caller
<
uchar
,
4
>
},
...
@@ -345,6 +356,7 @@ void cv::gpu::copyMakeBorder(const GpuMat& src, GpuMat& dst, int top, int bottom
...
@@ -345,6 +356,7 @@ void cv::gpu::copyMakeBorder(const GpuMat& src, GpuMat& dst, int top, int bottom
{
0
/*copyMakeBorder_caller<int, 1>*/
,
0
/*copyMakeBorder_caller<int, 2>*/
,
0
/*copyMakeBorder_caller<int, 3>*/
,
0
/*copyMakeBorder_caller<int , 4>*/
},
{
0
/*copyMakeBorder_caller<int, 1>*/
,
0
/*copyMakeBorder_caller<int, 2>*/
,
0
/*copyMakeBorder_caller<int, 3>*/
,
0
/*copyMakeBorder_caller<int , 4>*/
},
{
copyMakeBorder_caller
<
float
,
1
>
,
0
/*copyMakeBorder_caller<float, 2>*/
,
copyMakeBorder_caller
<
float
,
3
>
,
copyMakeBorder_caller
<
float
,
4
>
}
{
copyMakeBorder_caller
<
float
,
1
>
,
0
/*copyMakeBorder_caller<float, 2>*/
,
copyMakeBorder_caller
<
float
,
3
>
,
copyMakeBorder_caller
<
float
,
4
>
}
};
};
#endif
caller_t
func
=
callers
[
src
.
depth
()][
src
.
channels
()
-
1
];
caller_t
func
=
callers
[
src
.
depth
()][
src
.
channels
()
-
1
];
CV_Assert
(
func
!=
0
);
CV_Assert
(
func
!=
0
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment