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
948661d7
Commit
948661d7
authored
Apr 26, 2013
by
Vladislav Vinogradov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
switched to Input/Output Array in gpu::gemm
parent
8fcef225
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
19 deletions
+23
-19
gpuarithm.hpp
modules/gpuarithm/include/opencv2/gpuarithm.hpp
+2
-3
arithm.cpp
modules/gpuarithm/src/arithm.cpp
+21
-16
No files found.
modules/gpuarithm/include/opencv2/gpuarithm.hpp
View file @
948661d7
...
...
@@ -350,9 +350,8 @@ static inline void sqrIntegral(InputArray src, OutputArray sqsum, Stream& stream
sqrIntegral
(
src
,
sqsum
,
buffer
,
stream
);
}
//! implements generalized matrix product algorithm GEMM from BLAS
CV_EXPORTS
void
gemm
(
const
GpuMat
&
src1
,
const
GpuMat
&
src2
,
double
alpha
,
const
GpuMat
&
src3
,
double
beta
,
GpuMat
&
dst
,
int
flags
=
0
,
Stream
&
stream
=
Stream
::
Null
());
CV_EXPORTS
void
gemm
(
InputArray
src1
,
InputArray
src2
,
double
alpha
,
InputArray
src3
,
double
beta
,
OutputArray
dst
,
int
flags
=
0
,
Stream
&
stream
=
Stream
::
Null
());
//! performs per-element multiplication of two full (not packed) Fourier spectrums
//! supports 32FC2 matrixes only (interleaved format)
...
...
modules/gpuarithm/src/arithm.cpp
View file @
948661d7
...
...
@@ -47,7 +47,7 @@ using namespace cv::gpu;
#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER)
void
cv
::
gpu
::
gemm
(
const
GpuMat
&
,
const
GpuMat
&
,
double
,
const
GpuMat
&
,
double
,
GpuMat
&
,
int
,
Stream
&
)
{
throw_no_cuda
();
}
void
cv
::
gpu
::
gemm
(
InputArray
,
InputArray
,
double
,
InputArray
,
double
,
OutputArray
,
int
,
Stream
&
)
{
throw_no_cuda
();
}
void
cv
::
gpu
::
mulSpectrums
(
const
GpuMat
&
,
const
GpuMat
&
,
GpuMat
&
,
int
,
bool
,
Stream
&
)
{
throw_no_cuda
();
}
void
cv
::
gpu
::
mulAndScaleSpectrums
(
const
GpuMat
&
,
const
GpuMat
&
,
GpuMat
&
,
int
,
float
,
bool
,
Stream
&
)
{
throw_no_cuda
();
}
...
...
@@ -164,23 +164,27 @@ namespace
////////////////////////////////////////////////////////////////////////
// gemm
void
cv
::
gpu
::
gemm
(
const
GpuMat
&
src1
,
const
GpuMat
&
src2
,
double
alpha
,
const
GpuMat
&
src3
,
double
beta
,
GpuMat
&
dst
,
int
flags
,
Stream
&
stream
)
void
cv
::
gpu
::
gemm
(
InputArray
_src1
,
InputArray
_src2
,
double
alpha
,
InputArray
_src3
,
double
beta
,
OutputArray
_
dst
,
int
flags
,
Stream
&
stream
)
{
#ifndef HAVE_CUBLAS
(
void
)
src1
;
(
void
)
src2
;
(
void
)
alpha
;
(
void
)
src3
;
(
void
)
beta
;
(
void
)
dst
;
(
void
)
flags
;
(
void
)
stream
;
CV_Error
(
cv
:
:
Error
::
StsNotImplemented
,
"The library was build without CUBLAS"
);
(
void
)
_
src1
;
(
void
)
_
src2
;
(
void
)
alpha
;
(
void
)
_
src3
;
(
void
)
beta
;
(
void
)
_
dst
;
(
void
)
flags
;
(
void
)
stream
;
CV_Error
(
:
Error
::
StsNotImplemented
,
"The library was build without CUBLAS"
);
#else
// CUBLAS works with column-major matrices
CV_Assert
(
src1
.
type
()
==
CV_32FC1
||
src1
.
type
()
==
CV_32FC2
||
src1
.
type
()
==
CV_64FC1
||
src1
.
type
()
==
CV_64FC2
);
CV_Assert
(
src2
.
type
()
==
src1
.
type
()
&&
(
src3
.
empty
()
||
src3
.
type
()
==
src1
.
type
()));
GpuMat
src1
=
_src1
.
getGpuMat
();
GpuMat
src2
=
_src2
.
getGpuMat
();
GpuMat
src3
=
_src3
.
getGpuMat
();
CV_Assert
(
src1
.
type
()
==
CV_32FC1
||
src1
.
type
()
==
CV_32FC2
||
src1
.
type
()
==
CV_64FC1
||
src1
.
type
()
==
CV_64FC2
);
CV_Assert
(
src2
.
type
()
==
src1
.
type
()
&&
(
src3
.
empty
()
||
src3
.
type
()
==
src1
.
type
())
);
if
(
src1
.
depth
()
==
CV_64F
)
{
...
...
@@ -203,10 +207,11 @@ void cv::gpu::gemm(const GpuMat& src1, const GpuMat& src2, double alpha, const G
Size
src3Size
=
tr3
?
Size
(
src3
.
rows
,
src3
.
cols
)
:
src3
.
size
();
Size
dstSize
(
src2Size
.
width
,
src1Size
.
height
);
CV_Assert
(
src1Size
.
width
==
src2Size
.
height
);
CV_Assert
(
src3
.
empty
()
||
src3Size
==
dstSize
);
CV_Assert
(
src1Size
.
width
==
src2Size
.
height
);
CV_Assert
(
src3
.
empty
()
||
src3Size
==
dstSize
);
dst
.
create
(
dstSize
,
src1
.
type
());
_dst
.
create
(
dstSize
,
src1
.
type
());
GpuMat
dst
=
_dst
.
getGpuMat
();
if
(
beta
!=
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