MCPcopy Create free account
hub / github.com/clMathLibraries/clFFT / clfftSetPlanLength

Function clfftSetPlanLength

src/library/accessors.cpp:280–354  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

278}
279
280clfftStatus clfftSetPlanLength( clfftPlanHandle plHandle, const clfftDim dim, const size_t* clLengths )
281{
282 FFTRepo& fftRepo = FFTRepo::getInstance( );
283 FFTPlan* fftPlan = NULL;
284 lockRAII* planLock = NULL;
285
286 OPENCL_V( fftRepo.getPlan( plHandle, fftPlan, planLock ), _T( "fftRepo.getPlan failed" ) );
287 scopedLock sLock( *planLock, _T( "clfftSetPlanLength" ) );
288
289 if( clLengths == NULL )
290 return CLFFT_INVALID_HOST_PTR;
291
292 // Simplest to clear any previous contents, because it's valid for user to shrink dimension
293 fftPlan->length.clear( );
294 switch( dim )
295 {
296 case CLFFT_1D:
297 {
298 // Minimum length size is 1
299 if( clLengths[ DimX ] == 0 )
300 return CLFFT_INVALID_ARG_VALUE;
301
302 if( !IsASupportedLength( clLengths[ DimX ] ) )
303 return CLFFT_NOTIMPLEMENTED;
304
305 fftPlan->length.push_back( clLengths[ DimX ] );
306 }
307 break;
308 case CLFFT_2D:
309 {
310 // Minimum length size is 1
311 if( clLengths[ DimX ] == 0 || clLengths[ DimY ] == 0 )
312 return CLFFT_INVALID_ARG_VALUE;
313
314 if(!fftPlan->transflag)
315 {
316 if( !IsASupportedLength( clLengths[ DimX ] ) || !IsASupportedLength( clLengths[ DimY ] ) )
317 {
318 return CLFFT_NOTIMPLEMENTED;
319 }
320 }
321
322 fftPlan->length.push_back( clLengths[ DimX ] );
323 fftPlan->length.push_back( clLengths[ DimY ] );
324 }
325 break;
326 case CLFFT_3D:
327 {
328 // Minimum length size is 1
329 if( clLengths[ DimX ] == 0 || clLengths[ DimY ] == 0 || clLengths[ DimZ ] == 0)
330 return CLFFT_INVALID_ARG_VALUE;
331
332 if( !IsASupportedLength( clLengths[ DimX ] ) || !IsASupportedLength( clLengths[ DimY ] ) ||
333 !IsASupportedLength( clLengths[ DimZ ] ) )
334 {
335 return CLFFT_NOTIMPLEMENTED;
336 }
337

Callers 3

clfftBakePlanFunction · 0.85
TEST_FFunction · 0.85
clAmdFftSetPlanLengthFunction · 0.85

Calls 3

IsASupportedLengthFunction · 0.85
getPlanMethod · 0.80
clearMethod · 0.45

Tested by 1

TEST_FFunction · 0.68