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
925594d1
Commit
925594d1
authored
May 03, 2017
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7894 from alalek:ocl_program
parents
dd81c298
c3e409f9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
31 deletions
+29
-31
cl2cpp.cmake
cmake/cl2cpp.cmake
+9
-17
ocl.hpp
modules/core/include/opencv2/core/ocl.hpp
+5
-4
ocl_genbase.hpp
modules/core/include/opencv2/core/ocl_genbase.hpp
+15
-10
ocl.cpp
modules/core/src/ocl.cpp
+0
-0
ocl_deprecated.hpp
modules/core/src/ocl_deprecated.hpp
+0
-0
No files found.
cmake/cl2cpp.cmake
View file @
925594d1
...
...
@@ -12,14 +12,8 @@ endif()
string
(
REGEX REPLACE
"
\\
.cpp$"
".hpp"
OUTPUT_HPP
"
${
OUTPUT
}
"
)
get_filename_component
(
OUTPUT_HPP_NAME
"
${
OUTPUT_HPP
}
"
NAME
)
if
(
"
${
MODULE_NAME
}
"
STREQUAL
"ocl"
)
set
(
nested_namespace_start
""
)
set
(
nested_namespace_end
""
)
else
()
set
(
new_mode ON
)
set
(
nested_namespace_start
"namespace
${
MODULE_NAME
}
\n
{"
)
set
(
nested_namespace_end
"}"
)
endif
()
set
(
nested_namespace_start
"namespace
${
MODULE_NAME
}
\n
{"
)
set
(
nested_namespace_end
"}"
)
set
(
STR_CPP
"// This file is auto-generated. Do not edit!
...
...
@@ -35,6 +29,8 @@ namespace ocl
{
${
nested_namespace_start
}
static const char* const moduleName =
\"
${
MODULE_NAME
}
\"
;
"
)
set
(
STR_HPP
"// This file is auto-generated. Do not edit!
...
...
@@ -76,19 +72,15 @@ foreach(cl ${cl_list})
string
(
MD5 hash
"
${
lines
}
"
)
set
(
STR_CPP_DECL
"const struct ProgramEntry
${
cl_filename
}
={
\"
${
cl_filename
}
\"
,
\n\"
${
lines
}
,
\"
${
hash
}
\"
};
\n
"
)
set
(
STR_HPP_DECL
"extern const struct ProgramEntry
${
cl_filename
}
;
\n
"
)
if
(
new_mode
)
set
(
STR_CPP_DECL
"
${
STR_CPP_DECL
}
ProgramSource
${
cl_filename
}
_oclsrc(
${
cl_filename
}
.programStr);
\n
"
)
set
(
STR_HPP_DECL
"
${
STR_HPP_DECL
}
extern ProgramSource
${
cl_filename
}
_oclsrc;
\n
"
)
endif
()
set
(
STR_CPP_DECL
"struct cv::ocl::internal::ProgramEntry
${
cl_filename
}
_oclsrc={moduleName,
\"
${
cl_filename
}
\"
,
\n\"
${
lines
}
,
\"
${
hash
}
\"
, NULL};
\n
"
)
set
(
STR_HPP_DECL
"extern struct cv::ocl::internal::ProgramEntry
${
cl_filename
}
_oclsrc;
\n
"
)
set
(
STR_CPP
"
${
STR_CPP
}${
STR_CPP_DECL
}
"
)
set
(
STR_HPP
"
${
STR_HPP
}${
STR_HPP_DECL
}
"
)
endforeach
()
set
(
STR_CPP
"
${
STR_CPP
}
}
\n
${
nested_namespace_end
}
}
\n
#endif
\n
"
)
set
(
STR_HPP
"
${
STR_HPP
}
}
\n
${
nested_namespace_end
}
}
\n
#endif
\n
"
)
set
(
STR_CPP
"
${
STR_CPP
}
\n
${
nested_namespace_end
}
}}
\n
#endif
\n
"
)
set
(
STR_HPP
"
${
STR_HPP
}
\n
${
nested_namespace_end
}
}}
\n
#endif
\n
"
)
file
(
WRITE
"
${
OUTPUT
}
"
"
${
STR_CPP
}
"
)
...
...
@@ -96,7 +88,7 @@ if(EXISTS "${OUTPUT_HPP}")
file
(
READ
"
${
OUTPUT_HPP
}
"
hpp_lines
)
endif
()
if
(
"
${
hpp_lines
}
"
STREQUAL
"
${
STR_HPP
}
"
)
message
(
STATUS
"
${
OUTPUT_HPP
}
contains same content"
)
message
(
STATUS
"
${
OUTPUT_HPP
}
contains
the
same content"
)
else
()
file
(
WRITE
"
${
OUTPUT_HPP
}
"
"
${
STR_HPP
}
"
)
endif
()
modules/core/include/opencv2/core/ocl.hpp
View file @
925594d1
...
...
@@ -629,17 +629,18 @@ protected:
class
CV_EXPORTS
ProgramSource
{
public
:
typedef
uint64
hash_t
;
typedef
uint64
hash_t
;
// deprecated
ProgramSource
();
explicit
ProgramSource
(
const
String
&
prog
);
explicit
ProgramSource
(
const
char
*
prog
);
explicit
ProgramSource
(
const
String
&
module
,
const
String
&
name
,
const
String
&
codeStr
,
const
String
&
codeHash
);
explicit
ProgramSource
(
const
String
&
prog
);
// deprecated
explicit
ProgramSource
(
const
char
*
prog
);
// deprecated
~
ProgramSource
();
ProgramSource
(
const
ProgramSource
&
prog
);
ProgramSource
&
operator
=
(
const
ProgramSource
&
prog
);
const
String
&
source
()
const
;
hash_t
hash
()
const
;
hash_t
hash
()
const
;
// deprecated
protected
:
struct
Impl
;
...
...
modules/core/include/opencv2/core/ocl_genbase.hpp
View file @
925594d1
...
...
@@ -42,23 +42,28 @@
#ifndef OPENCV_OPENCL_GENBASE_HPP
#define OPENCV_OPENCL_GENBASE_HPP
namespace
cv
{
namespace
ocl
{
//! @cond IGNORED
struct
ProgramEntry
namespace
cv
{
namespace
ocl
{
class
ProgramSource
;
namespace
internal
{
struct
CV_EXPORTS
ProgramEntry
{
const
char
*
module
;
const
char
*
name
;
const
char
*
program
Str
;
const
char
*
program
Code
;
const
char
*
programHash
;
ProgramSource
*
pProgramSource
;
operator
ProgramSource
&
()
const
;
};
//! @endcond
}
}
}
// namespace
}
}
//! @endcond
#endif
modules/core/src/ocl.cpp
View file @
925594d1
This diff is collapsed.
Click to expand it.
modules/core/src/ocl_deprecated.hpp
0 → 100644
View file @
925594d1
This diff is collapsed.
Click to expand it.
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