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
713ddb89
Commit
713ddb89
authored
Aug 12, 2014
by
Alexander Karsakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set minimum matrix size for AmdBlas::gemm to 20 since it works incorrect for small sizes
parent
b4d3b34a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
matmul.cpp
modules/core/src/matmul.cpp
+3
-2
test_gemm.cpp
modules/core/test/ocl/test_gemm.cpp
+3
-2
No files found.
modules/core/src/matmul.cpp
View file @
713ddb89
...
...
@@ -781,8 +781,9 @@ void cv::gemm( InputArray matA, InputArray matB, double alpha,
InputArray
matC
,
double
beta
,
OutputArray
_matD
,
int
flags
)
{
#ifdef HAVE_CLAMDBLAS
CV_OCL_RUN
(
ocl
::
haveAmdBlas
()
&&
matA
.
dims
()
<=
2
&&
matB
.
dims
()
<=
2
&&
matC
.
dims
()
<=
2
&&
_matD
.
isUMat
(),
ocl_gemm
(
matA
,
matB
,
alpha
,
matC
,
beta
,
_matD
,
flags
))
CV_OCL_RUN
(
ocl
::
haveAmdBlas
()
&&
matA
.
dims
()
<=
2
&&
matB
.
dims
()
<=
2
&&
matC
.
dims
()
<=
2
&&
_matD
.
isUMat
()
&&
matA
.
cols
()
>
20
&&
matA
.
rows
()
>
20
&&
matB
.
cols
()
>
20
,
// since it works incorrect for small sizes
ocl_gemm
(
matA
,
matB
,
alpha
,
matC
,
beta
,
_matD
,
flags
))
#endif
const
int
block_lin_size
=
128
;
...
...
modules/core/test/ocl/test_gemm.cpp
View file @
713ddb89
...
...
@@ -90,14 +90,15 @@ PARAM_TEST_CASE(Gemm,
void
generateTestData
()
{
Size
ARoiSize
=
randomSize
(
1
,
MAX_VALUE
);
// set minimum size to 20, since testing less sizes doesn't make sense
Size
ARoiSize
=
randomSize
(
20
,
MAX_VALUE
);
Border
ABorder
=
randomBorder
(
0
,
use_roi
?
MAX_VALUE
:
0
);
randomSubMat
(
A
,
A_roi
,
ARoiSize
,
ABorder
,
type
,
-
11
,
11
);
if
(
atrans
)
ARoiSize
=
Size
(
ARoiSize
.
height
,
ARoiSize
.
width
);
Size
BRoiSize
=
randomSize
(
1
,
MAX_VALUE
);
Size
BRoiSize
=
randomSize
(
20
,
MAX_VALUE
);
if
(
btrans
)
BRoiSize
.
width
=
ARoiSize
.
width
;
else
...
...
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