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
a0add98b
Commit
a0add98b
authored
Oct 01, 2016
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ocl: eliminate build warning
Templates are replaced by macro
parent
39467d84
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
28 additions
and
24 deletions
+28
-24
common.py
modules/core/src/opencl/runtime/generator/common.py
+22
-18
opencl_clamdblas.hpp.in
...opencl/runtime/generator/template/opencl_clamdblas.hpp.in
+1
-1
opencl_clamdfft.hpp.in
.../opencl/runtime/generator/template/opencl_clamdfft.hpp.in
+1
-1
opencl_core.hpp.in
.../src/opencl/runtime/generator/template/opencl_core.hpp.in
+1
-1
opencl_core_wrappers.hpp.in
...cl/runtime/generator/template/opencl_core_wrappers.hpp.in
+1
-1
opencl_gl.hpp.in
...re/src/opencl/runtime/generator/template/opencl_gl.hpp.in
+1
-1
opencl_gl_wrappers.hpp.in
...encl/runtime/generator/template/opencl_gl_wrappers.hpp.in
+1
-1
No files found.
modules/core/src/opencl/runtime/generator/common.py
View file @
a0add98b
...
...
@@ -136,16 +136,30 @@ def generateFilterNames(fns):
print
'
%
s
%
s'
%
(
''
if
fn
.
has_key
(
'enabled'
)
else
'//'
,
fn
[
'name'
])
print
'#total
%
d'
%
len
(
fns
)
callback_check
=
re
.
compile
(
r'([^\(]*\(.*)(\* *)(\).*\(.*\))'
)
def
getTypeWithParam
(
t
,
p
):
if
callback_check
.
match
(
t
):
return
callback_check
.
sub
(
r'\1 *'
+
p
+
r'\3'
,
t
)
return
t
+
' '
+
p
@outputToString
def
generateStructDefinitions
(
fns
,
lprefix
=
'opencl_fn'
,
enumprefix
=
'OPENCL_FN'
):
print
'// generated by
%
s'
%
os
.
path
.
basename
(
sys
.
argv
[
0
])
first
=
True
for
fn
in
fns
:
commentStr
=
''
if
fn
.
has_key
(
'enabled'
)
else
'//'
print
commentStr
+
(
'
%
s
%
s (
%
s *
%
s)(
%
s) =
\n
%
s
%
s
%
d<
%
s_
%
s,
%
s
%
s>::switch_fn;'
%
\
decl_args
=
[]
for
(
i
,
t
)
in
enumerate
(
fn
[
'params'
]):
decl_args
.
append
(
getTypeWithParam
(
t
,
'p
%
d'
%
(
i
+
1
)))
decl_args_str
=
'('
+
(
', '
.
join
(
decl_args
))
+
')'
print
'
%
s
%
s
%
d(
%
s_
%
s,
%
s,
%
s)'
%
\
(
commentStr
,
lprefix
,
len
(
fn
[
'params'
]),
enumprefix
,
fn
[
'name'
],
\
' '
.
join
(
fn
[
'ret'
]),
decl_args_str
)
print
commentStr
+
(
'
%
s
%
s (
%
s *
%
s)(
%
s) =
\n
%
s
%
s_
%
s_switch_fn;'
%
\
((
' '
.
join
(
fn
[
'modifiers'
]
+
' '
)
if
len
(
fn
[
'modifiers'
])
>
0
else
''
),
' '
.
join
(
fn
[
'ret'
]),
' '
.
join
(
fn
[
'calling'
]),
fn
[
'name'
],
', '
.
join
(
fn
[
'params'
]),
\
commentStr
,
lprefix
,
len
(
fn
[
'params'
]),
enumprefix
,
fn
[
'name'
],
' '
.
join
(
fn
[
'ret'
]),
(
''
if
len
(
fn
[
'params'
])
==
0
else
', '
+
', '
.
join
(
fn
[
'params'
]))
))
commentStr
,
enumprefix
,
fn
[
'name'
]
))
print
commentStr
+
(
'static const struct DynamicFnEntry
%
s_definition = { "
%
s", (void**)&
%
s};'
%
(
fn
[
'name'
],
fn
[
'name'
],
fn
[
'name'
]))
print
first
=
False
...
...
@@ -200,22 +214,12 @@ def generateFnDeclaration(fns):
def
generateTemplates
(
sz
,
lprefix
,
switch_name
,
calling_convention
=
''
):
print
'// generated by
%
s'
%
os
.
path
.
basename
(
sys
.
argv
[
0
])
for
sz
in
range
(
sz
):
template_params
=
[
'int ID'
,
'typename _R'
]
types
=
[]
types_with_params
=
[]
params
=
[]
for
i
in
range
(
1
,
sz
+
1
):
template_params
.
append
(
'typename _T
%
d'
%
i
)
types
.
append
(
'_T
%
d'
%
i
)
types_with_params
.
append
(
'_T
%
d p
%
d'
%
(
i
,
i
))
params
.
append
(
'p
%
d'
%
i
)
print
'template <
%
s>'
%
', '
.
join
(
template_params
)
print
'struct
%
s
%
d'
%
(
lprefix
,
sz
)
print
'{'
print
' typedef _R (
%
s *FN)(
%
s);'
%
(
calling_convention
,
', '
.
join
(
types
))
print
' static _R
%
s switch_fn(
%
s)'
%
(
calling_convention
,
', '
.
join
(
types_with_params
))
print
' { return ((FN)
%
s(ID))(
%
s); }'
%
(
switch_name
,
', '
.
join
(
params
))
print
'};'
template_params
=
[
'ID'
,
'_R'
,
'decl_args'
]
params
=
[
'p
%
d'
%
(
i
+
1
)
for
i
in
range
(
0
,
sz
)]
print
'#define
%
s
%
d(
%
s)
\\
'
%
(
lprefix
,
sz
,
', '
.
join
(
template_params
))
print
' typedef _R (
%
s *ID##FN)decl_args;
\\
'
%
(
calling_convention
)
print
' static _R
%
s ID##_switch_fn decl_args
\\
'
%
(
calling_convention
)
print
' { return ((ID##FN)
%
s(ID))(
%
s); }
\\
'
%
(
switch_name
,
', '
.
join
(
params
))
print
''
@outputToString
...
...
modules/core/src/opencl/runtime/generator/template/opencl_clamdblas.hpp.in
View file @
a0add98b
#ifndef
__OPENCV_CORE_OCL_RUNTIME_CLAMDBLAS_HPP__
#ifndef
OPENCV_CORE_OCL_RUNTIME_CLAMDBLAS_HPP
#error "Invalid usage"
#endif
...
...
modules/core/src/opencl/runtime/generator/template/opencl_clamdfft.hpp.in
View file @
a0add98b
#ifndef
__OPENCV_CORE_OCL_RUNTIME_CLAMDFFT_HPP__
#ifndef
OPENCV_CORE_OCL_RUNTIME_CLAMDFFT_HPP
#error "Invalid usage"
#endif
...
...
modules/core/src/opencl/runtime/generator/template/opencl_core.hpp.in
View file @
a0add98b
#ifndef
__OPENCV_CORE_OCL_RUNTIME_OPENCL_CORE_HPP__
#ifndef
OPENCV_CORE_OCL_RUNTIME_OPENCL_CORE_HPP
#error "Invalid usage"
#endif
...
...
modules/core/src/opencl/runtime/generator/template/opencl_core_wrappers.hpp.in
View file @
a0add98b
#ifndef
__OPENCV_CORE_OCL_RUNTIME_OPENCL_WRAPPERS_HPP__
#ifndef
OPENCV_CORE_OCL_RUNTIME_OPENCL_WRAPPERS_HPP
#error "Invalid usage"
#endif
...
...
modules/core/src/opencl/runtime/generator/template/opencl_gl.hpp.in
View file @
a0add98b
#ifndef
__OPENCV_CORE_OCL_RUNTIME_OPENCL_GL_HPP__
#ifndef
OPENCV_CORE_OCL_RUNTIME_OPENCL_GL_HPP
#error "Invalid usage"
#endif
...
...
modules/core/src/opencl/runtime/generator/template/opencl_gl_wrappers.hpp.in
View file @
a0add98b
#ifndef
__OPENCV_CORE_OCL_RUNTIME_OPENCL_GL_WRAPPERS_HPP__
#ifndef
OPENCV_CORE_OCL_RUNTIME_OPENCL_GL_WRAPPERS_HPP
#error "Invalid usage"
#endif
...
...
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