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
6d253a20
Commit
6d253a20
authored
Aug 26, 2014
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2921 from ilya-lavrenov:tapi_memop
parents
b1d01dc7
2f46cf5d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
7 deletions
+12
-7
copy.cpp
modules/core/src/copy.cpp
+8
-3
ocl.cpp
modules/core/src/ocl.cpp
+4
-4
No files found.
modules/core/src/copy.cpp
View file @
6d253a20
...
...
@@ -615,9 +615,15 @@ enum { FLIP_COLS = 1 << 0, FLIP_ROWS = 1 << 1, FLIP_BOTH = FLIP_ROWS | FLIP_COLS
static
bool
ocl_flip
(
InputArray
_src
,
OutputArray
_dst
,
int
flipCode
)
{
CV_Assert
(
flipCode
>=
-
1
&&
flipCode
<=
1
);
const
ocl
::
Device
&
dev
=
ocl
::
Device
::
getDefault
();
int
type
=
_src
.
type
(),
depth
=
CV_MAT_DEPTH
(
type
),
cn
=
CV_MAT_CN
(
type
),
flipType
,
kercn
=
std
::
min
(
ocl
::
predictOptimalVectorWidth
(
_src
,
_dst
),
4
);
bool
doubleSupport
=
dev
.
doubleFPConfig
()
>
0
;
if
(
!
doubleSupport
&&
depth
==
CV_64F
)
kercn
=
cn
;
if
(
cn
>
4
)
return
false
;
...
...
@@ -629,14 +635,13 @@ static bool ocl_flip(InputArray _src, OutputArray _dst, int flipCode )
else
kernelName
=
"arithm_flip_rows_cols"
,
flipType
=
FLIP_BOTH
;
ocl
::
Device
dev
=
ocl
::
Device
::
getDefault
();
int
pxPerWIy
=
(
dev
.
isIntel
()
&&
(
dev
.
type
()
&
ocl
::
Device
::
TYPE_GPU
))
?
4
:
1
;
kercn
=
(
cn
!=
3
||
flipType
==
FLIP_ROWS
)
?
std
::
max
(
kercn
,
cn
)
:
cn
;
ocl
::
Kernel
k
(
kernelName
,
ocl
::
core
::
flip_oclsrc
,
format
(
"-D T=%s -D T1=%s -D cn=%d -D PIX_PER_WI_Y=%d -D kercn=%d"
,
ocl
::
memopTypeToStr
(
CV_MAKE_TYPE
(
depth
,
kercn
)),
ocl
::
memopTypeToStr
(
depth
),
cn
,
pxPerWIy
,
kercn
));
kercn
!=
cn
?
ocl
::
typeToStr
(
CV_MAKE_TYPE
(
depth
,
kercn
))
:
ocl
::
memopTypeToStr
(
CV_MAKE_TYPE
(
depth
,
kercn
)),
kercn
!=
cn
?
ocl
::
typeToStr
(
depth
)
:
ocl
::
memopTypeToStr
(
depth
),
cn
,
pxPerWIy
,
kercn
));
if
(
k
.
empty
())
return
false
;
...
...
modules/core/src/ocl.cpp
View file @
6d253a20
...
...
@@ -4360,10 +4360,10 @@ const char* memopTypeToStr(int type)
{
static
const
char
*
tab
[]
=
{
"uchar"
,
"
uchar2"
,
"uchar3"
,
"uchar4"
,
0
,
0
,
0
,
"uchar8"
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
"uchar16
"
,
"char"
,
"
char2"
,
"char3"
,
"char4"
,
0
,
0
,
0
,
"char8"
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
"char16
"
,
"ushort"
,
"
ushort2"
,
"ushort3"
,
"ushort4"
,
0
,
0
,
0
,
"ushort8"
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
"ushort16
"
,
"short"
,
"
short2"
,
"short3"
,
"short4"
,
0
,
0
,
0
,
"short8"
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
"short16
"
,
"uchar"
,
"
short"
,
"uchar3"
,
"int"
,
0
,
0
,
0
,
"int2"
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
"int4
"
,
"char"
,
"
short"
,
"char3"
,
"int"
,
0
,
0
,
0
,
"int2"
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
"int4
"
,
"ushort"
,
"
int"
,
"ushort3"
,
"int2"
,
0
,
0
,
0
,
"int4"
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
"int8
"
,
"short"
,
"
int"
,
"short3"
,
"int2"
,
0
,
0
,
0
,
"int4"
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
"int8
"
,
"int"
,
"int2"
,
"int3"
,
"int4"
,
0
,
0
,
0
,
"int8"
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
"int16"
,
"int"
,
"int2"
,
"int3"
,
"int4"
,
0
,
0
,
0
,
"int8"
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
"int16"
,
"ulong"
,
"ulong2"
,
"ulong3"
,
"ulong4"
,
0
,
0
,
0
,
"ulong8"
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
"ulong16"
,
...
...
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