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
7f0680fc
Commit
7f0680fc
authored
Oct 03, 2013
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ocl: workaround for OpenCL C++ bindings usage: CL/cl.hpp
parent
8beb514e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
54 additions
and
0 deletions
+54
-0
cl_runtime_opencl11_wrappers.hpp
...e/opencv2/ocl/cl_runtime/cl_runtime_opencl11_wrappers.hpp
+0
-0
cl_runtime_opencl12_wrappers.hpp
...e/opencv2/ocl/cl_runtime/cl_runtime_opencl12_wrappers.hpp
+0
-0
cl_context.cpp
modules/ocl/src/cl_context.cpp
+9
-0
cl_programcache.cpp
modules/ocl/src/cl_programcache.cpp
+9
-0
common.py
modules/ocl/src/cl_runtime/generator/common.py
+23
-0
parser_cl.py
modules/ocl/src/cl_runtime/generator/parser_cl.py
+6
-0
cl_runtime_opencl_wrappers.hpp.in
...time/generator/template/cl_runtime_opencl_wrappers.hpp.in
+7
-0
No files found.
modules/ocl/include/opencv2/ocl/cl_runtime/cl_runtime_opencl11_wrappers.hpp
0 → 100644
View file @
7f0680fc
This diff is collapsed.
Click to expand it.
modules/ocl/include/opencv2/ocl/cl_runtime/cl_runtime_opencl12_wrappers.hpp
0 → 100644
View file @
7f0680fc
This diff is collapsed.
Click to expand it.
modules/ocl/src/cl_context.cpp
View file @
7f0680fc
...
...
@@ -50,6 +50,15 @@
#include <fstream>
#include "cl_programcache.hpp"
// workaround for OpenCL C++ bindings
#if defined(HAVE_OPENCL12)
#include "opencv2/ocl/cl_runtime/cl_runtime_opencl12_wrappers.hpp"
#elif defined(HAVE_OPENCL11)
#include "opencv2/ocl/cl_runtime/cl_runtime_opencl11_wrappers.hpp"
#else
#error Invalid OpenCL configuration
#endif
#if defined _MSC_VER && _MSC_VER >= 1200
#pragma warning( disable: 4100 4101 4127 4244 4267 4510 4512 4610)
#endif
...
...
modules/ocl/src/cl_programcache.cpp
View file @
7f0680fc
...
...
@@ -50,6 +50,15 @@
#include <fstream>
#include "cl_programcache.hpp"
// workaround for OpenCL C++ bindings
#if defined(HAVE_OPENCL12)
#include "opencv2/ocl/cl_runtime/cl_runtime_opencl12_wrappers.hpp"
#elif defined(HAVE_OPENCL11)
#include "opencv2/ocl/cl_runtime/cl_runtime_opencl11_wrappers.hpp"
#else
#error Invalid OpenCL configuration
#endif
#if defined _MSC_VER && _MSC_VER >= 1200
# pragma warning( disable: 4100 4244 4267 4510 4512 4610)
#endif
...
...
modules/ocl/src/cl_runtime/generator/common.py
View file @
7f0680fc
...
...
@@ -182,6 +182,29 @@ def generateTemplates(sz, lprefix, switch_name, calling_convention=''):
print
'};'
print
''
@outputToString
def
generateInlineWrappers
(
fns
):
print
'// generated by
%
s'
%
os
.
path
.
basename
(
sys
.
argv
[
0
])
for
fn
in
fns
:
print
'#undef
%
s'
%
(
fn
[
'name'
])
print
'#define
%
s
%
s_fn'
%
(
fn
[
'name'
],
fn
[
'name'
])
params
=
[]
call_params
=
[]
for
i
in
range
(
0
,
len
(
fn
[
'params'
])):
t
=
fn
[
'params'
][
i
]
if
t
.
find
(
'*)'
)
>=
0
:
p
=
re
.
sub
(
r'\*\)'
,
(
' *p
%
d)'
%
i
),
t
,
1
)
params
.
append
(
p
)
else
:
params
.
append
(
'
%
s p
%
d'
%
(
t
,
i
))
call_params
.
append
(
'p
%
d'
%
(
i
))
if
len
(
fn
[
'ret'
])
==
1
and
fn
[
'ret'
][
0
]
==
'void'
:
print
'inline void
%
s(
%
s) {
%
s_pfn(
%
s); }'
\
%
(
fn
[
'name'
],
', '
.
join
(
params
),
fn
[
'name'
],
', '
.
join
(
call_params
))
else
:
print
'inline
%
s
%
s(
%
s) { return
%
s_pfn(
%
s); }'
\
%
(
' '
.
join
(
fn
[
'ret'
]),
fn
[
'name'
],
', '
.
join
(
params
),
fn
[
'name'
],
', '
.
join
(
call_params
))
def
ProcessTemplate
(
inputFile
,
ctx
,
noteLine
=
'//
\n
// AUTOGENERATED, DO NOT EDIT
\n
//'
):
f
=
open
(
inputFile
,
"r"
)
...
...
modules/ocl/src/cl_runtime/generator/parser_cl.py
View file @
7f0680fc
...
...
@@ -10,6 +10,7 @@ try:
if
len
(
sys
.
argv
)
>
1
:
outfile
=
open
(
'../../../include/opencv2/ocl/cl_runtime/'
+
sys
.
argv
[
1
]
+
'.hpp'
,
"w"
)
outfile_impl
=
open
(
'../'
+
sys
.
argv
[
1
]
+
'_impl.hpp'
,
"w"
)
outfile_wrappers
=
open
(
'../../../include/opencv2/ocl/cl_runtime/'
+
sys
.
argv
[
1
]
+
'_wrappers.hpp'
,
"w"
)
if
len
(
sys
.
argv
)
>
2
:
f
=
open
(
sys
.
argv
[
2
],
"r"
)
else
:
...
...
@@ -102,6 +103,11 @@ ctx['CL_FN_DECLARATIONS'] = generateFnDeclaration(fns)
sys
.
stdout
=
outfile
ProcessTemplate
(
'template/cl_runtime_opencl.hpp.in'
,
ctx
)
ctx
[
'CL_FN_INLINE_WRAPPERS'
]
=
generateInlineWrappers
(
fns
)
sys
.
stdout
=
outfile_wrappers
ProcessTemplate
(
'template/cl_runtime_opencl_wrappers.hpp.in'
,
ctx
)
ctx
[
'CL_FN_ENUMS'
]
=
generateEnums
(
fns
)
ctx
[
'CL_FN_NAMES'
]
=
generateNames
(
fns
)
ctx
[
'CL_FN_DEFINITIONS'
]
=
generateFnDefinition
(
fns
)
...
...
modules/ocl/src/cl_runtime/generator/template/cl_runtime_opencl_wrappers.hpp.in
0 → 100644
View file @
7f0680fc
#ifndef __OPENCV_OCL_CL_RUNTIME_OPENCL_WRAPPERS_HPP__
#define __OPENCV_OCL_CL_RUNTIME_OPENCL_WRAPPERS_HPP__
@CL_FN_INLINE_WRAPPERS@
#endif // __OPENCV_OCL_CL_RUNTIME_OPENCL_WRAPPERS_HPP__
\ 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