implement singleton lazy initialization

This commit is contained in:
Alexander Alekhin
2015-06-23 14:31:01 +03:00
parent 945aa06f58
commit 53fc5440d7
6 changed files with 72 additions and 61 deletions

View File

@@ -2026,8 +2026,7 @@ class OCL_FftPlanCache
public:
static OCL_FftPlanCache & getInstance()
{
static OCL_FftPlanCache planCache;
return planCache;
CV_SINGLETON_LAZY_INIT_REF(OCL_FftPlanCache, new OCL_FftPlanCache())
}
Ptr<OCL_FftPlan> getFftPlan(int dft_size, int depth)
@@ -2291,8 +2290,7 @@ class PlanCache
public:
static PlanCache & getInstance()
{
static PlanCache planCache;
return planCache;
CV_SINGLETON_LAZY_INIT_REF(PlanCache, new PlanCache())
}
clAmdFftPlanHandle getPlanHandle(const Size & dft_size, int src_step, int dst_step, bool doubleFP,