24
24
using std::map;
25
25
using std::string;
26
26
27
- // Static initialization of the repo lock variable
28
- lockRAII FFTRepo::lockRepo ( _T( " FFTRepo" ) );
29
-
30
27
// Static initialization of the plan count variable
31
28
size_t FFTRepo::planCount = 1 ;
32
29
@@ -39,7 +36,7 @@ GpuStatTimer* FFTRepo::pStatTimer = NULL;
39
36
40
37
clfftStatus FFTRepo::releaseResources ( )
41
38
{
42
- scopedLock sLock ( lockRepo, _T ( " releaseResources" ) );
39
+ scopedLock sLock ( lockRepo () , _T ( " releaseResources" ) );
43
40
44
41
// Release all handles to Kernels
45
42
//
@@ -110,7 +107,7 @@ clfftStatus FFTRepo::releaseResources( )
110
107
111
108
clfftStatus FFTRepo::setProgramCode ( const clfftGenerators gen, const FFTKernelSignatureHeader * data, const std::string& kernel, const cl_device_id &device, const cl_context& planContext )
112
109
{
113
- scopedLock sLock ( lockRepo, _T ( " setProgramCode" ) );
110
+ scopedLock sLock ( lockRepo () , _T ( " setProgramCode" ) );
114
111
115
112
FFTRepoKey key (gen, data, planContext, device);
116
113
@@ -149,7 +146,7 @@ clfftStatus FFTRepo::setProgramCode( const clfftGenerators gen, const FFTKernelS
149
146
150
147
clfftStatus FFTRepo::getProgramCode ( const clfftGenerators gen, const FFTKernelSignatureHeader * data, std::string& kernel, const cl_device_id &device, const cl_context& planContext )
151
148
{
152
- scopedLock sLock ( lockRepo, _T ( " getProgramCode" ) );
149
+ scopedLock sLock ( lockRepo () , _T ( " getProgramCode" ) );
153
150
154
151
FFTRepoKey key (gen, data, planContext, device);
155
152
@@ -164,7 +161,7 @@ clfftStatus FFTRepo::getProgramCode( const clfftGenerators gen, const FFTKernelS
164
161
clfftStatus FFTRepo::setProgramEntryPoints ( const clfftGenerators gen, const FFTKernelSignatureHeader * data,
165
162
const char * kernel_fwd, const char * kernel_back, const cl_device_id &device, const cl_context& planContext )
166
163
{
167
- scopedLock sLock ( lockRepo, _T ( " setProgramEntryPoints" ) );
164
+ scopedLock sLock ( lockRepo () , _T ( " setProgramEntryPoints" ) );
168
165
169
166
FFTRepoKey key (gen, data, planContext, device);
170
167
@@ -178,7 +175,7 @@ clfftStatus FFTRepo::setProgramEntryPoints( const clfftGenerators gen, const FFT
178
175
clfftStatus FFTRepo::getProgramEntryPoint ( const clfftGenerators gen, const FFTKernelSignatureHeader * data,
179
176
clfftDirection dir, std::string& kernel, const cl_device_id &device, const cl_context& planContext )
180
177
{
181
- scopedLock sLock ( lockRepo, _T ( " getProgramEntryPoint" ) );
178
+ scopedLock sLock ( lockRepo () , _T ( " getProgramEntryPoint" ) );
182
179
183
180
FFTRepoKey key (gen, data, planContext, device);
184
181
@@ -206,7 +203,7 @@ clfftStatus FFTRepo::getProgramEntryPoint( const clfftGenerators gen, const FFTK
206
203
207
204
clfftStatus FFTRepo::setclProgram ( const clfftGenerators gen, const FFTKernelSignatureHeader * data, const cl_program& prog, const cl_device_id &device, const cl_context& planContext )
208
205
{
209
- scopedLock sLock ( lockRepo, _T ( " setclProgram" ) );
206
+ scopedLock sLock ( lockRepo () , _T ( " setclProgram" ) );
210
207
211
208
FFTRepoKey key (gen, data, planContext, device);
212
209
@@ -229,7 +226,7 @@ clfftStatus FFTRepo::setclProgram( const clfftGenerators gen, const FFTKernelSig
229
226
230
227
clfftStatus FFTRepo::getclProgram ( const clfftGenerators gen, const FFTKernelSignatureHeader * data, cl_program& prog, const cl_device_id &device, const cl_context& planContext )
231
228
{
232
- scopedLock sLock ( lockRepo, _T ( " getclProgram" ) );
229
+ scopedLock sLock ( lockRepo () , _T ( " getclProgram" ) );
233
230
234
231
FFTRepoKey key (gen, data, planContext, device);
235
232
@@ -250,7 +247,7 @@ clfftStatus FFTRepo::getclProgram( const clfftGenerators gen, const FFTKernelSig
250
247
251
248
clfftStatus FFTRepo::setclKernel ( cl_program prog, clfftDirection dir, const cl_kernel& kernel )
252
249
{
253
- scopedLock sLock ( lockRepo, _T ( " setclKernel" ) );
250
+ scopedLock sLock ( lockRepo () , _T ( " setclKernel" ) );
254
251
255
252
fftKernels & Kernels = mapKernels[ prog ];
256
253
@@ -287,7 +284,7 @@ clfftStatus FFTRepo::setclKernel( cl_program prog, clfftDirection dir, const cl_
287
284
288
285
clfftStatus FFTRepo::getclKernel ( cl_program prog, clfftDirection dir, cl_kernel& kernel, lockRAII*& kernelLock)
289
286
{
290
- scopedLock sLock ( lockRepo, _T ( " getclKernel" ) );
287
+ scopedLock sLock ( lockRepo () , _T ( " getclKernel" ) );
291
288
292
289
Kernel_iterator pos = mapKernels.find ( prog );
293
290
if (pos == mapKernels.end ( ) )
@@ -315,7 +312,7 @@ clfftStatus FFTRepo::getclKernel( cl_program prog, clfftDirection dir, cl_kernel
315
312
316
313
clfftStatus FFTRepo::createPlan ( clfftPlanHandle* plHandle, FFTPlan*& fftPlan )
317
314
{
318
- scopedLock sLock ( lockRepo, _T ( " insertPlan" ) );
315
+ scopedLock sLock ( lockRepo () , _T ( " insertPlan" ) );
319
316
320
317
// We keep track of this memory in our own collection class, to make sure it's freed in releaseResources
321
318
// 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 )
336
333
337
334
clfftStatus FFTRepo::getPlan ( clfftPlanHandle plHandle, FFTPlan*& fftPlan, lockRAII*& planLock )
338
335
{
339
- scopedLock sLock ( lockRepo, _T ( " getPlan" ) );
336
+ scopedLock sLock ( lockRepo () , _T ( " getPlan" ) );
340
337
341
338
// First, check if we have already created a plan with this exact same FFTPlan
342
339
repoPlansType::iterator iter = repoPlans.find ( plHandle );
@@ -352,7 +349,7 @@ clfftStatus FFTRepo::getPlan( clfftPlanHandle plHandle, FFTPlan*& fftPlan, lockR
352
349
353
350
clfftStatus FFTRepo::deletePlan ( clfftPlanHandle* plHandle )
354
351
{
355
- scopedLock sLock ( lockRepo, _T ( " deletePlan" ) );
352
+ scopedLock sLock ( lockRepo () , _T ( " deletePlan" ) );
356
353
357
354
// First, check if we have already created a plan with this exact same FFTPlan
358
355
repoPlansType::iterator iter = repoPlans.find ( *plHandle );
0 commit comments