forked from FFTW/fftw3
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
shorten ESTIMATE planning time for certain weird sizes
FFTW includes a collection of "solvers" that apply to a subset of "problems". Assume for simplicity that a "problem" is a single 1D complex transform of size N, even though real "problems" are much more general than that. FFTW includes three "prime" solvers called "generic", "bluestein", and "rader", which implement different algorithms for prime sizes. Now, for a "problem" of size 13 (say) FFTW also includes special code that handles that size at high speed. It would be a waste of time to measure the execution time of the prime solvers, since we know that the special code is way faster. However, FFTW is modular and one may or may not include the special code for size 13, in which case we must resort to one of the "prime" solvers. To address this issue, the "prime" solvers (and others) are proclaimed to be SLOW". When planning, FFTW first tries to produce a plan ignoring all the SLOW solvers, and if this fails FFTW tries again allowing SLOW solvers. This heuristic works ok unless the sizes are too large. For example for 1044000=2*2*2*2*2*3*3*5*5*5*29 FFTW explores a huge search tree of all zillion factorizations of 1044000/29, failing every time because 29 is SLOW; then it finally allows SLOW solvers and finds a solution immediately. This patch proclaims solvers to be SLOW only for small values of N. For example, the "generic" solver implements an O(n^2) DFT algorithm; we say that it is SLOW only for N<=16. The side effects of this choice are as follows. If one modifies FFTW to include a fast solver of size 17, then planning for N=17*K will be slower than today, because FFTW till try both the fast solver and the generic solver (which is SLOW today and therefore not tried, but is no longer SLOW after the patch). If one removes a fast solver, of size say 13, then he may still fall into the current exponential-search behavior for "problems" of size 13*HIGHLY_FACTORIZABLE_N. If somebody had compleined about transforms of size 1044000 ten years ago, "don't do that" would have been an acceptable answer. I guess the bar is higher today, so I am going to include this patch in our 3.3.1 release despite their side-effects for people who want to modify FFTW.
- Loading branch information
1 parent
610f797
commit f004d76
Showing
7 changed files
with
53 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters