| 185 | } |
| 186 | |
| 187 | clfftStatus clfftSetPlanDim( clfftPlanHandle plHandle, const clfftDim dim ) |
| 188 | { |
| 189 | FFTRepo& fftRepo = FFTRepo::getInstance( ); |
| 190 | FFTPlan* fftPlan = NULL; |
| 191 | lockRAII* planLock = NULL; |
| 192 | |
| 193 | OPENCL_V( fftRepo.getPlan( plHandle, fftPlan, planLock ), _T( "fftRepo.getPlan failed" ) ); |
| 194 | scopedLock sLock( *planLock, _T( "clfftGetPlanDim" ) ); |
| 195 | |
| 196 | // We resize the vectors in the plan to keep their sizes consistent with the value of the dimension |
| 197 | switch( dim ) |
| 198 | { |
| 199 | case CLFFT_1D: |
| 200 | { |
| 201 | fftPlan->length.resize( 1 ); |
| 202 | fftPlan->inStride.resize( 1 ); |
| 203 | fftPlan->outStride.resize( 1 ); |
| 204 | } |
| 205 | break; |
| 206 | case CLFFT_2D: |
| 207 | { |
| 208 | fftPlan->length.resize( 2 ); |
| 209 | fftPlan->inStride.resize( 2 ); |
| 210 | fftPlan->outStride.resize( 2 ); |
| 211 | } |
| 212 | break; |
| 213 | case CLFFT_3D: |
| 214 | { |
| 215 | fftPlan->length.resize( 3 ); |
| 216 | fftPlan->inStride.resize( 3 ); |
| 217 | fftPlan->outStride.resize( 3 ); |
| 218 | } |
| 219 | break; |
| 220 | default: |
| 221 | return CLFFT_NOTIMPLEMENTED; |
| 222 | break; |
| 223 | } |
| 224 | |
| 225 | // If we modify the state of the plan, we assume that we can't trust any pre-calculated contents anymore |
| 226 | fftPlan->baked = false; |
| 227 | fftPlan->dim = dim; |
| 228 | |
| 229 | return CLFFT_SUCCESS; |
| 230 | } |
| 231 | |
| 232 | clfftStatus clfftGetPlanLength( const clfftPlanHandle plHandle, const clfftDim dim, size_t* clLengths ) |
| 233 | { |