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
da5b316b
Commit
da5b316b
authored
Feb 01, 2014
by
Ilya Lavrenov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor ocl.cpp refactoring
fix for cv::LUT and cv::transpose
parent
75dde49b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
19 additions
and
24 deletions
+19
-24
ocl.hpp
modules/core/include/opencv2/core/ocl.hpp
+12
-10
convert.cpp
modules/core/src/convert.cpp
+3
-0
matrix.cpp
modules/core/src/matrix.cpp
+3
-0
ocl.cpp
modules/core/src/ocl.cpp
+0
-0
ocl_test.cpp
modules/ts/src/ocl_test.cpp
+0
-7
optical_flow_farneback.cl
modules/video/src/opencl/optical_flow_farneback.cl
+1
-7
No files found.
modules/core/include/opencv2/core/ocl.hpp
View file @
da5b316b
...
...
@@ -90,7 +90,8 @@ public:
String
vendor
()
const
;
String
OpenCL_C_Version
()
const
;
String
OpenCLVersion
()
const
;
String
deviceVersion
()
const
;
int
deviceVersionMajor
()
const
;
int
deviceVersionMinor
()
const
;
String
driverVersion
()
const
;
void
*
ptr
()
const
;
...
...
@@ -224,16 +225,12 @@ public:
static
Context2
&
getDefault
(
bool
initialize
=
true
);
void
*
ptr
()
const
;
struct
Impl
;
inline
struct
Impl
*
_getImpl
()
const
{
return
p
;
}
friend
void
initializeContextFromHandle
(
Context2
&
ctx
,
void
*
platform
,
void
*
context
,
void
*
device
);
protected
:
struct
Impl
;
Impl
*
p
;
};
// TODO Move to internal header
void
initializeContextFromHandle
(
Context2
&
ctx
,
void
*
platform
,
void
*
context
,
void
*
device
);
class
CV_EXPORTS
Platform
{
public
:
...
...
@@ -245,12 +242,14 @@ public:
void
*
ptr
()
const
;
static
Platform
&
getDefault
();
struct
Impl
;
inline
struct
Impl
*
_getImpl
()
const
{
return
p
;
}
friend
void
initializeContextFromHandle
(
Context2
&
ctx
,
void
*
platform
,
void
*
context
,
void
*
device
);
protected
:
struct
Impl
;
Impl
*
p
;
};
// TODO Move to internal header
void
initializeContextFromHandle
(
Context2
&
ctx
,
void
*
platform
,
void
*
context
,
void
*
device
);
class
CV_EXPORTS
Queue
{
...
...
@@ -585,9 +584,12 @@ class CV_EXPORTS Image2D
{
public
:
Image2D
();
Image2D
(
const
UMat
&
src
);
explicit
Image2D
(
const
UMat
&
src
);
Image2D
(
const
Image2D
&
i
);
~
Image2D
();
Image2D
&
operator
=
(
const
Image2D
&
i
);
void
*
ptr
()
const
;
protected
:
struct
Impl
;
...
...
modules/core/src/convert.cpp
View file @
da5b316b
...
...
@@ -1505,6 +1505,9 @@ static bool ocl_LUT(InputArray _src, InputArray _lut, OutputArray _dst)
format
(
"-D dcn=%d -D lcn=%d -D srcT=%s -D dstT=%s%s"
,
dcn
,
lcn
,
ocl
::
typeToStr
(
src
.
depth
()),
ocl
::
typeToStr
(
ddepth
),
doubleSupport
?
" -D DOUBLE_SUPPORT"
:
""
));
if
(
k
.
empty
())
return
false
;
k
.
args
(
ocl
::
KernelArg
::
ReadOnlyNoSize
(
src
),
ocl
::
KernelArg
::
ReadOnlyNoSize
(
lut
),
ocl
::
KernelArg
::
WriteOnly
(
dst
));
...
...
modules/core/src/matrix.cpp
View file @
da5b316b
...
...
@@ -2909,6 +2909,9 @@ static bool ocl_transpose( InputArray _src, OutputArray _dst )
ocl
::
Kernel
k
(
kernelName
.
c_str
(),
ocl
::
core
::
transpose_oclsrc
,
format
(
"-D T=%s -D TILE_DIM=%d -D BLOCK_ROWS=%d"
,
ocl
::
memopTypeToStr
(
type
),
TILE_DIM
,
BLOCK_ROWS
));
if
(
k
.
empty
())
return
false
;
if
(
inplace
)
k
.
args
(
ocl
::
KernelArg
::
ReadWriteNoSize
(
dst
),
dst
.
rows
);
else
...
...
modules/core/src/ocl.cpp
View file @
da5b316b
This diff is collapsed.
Click to expand it.
modules/ts/src/ocl_test.cpp
View file @
da5b316b
...
...
@@ -160,17 +160,10 @@ void dumpOpenCLDevice()
DUMP_MESSAGE_STDOUT
(
" Max memory allocation size = "
<<
maxMemAllocSizeStr
);
DUMP_PROPERTY_XML
(
"cv_ocl_current_maxMemAllocSize"
,
device
.
maxMemAllocSize
());
#if 0
const char* doubleSupportStr = device.haveDoubleSupport() ? "Yes" : "No";
DUMP_MESSAGE_STDOUT(" Double support = "<< doubleSupportStr);
DUMP_PROPERTY_XML("cv_ocl_current_haveDoubleSupport", device.haveDoubleSupport());
#else
const
char
*
doubleSupportStr
=
device
.
doubleFPConfig
()
>
0
?
"Yes"
:
"No"
;
DUMP_MESSAGE_STDOUT
(
" Double support = "
<<
doubleSupportStr
);
DUMP_PROPERTY_XML
(
"cv_ocl_current_haveDoubleSupport"
,
device
.
doubleFPConfig
()
>
0
);
#endif
const
char
*
isUnifiedMemoryStr
=
device
.
hostUnifiedMemory
()
?
"Yes"
:
"No"
;
DUMP_MESSAGE_STDOUT
(
" Host unified memory = "
<<
isUnifiedMemoryStr
);
DUMP_PROPERTY_XML
(
"cv_ocl_current_hostUnifiedMemory"
,
device
.
hostUnifiedMemory
());
...
...
modules/video/src/opencl/optical_flow_farneback.cl
View file @
da5b316b
...
...
@@ -142,11 +142,6 @@ inline int idx_row_high(const int y, const int last_row)
return
abs
(
last_row
-
abs
(
last_row
-
y
))
%
(
last_row
+
1
)
;
}
inline
int
idx_row
(
const
int
y,
const
int
last_row
)
{
return
idx_row_low
(
idx_row_high
(
y,
last_row
)
,
last_row
)
;
}
inline
int
idx_col_low
(
const
int
x,
const
int
last_col
)
{
return
abs
(
x
)
%
(
last_col
+
1
)
;
...
...
@@ -431,4 +426,4 @@ __kernel void updateFlow(__global const float * M, int mStep,
flowx[mad24
(
y,
xStep,
x
)
]
=
(
g11*h2
-
g12*h1
)
*
detInv
;
flowy[mad24
(
y,
yStep,
x
)
]
=
(
g22*h1
-
g12*h2
)
*
detInv
;
}
}
\ No newline at end of file
}
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