| 4613 | } |
| 4614 | |
| 4615 | clfftStatus FFTGeneratedStockhamAction::getWorkSizes (std::vector<size_t> & globalWS, std::vector<size_t> & localWS) |
| 4616 | { |
| 4617 | // How many complex numbers in the input mutl-dimensional array? |
| 4618 | // |
| 4619 | unsigned long long count = 1; |
| 4620 | for (unsigned u = 0; u < this->plan->length.size(); ++u) { |
| 4621 | count *= std::max<size_t> (1, this->plan->length[ u ]); |
| 4622 | } |
| 4623 | count *= this->plan->batchsize; |
| 4624 | |
| 4625 | |
| 4626 | if(this->signature.blockCompute) |
| 4627 | { |
| 4628 | count = DivRoundingUp<unsigned long long> (count, this->signature.blockLDS); |
| 4629 | count = count * this->signature.blockSIMD; |
| 4630 | |
| 4631 | globalWS.push_back( static_cast< size_t >( count ) ); |
| 4632 | localWS.push_back( this->signature.blockSIMD ); |
| 4633 | |
| 4634 | return CLFFT_SUCCESS; |
| 4635 | } |
| 4636 | |
| 4637 | count = DivRoundingUp<unsigned long long> (count, this->signature.fft_R); // count of WorkItems |
| 4638 | count = DivRoundingUp<unsigned long long> (count, this->signature.fft_SIMD); // count of WorkGroups |
| 4639 | |
| 4640 | // for real transforms we only need half the work groups since we do twice the work in 1 work group |
| 4641 | if( !(this->signature.fft_RCsimple) && ((this->signature.fft_inputLayout == CLFFT_REAL) || (this->signature.fft_outputLayout == CLFFT_REAL)) ) |
| 4642 | count = DivRoundingUp<unsigned long long> (count, 2); |
| 4643 | |
| 4644 | count = std::max<unsigned long long> (count, 1) * this->signature.fft_SIMD; |
| 4645 | // .. count of WorkItems, rounded up to next multiple of fft_SIMD. |
| 4646 | |
| 4647 | // 1 dimension work group size |
| 4648 | globalWS.push_back( static_cast< size_t >( count ) ); |
| 4649 | |
| 4650 | localWS.push_back( this->signature.fft_SIMD ); |
| 4651 | |
| 4652 | return CLFFT_SUCCESS; |
| 4653 | } |
| 4654 | |
| 4655 | clfftStatus FFTPlan::GetMax1DLengthStockham (size_t * longest) const |
| 4656 | { |