![]() |
Diana Software
|
Singleton class for handling FFTW3 wisdom. More...
Public Member Functions | |
| bool | ExportWisdomToFile (const char *outFile) |
| Save the accumulated wisdom to file. More... | |
| bool | ImportWisdomFromFile (const char *inFile) |
| Load wisdom from file. More... | |
| bool | ImportSystemWisdom () |
| Load wisdom from a system file. More... | |
| bool | ForgetWisdom (void) |
| Forget any accumulated wisdom. More... | |
Static Public Member Functions | |
| static QFFTW3Wisdom * | Get () |
| Access to the singleton class. More... | |
Protected Member Functions | |
| QFFTW3Wisdom () | |
| Default ctor. More... | |
| ~QFFTW3Wisdom () | |
| Default dtor. More... | |
Protected Attributes | |
| bool | fLocalWisdom |
| Local wisdom used. More... | |
| bool | fSavingWisdom |
| Saving wisdom. More... | |
| std::string | fWisdomFile |
| The file from which the wisdom was loaded. More... | |
| std::string | fLocalFile |
| The file to save the wisdom. More... | |
Static Protected Attributes | |
| static QFFTW3Wisdom * | fInstance |
| Pointer to the singleton instance. More... | |
Singleton class for handling FFTW3 wisdom.
Whenever FFTW3 performs an FFT of an array of size N, it creates a 'plan'. Several plans are tested and the fastest is selected. This plan is stored in internal memory as FFTW3 'widsdom'. Thus whenever a new plan of size N needs to be created, the fastest is already known and does not need to be tested. This lasts for the duration of the program.
This wisdom can be stored to and loaded from a file so that the testing does not need to be performed again in new programs.
This class handles the storing and loading of this wisdom.
The purpose of its being a singleton class is to allow for more complex behavior, like loading wisdom only at the first call, and saving it back to a file automatically upon the program's termination. Though this can be disabled.
|
protected |
Default ctor.
Protected ctor attempts to load system wisdom, then searches likely directories for wisdom files.
Definition at line 17 of file QFFTW3.cc.
References ImportSystemWisdom().
|
protected |
Default dtor.
Protected dtor attempts to save wisdom.
Definition at line 33 of file QFFTW3.cc.
References ExportWisdomToFile(), fLocalWisdom, fSavingWisdom, and fWisdomFile.
| bool QFFTW3Wisdom::ExportWisdomToFile | ( | const char * | outFile | ) |
Save the accumulated wisdom to file.
Export ALL accumulated wisdom to a file.
Definition at line 37 of file QFFTW3.cc.
Referenced by ~QFFTW3Wisdom().
| bool QFFTW3Wisdom::ForgetWisdom | ( | void | ) |
|
static |
Access to the singleton class.
Referenced by QFFTW3::QFFTW3().
| bool QFFTW3Wisdom::ImportSystemWisdom | ( | ) |
Load wisdom from a system file.
Import the wisdom saved in a system file (e.g. /etc/fftw/wisdom). This replaces ALL wisdom accumulated by the program.
Definition at line 59 of file QFFTW3.cc.
Referenced by QFFTW3Wisdom().
| bool QFFTW3Wisdom::ImportWisdomFromFile | ( | const char * | inFile | ) |
|
staticprotected |
|
protected |
|
protected |
Local wisdom used.
This flags that we are using some local wisdom and that if fSaving is set, that we can save to the local file.
Definition at line 100 of file QFFTW3.hh.
Referenced by ~QFFTW3Wisdom().
|
protected |
Saving wisdom.
After the program accumulates wisdom, the new wisdom can be saved to a local file.
Definition at line 108 of file QFFTW3.hh.
Referenced by ~QFFTW3Wisdom().
|
protected |
The file from which the wisdom was loaded.
Definition at line 113 of file QFFTW3.hh.
Referenced by ~QFFTW3Wisdom().