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

Method initParams

src/library/generator.copy.cpp:512–580  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

510
511
512clfftStatus FFTGeneratedCopyAction::initParams ()
513{
514
515 // Query the devices in this context for their local memory sizes
516 // How we generate a kernel depends on the *minimum* LDS size for all devices.
517 //
518 const FFTEnvelope * pEnvelope = NULL;
519 OPENCL_V(this->plan->GetEnvelope (& pEnvelope), _T("GetEnvelope failed"));
520 BUG_CHECK (NULL != pEnvelope);
521
522 this->signature.fft_precision = this->plan->precision;
523 this->signature.fft_placeness = this->plan->placeness;
524 this->signature.fft_inputLayout = this->plan->inputLayout;
525 this->signature.fft_MaxWorkGroupSize = this->plan->envelope.limit_WorkGroupSize;
526
527 ARG_CHECK (this->plan->inStride.size() == this->plan->outStride.size())
528
529 this->signature.fft_outputLayout = this->plan->outputLayout;
530
531 this->signature.fft_DataDim = this->plan->length.size() + 1;
532 int i = 0;
533 for(i = 0; i < (this->signature.fft_DataDim - 1); i++)
534 {
535 this->signature.fft_N[i] = this->plan->length[i];
536 this->signature.fft_inStride[i] = this->plan->inStride[i];
537 this->signature.fft_outStride[i] = this->plan->outStride[i];
538
539 }
540 this->signature.fft_inStride[i] = this->plan->iDist;
541 this->signature.fft_outStride[i] = this->plan->oDist;
542
543 this->signature.fft_fwdScale = this->plan->forwardScale;
544 this->signature.fft_backScale = this->plan->backwardScale;
545
546 //Set callback if specified
547 if (this->plan->hasPreCallback)
548 {
549 assert(!this->plan->hasPostCallback);
550
551 this->signature.fft_hasPreCallback = true;
552 this->signature.fft_preCallback = this->plan->preCallback;
553
554 //Requested local memory size by callback must not exceed the device LDS limits after factoring the LDS size required by main FFT kernel
555 if (this->plan->preCallback.localMemSize > this->plan->envelope.limit_LocalMemSize)
556 {
557 fprintf(stderr, "Requested local memory size not available\n");
558 return CLFFT_INVALID_ARG_VALUE;
559 }
560 }
561
562 if (this->plan->hasPostCallback)
563 {
564 assert(!this->plan->hasPreCallback);
565
566 this->signature.fft_hasPostCallback = true;
567 this->signature.fft_postCallback = this->plan->postCallbackParam;
568
569 //Requested local memory size by callback must not exceed the device LDS limits after factoring the LDS size required by main FFT kernel

Callers 1

Calls 2

GetEnvelopeMethod · 0.80
sizeMethod · 0.80

Tested by

no test coverage detected