| 201 | } |
| 202 | |
| 203 | clfftStatus FFTRepo::setclProgram( const clfftGenerators gen, const FFTKernelSignatureHeader * data, const cl_program& prog, const cl_device_id &device, const cl_context& planContext ) |
| 204 | { |
| 205 | scopedLock sLock( lockRepo, _T( "setclProgram" ) ); |
| 206 | |
| 207 | FFTRepoKey key(gen, data, planContext, device); |
| 208 | |
| 209 | fftRepo_iterator pos = mapFFTs.find( key ); |
| 210 | if( pos == mapFFTs.end( ) ) |
| 211 | { |
| 212 | key.privatizeData(); // the key owns the data |
| 213 | mapFFTs[ key ].clProgram = prog; |
| 214 | } |
| 215 | else { |
| 216 | cl_program p = pos->second.clProgram; |
| 217 | assert (NULL == p); |
| 218 | if (NULL != p) |
| 219 | clReleaseProgram (p); |
| 220 | pos->second.clProgram = prog; |
| 221 | } |
| 222 | |
| 223 | return CLFFT_SUCCESS; |
| 224 | } |
| 225 | |
| 226 | clfftStatus FFTRepo::getclProgram( const clfftGenerators gen, const FFTKernelSignatureHeader * data, cl_program& prog, const cl_device_id &device, const cl_context& planContext ) |
| 227 | { |
no test coverage detected