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
@@ -149,7 +146,7 @@ clfftStatus FFTRepo::setProgramCode( const clfftGenerators gen, const FFTKernelS
149146
150147clfftStatus FFTRepo::getProgramCode ( const clfftGenerators gen, const FFTKernelSignatureHeader * data, std::string& kernel, const cl_device_id &device, const cl_context& planContext )
151148{
152- scopedLock sLock ( lockRepo, _T ( " getProgramCode" ) );
149+ scopedLock sLock ( lockRepo () , _T ( " getProgramCode" ) );
153150
154151 FFTRepoKey key (gen, data, planContext, device);
155152
@@ -164,7 +161,7 @@ clfftStatus FFTRepo::getProgramCode( const clfftGenerators gen, const FFTKernelS
164161clfftStatus FFTRepo::setProgramEntryPoints ( const clfftGenerators gen, const FFTKernelSignatureHeader * data,
165162 const char * kernel_fwd, const char * kernel_back, const cl_device_id &device, const cl_context& planContext )
166163{
167- scopedLock sLock ( lockRepo, _T ( " setProgramEntryPoints" ) );
164+ scopedLock sLock ( lockRepo () , _T ( " setProgramEntryPoints" ) );
168165
169166 FFTRepoKey key (gen, data, planContext, device);
170167
@@ -178,7 +175,7 @@ clfftStatus FFTRepo::setProgramEntryPoints( const clfftGenerators gen, const FFT
178175clfftStatus FFTRepo::getProgramEntryPoint ( const clfftGenerators gen, const FFTKernelSignatureHeader * data,
179176 clfftDirection dir, std::string& kernel, const cl_device_id &device, const cl_context& planContext )
180177{
181- scopedLock sLock ( lockRepo, _T ( " getProgramEntryPoint" ) );
178+ scopedLock sLock ( lockRepo () , _T ( " getProgramEntryPoint" ) );
182179
183180 FFTRepoKey key (gen, data, planContext, device);
184181
@@ -206,7 +203,7 @@ clfftStatus FFTRepo::getProgramEntryPoint( const clfftGenerators gen, const FFTK
206203
207204clfftStatus FFTRepo::setclProgram ( const clfftGenerators gen, const FFTKernelSignatureHeader * data, const cl_program& prog, const cl_device_id &device, const cl_context& planContext )
208205{
209- scopedLock sLock ( lockRepo, _T ( " setclProgram" ) );
206+ scopedLock sLock ( lockRepo () , _T ( " setclProgram" ) );
210207
211208 FFTRepoKey key (gen, data, planContext, device);
212209
@@ -229,7 +226,7 @@ clfftStatus FFTRepo::setclProgram( const clfftGenerators gen, const FFTKernelSig
229226
230227clfftStatus FFTRepo::getclProgram ( const clfftGenerators gen, const FFTKernelSignatureHeader * data, cl_program& prog, const cl_device_id &device, const cl_context& planContext )
231228{
232- scopedLock sLock ( lockRepo, _T ( " getclProgram" ) );
229+ scopedLock sLock ( lockRepo () , _T ( " getclProgram" ) );
233230
234231 FFTRepoKey key (gen, data, planContext, device);
235232
@@ -250,7 +247,7 @@ clfftStatus FFTRepo::getclProgram( const clfftGenerators gen, const FFTKernelSig
250247
251248clfftStatus FFTRepo::setclKernel ( cl_program prog, clfftDirection dir, const cl_kernel& kernel )
252249{
253- scopedLock sLock ( lockRepo, _T ( " setclKernel" ) );
250+ scopedLock sLock ( lockRepo () , _T ( " setclKernel" ) );
254251
255252 fftKernels & Kernels = mapKernels[ prog ];
256253
@@ -287,7 +284,7 @@ clfftStatus FFTRepo::setclKernel( cl_program prog, clfftDirection dir, const cl_
287284
288285clfftStatus FFTRepo::getclKernel ( cl_program prog, clfftDirection dir, cl_kernel& kernel, lockRAII*& kernelLock)
289286{
290- scopedLock sLock ( lockRepo, _T ( " getclKernel" ) );
287+ scopedLock sLock ( lockRepo () , _T ( " getclKernel" ) );
291288
292289 Kernel_iterator pos = mapKernels.find ( prog );
293290 if (pos == mapKernels.end ( ) )
@@ -315,7 +312,7 @@ clfftStatus FFTRepo::getclKernel( cl_program prog, clfftDirection dir, cl_kernel
315312
316313clfftStatus FFTRepo::createPlan ( clfftPlanHandle* plHandle, FFTPlan*& fftPlan )
317314{
318- scopedLock sLock ( lockRepo, _T ( " insertPlan" ) );
315+ scopedLock sLock ( lockRepo () , _T ( " insertPlan" ) );
319316
320317 // We keep track of this memory in our own collection class, to make sure it's freed in releaseResources
321318 // The lifetime of a plan is tracked by the client and is freed when the client calls ::clfftDestroyPlan()
@@ -336,7 +333,7 @@ clfftStatus FFTRepo::createPlan( clfftPlanHandle* plHandle, FFTPlan*& fftPlan )
336333
337334clfftStatus FFTRepo::getPlan ( clfftPlanHandle plHandle, FFTPlan*& fftPlan, lockRAII*& planLock )
338335{
339- scopedLock sLock ( lockRepo, _T ( " getPlan" ) );
336+ scopedLock sLock ( lockRepo () , _T ( " getPlan" ) );
340337
341338 // First, check if we have already created a plan with this exact same FFTPlan
342339 repoPlansType::iterator iter = repoPlans.find ( plHandle );
@@ -352,7 +349,7 @@ clfftStatus FFTRepo::getPlan( clfftPlanHandle plHandle, FFTPlan*& fftPlan, lockR
352349
353350clfftStatus FFTRepo::deletePlan ( clfftPlanHandle* plHandle )
354351{
355- scopedLock sLock ( lockRepo, _T ( " deletePlan" ) );
352+ scopedLock sLock ( lockRepo () , _T ( " deletePlan" ) );
356353
357354 // First, check if we have already created a plan with this exact same FFTPlan
358355 repoPlansType::iterator iter = repoPlans.find ( *plHandle );
0 commit comments