Refactor OpenCL initialization and allow to use ocl module witout explicit setup

This commit is contained in:
Andrey Kamaev
2013-03-18 01:59:24 +04:00
parent dd678121b3
commit 7b8ad4cb04
17 changed files with 416 additions and 381 deletions

View File

@@ -140,15 +140,23 @@ namespace cv
protected:
Context();
friend class auto_ptr<Context>;
static auto_ptr<Context> clCxt;
private:
static auto_ptr<Context> clCxt;
static int val;
public:
~Context();
static int val;
static Context *getContext();
void release();
Info::Impl* impl;
static Context* getContext();
static void setContext(Info &oclinfo);
struct Impl;
Impl *impl;
enum {CL_DOUBLE, CL_UNIFIED_MEM};
bool supportsFeature(int ftype);
size_t computeUnits();
void* oclContext();
void* oclCommandQueue();
};
//! Calls a kernel, by string. Pass globalThreads = NULL, and cleanUp = true, to finally clean-up without executing.