1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 08:13:04 +04:00

ocl: update compiled programs

- minimize library initialization time (lazy calculations of program hash)
- LRU cache of in-memory compiled programs
This commit is contained in:
Alexander Alekhin
2016-12-19 00:38:33 +03:00
parent 05d187ec90
commit 7a95e654eb
4 changed files with 141 additions and 61 deletions
+5 -4
View File
@@ -627,17 +627,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;
@@ -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* programStr;
const char* programCode;
const char* programHash;
ProgramSource* pProgramSource;
operator ProgramSource& () const;
};
} } } // namespace
//! @endcond
}
}
#endif