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
7bf29e14
Commit
7bf29e14
authored
Jul 22, 2010
by
Andrey Morozov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
optimized gpumat::setTo(), ~ 30 speedup
parent
8bb987e4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
5 deletions
+7
-5
cuda_shared.hpp
modules/gpu/src/cuda/cuda_shared.hpp
+0
-1
matrix_operations.cu
modules/gpu/src/cuda/matrix_operations.cu
+0
-0
operator_set_to.cpp
tests/gpu/src/operator_set_to.cpp
+7
-4
No files found.
modules/gpu/src/cuda/cuda_shared.hpp
View file @
7bf29e14
...
@@ -59,7 +59,6 @@ namespace cv
...
@@ -59,7 +59,6 @@ namespace cv
namespace
impl
namespace
impl
{
{
static
inline
int
divUp
(
int
a
,
int
b
)
{
return
(
a
%
b
==
0
)
?
a
/
b
:
a
/
b
+
1
;
}
static
inline
int
divUp
(
int
a
,
int
b
)
{
return
(
a
%
b
==
0
)
?
a
/
b
:
a
/
b
+
1
;
}
extern
"C"
void
set_to_without_mask
(
const
DevMem2D
&
mat
,
const
double
*
scalar
,
int
depth
,
int
channels
);
extern
"C"
void
set_to_without_mask
(
const
DevMem2D
&
mat
,
const
double
*
scalar
,
int
depth
,
int
channels
);
extern
"C"
void
set_to_with_mask
(
const
DevMem2D
&
mat
,
const
double
*
scalar
,
const
DevMem2D
&
mask
,
int
depth
,
int
channels
);
extern
"C"
void
set_to_with_mask
(
const
DevMem2D
&
mat
,
const
double
*
scalar
,
const
DevMem2D
&
mask
,
int
depth
,
int
channels
);
...
...
modules/gpu/src/cuda/matrix_operations.cu
View file @
7bf29e14
This diff is collapsed.
Click to expand it.
tests/gpu/src/operator_set_to.cpp
View file @
7bf29e14
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
#include <iterator>
#include <iterator>
#include <limits>
#include <limits>
#include <numeric>
#include <numeric>
#include <iomanip> // for cout << setw()
using
namespace
cv
;
using
namespace
cv
;
using
namespace
std
;
using
namespace
std
;
...
@@ -35,6 +36,7 @@ class CV_GpuMatOpSetTo : public CvTest
...
@@ -35,6 +36,7 @@ class CV_GpuMatOpSetTo : public CvTest
bool
test_cv_32f_c3
();
bool
test_cv_32f_c3
();
bool
test_cv_32f_c4
();
bool
test_cv_32f_c4
();
private
:
private
:
int
rows
;
int
rows
;
int
cols
;
int
cols
;
...
@@ -43,8 +45,8 @@ class CV_GpuMatOpSetTo : public CvTest
...
@@ -43,8 +45,8 @@ class CV_GpuMatOpSetTo : public CvTest
CV_GpuMatOpSetTo
::
CV_GpuMatOpSetTo
()
:
CvTest
(
"GpuMatOperatorSetTo"
,
"setTo"
)
CV_GpuMatOpSetTo
::
CV_GpuMatOpSetTo
()
:
CvTest
(
"GpuMatOperatorSetTo"
,
"setTo"
)
{
{
rows
=
12
7
;
rows
=
12
9
;
cols
=
12
9
;
cols
=
12
7
;
s
.
val
[
0
]
=
128.0
;
s
.
val
[
0
]
=
128.0
;
s
.
val
[
1
]
=
128.0
;
s
.
val
[
1
]
=
128.0
;
...
@@ -75,8 +77,9 @@ bool CV_GpuMatOpSetTo::compare_matrix(cv::Mat & cpumat, gpu::GpuMat & gpumat)
...
@@ -75,8 +77,9 @@ bool CV_GpuMatOpSetTo::compare_matrix(cv::Mat & cpumat, gpu::GpuMat & gpumat)
//int64 time1 = getTickCount();
//int64 time1 = getTickCount();
gpumat
.
setTo
(
s
);
gpumat
.
setTo
(
s
);
//int64 time2 = getTickCount();
//int64 time2 = getTickCount();
//std::cout << "\ntime cpu:" << double((time1 - time) / getTickFrequency());
//std::cout << "\ntime gpu:" << double((time2 - time1) / getTickFrequency());
//std::cout << "\ntime cpu: " << std::fixed << std::setprecision(12) << double((time1 - time) / (double)getTickFrequency());
//std::cout << "\ntime gpu: " << std::fixed << std::setprecision(12) << double((time2 - time1) / (double)getTickFrequency());
//std::cout << "\n";
//std::cout << "\n";
#ifdef PRINT_MATRIX
#ifdef PRINT_MATRIX
...
...
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