2424using std::map;
2525using std::string;
2626
27- // Static initialization of the repo lock variable
28- lockRAII FFTRepo::lockRepo ( _T( " FFTRepo" ) );
29-
3027// Static initialization of the plan count variable
3128size_t FFTRepo::planCount = 1 ;
3229
@@ -39,7 +36,7 @@ GpuStatTimer* FFTRepo::pStatTimer = NULL;
3936
4037clfftStatus FFTRepo::releaseResources ( )
4138{
42- scopedLock sLock ( lockRepo, _T ( " releaseResources" ) );
39+ scopedLock sLock ( lockRepo () , _T ( " releaseResources" ) );
4340
4441 // Release all handles to Kernels
4542 //
@@ -110,7 +107,7 @@ clfftStatus FFTRepo::releaseResources( )
110107
111108clfftStatus FFTRepo::setProgramCode ( const clfftGenerators gen, const FFTKernelSignatureHeader * data, const std::string& kernel, const cl_device_id &device, const cl_context& planContext )
112109{
113- scopedLock sLock ( lockRepo, _T ( " setProgramCode" ) );
110+ scopedLock sLock ( lockRepo () , _T ( " setProgramCode" ) );
114111
115112 FFTRepoKey key (gen, data, planContext, device);
116113
@@ -145,7 +142,7 @@ clfftStatus FFTRepo::setProgramCode( const clfftGenerators gen, const FFTKernelS
145142
146143clfftStatus FFTRepo::getProgramCode ( const clfftGenerators gen, const FFTKernelSignatureHeader * data, std::string& kernel, const cl_device_id &device, const cl_context& planContext )
147144{
148- scopedLock sLock ( lockRepo, _T ( " getProgramCode" ) );
145+ scopedLock sLock ( lockRepo () , _T ( " getProgramCode" ) );
149146
150147 FFTRepoKey key (gen, data, planContext, device);
151148
@@ -160,7 +157,7 @@ clfftStatus FFTRepo::getProgramCode( const clfftGenerators gen, const FFTKernelS
160157clfftStatus FFTRepo::setProgramEntryPoints ( const clfftGenerators gen, const FFTKernelSignatureHeader * data,
161158 const char * kernel_fwd, const char * kernel_back, const cl_device_id &device, const cl_context& planContext )
162159{
163- scopedLock sLock ( lockRepo, _T ( " setProgramEntryPoints" ) );
160+ scopedLock sLock ( lockRepo () , _T ( " setProgramEntryPoints" ) );
164161
165162 FFTRepoKey key (gen, data, planContext, device);
166163
@@ -174,7 +171,7 @@ clfftStatus FFTRepo::setProgramEntryPoints( const clfftGenerators gen, const FFT
174171clfftStatus FFTRepo::getProgramEntryPoint ( const clfftGenerators gen, const FFTKernelSignatureHeader * data,
175172 clfftDirection dir, std::string& kernel, const cl_device_id &device, const cl_context& planContext )
176173{
177- scopedLock sLock ( lockRepo, _T ( " getProgramEntryPoint" ) );
174+ scopedLock sLock ( lockRepo () , _T ( " getProgramEntryPoint" ) );
178175
179176 FFTRepoKey key (gen, data, planContext, device);
180177
@@ -202,7 +199,7 @@ clfftStatus FFTRepo::getProgramEntryPoint( const clfftGenerators gen, const FFTK
202199
203200clfftStatus FFTRepo::setclProgram ( const clfftGenerators gen, const FFTKernelSignatureHeader * data, const cl_program& prog, const cl_device_id &device, const cl_context& planContext )
204201{
205- scopedLock sLock ( lockRepo, _T ( " setclProgram" ) );
202+ scopedLock sLock ( lockRepo () , _T ( " setclProgram" ) );
206203
207204 FFTRepoKey key (gen, data, planContext, device);
208205
@@ -225,7 +222,7 @@ clfftStatus FFTRepo::setclProgram( const clfftGenerators gen, const FFTKernelSig
225222
226223clfftStatus FFTRepo::getclProgram ( const clfftGenerators gen, const FFTKernelSignatureHeader * data, cl_program& prog, const cl_device_id &device, const cl_context& planContext )
227224{
228- scopedLock sLock ( lockRepo, _T ( " getclProgram" ) );
225+ scopedLock sLock ( lockRepo () , _T ( " getclProgram" ) );
229226
230227 FFTRepoKey key (gen, data, planContext, device);
231228
@@ -246,7 +243,7 @@ clfftStatus FFTRepo::getclProgram( const clfftGenerators gen, const FFTKernelSig
246243
247244clfftStatus FFTRepo::setclKernel ( cl_program prog, clfftDirection dir, const cl_kernel& kernel )
248245{
249- scopedLock sLock ( lockRepo, _T ( " setclKernel" ) );
246+ scopedLock sLock ( lockRepo () , _T ( " setclKernel" ) );
250247
251248 fftKernels & Kernels = mapKernels[ prog ];
252249
@@ -283,7 +280,7 @@ clfftStatus FFTRepo::setclKernel( cl_program prog, clfftDirection dir, const cl_
283280
284281clfftStatus FFTRepo::getclKernel ( cl_program prog, clfftDirection dir, cl_kernel& kernel, lockRAII*& kernelLock)
285282{
286- scopedLock sLock ( lockRepo, _T ( " getclKernel" ) );
283+ scopedLock sLock ( lockRepo () , _T ( " getclKernel" ) );
287284
288285 Kernel_iterator pos = mapKernels.find ( prog );
289286 if (pos == mapKernels.end ( ) )
@@ -311,7 +308,7 @@ clfftStatus FFTRepo::getclKernel( cl_program prog, clfftDirection dir, cl_kernel
311308
312309clfftStatus FFTRepo::createPlan ( clfftPlanHandle* plHandle, FFTPlan*& fftPlan )
313310{
314- scopedLock sLock ( lockRepo, _T ( " insertPlan" ) );
311+ scopedLock sLock ( lockRepo () , _T ( " insertPlan" ) );
315312
316313 // We keep track of this memory in our own collection class, to make sure it's freed in releaseResources
317314 // The lifetime of a plan is tracked by the client and is freed when the client calls ::clfftDestroyPlan()
@@ -332,7 +329,7 @@ clfftStatus FFTRepo::createPlan( clfftPlanHandle* plHandle, FFTPlan*& fftPlan )
332329
333330clfftStatus FFTRepo::getPlan ( clfftPlanHandle plHandle, FFTPlan*& fftPlan, lockRAII*& planLock )
334331{
335- scopedLock sLock ( lockRepo, _T ( " getPlan" ) );
332+ scopedLock sLock ( lockRepo () , _T ( " getPlan" ) );
336333
337334 // First, check if we have already created a plan with this exact same FFTPlan
338335 repoPlansType::iterator iter = repoPlans.find ( plHandle );
@@ -348,7 +345,7 @@ clfftStatus FFTRepo::getPlan( clfftPlanHandle plHandle, FFTPlan*& fftPlan, lockR
348345
349346clfftStatus FFTRepo::deletePlan ( clfftPlanHandle* plHandle )
350347{
351- scopedLock sLock ( lockRepo, _T ( " deletePlan" ) );
348+ scopedLock sLock ( lockRepo () , _T ( " deletePlan" ) );
352349
353350 // First, check if we have already created a plan with this exact same FFTPlan
354351 repoPlansType::iterator iter = repoPlans.find ( *plHandle );
0 commit comments