ITK  4.8.0
Insight Segmentation and Registration Toolkit
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
itk::FFTWGlobalConfiguration Class Reference

#include <itkFFTWGlobalConfiguration.h>

+ Inheritance diagram for itk::FFTWGlobalConfiguration:
+ Collaboration diagram for itk::FFTWGlobalConfiguration:

Detailed Description

A class to contain all the global configuration options for FFTW.

A simple global lock is included that must be called before calling FFTW unsafe functions. It also handle cleanly the initialization and cleanup of FFTW.

This implementation was taken from the Insight Journal paper: http://hdl.handle.net/10380/3154 or http://insight-journal.com/browse/publication/717

Author
Gaetan Lehmann. Biologie du Developpement et de la Reproduction, INRA de Jouy-en-Josas, France.
Hans Johnson, The University of Iowa

Definition at line 166 of file itkFFTWGlobalConfiguration.h.

Public Types

typedef SmartPointer< const SelfConstPointer
 
typedef SimpleFastMutexLock MutexType
 
typedef SmartPointer< SelfPointer
 
typedef FFTWGlobalConfiguration Self
 
typedef Object Superclass
 
- Public Types inherited from itk::Object
typedef SmartPointer< const SelfConstPointer
 
typedef SmartPointer< SelfPointer
 
typedef Object Self
 
typedef LightObject Superclass
 
- Public Types inherited from itk::LightObject
typedef SmartPointer< const SelfConstPointer
 
typedef SmartPointer< SelfPointer
 
typedef LightObject Self
 

Public Member Functions

virtual const char * GetNameOfClass () const
 
- Public Member Functions inherited from itk::Object
unsigned long AddObserver (const EventObject &event, Command *)
 
unsigned long AddObserver (const EventObject &event, Command *) const
 
virtual void DebugOff () const
 
virtual void DebugOn () const
 
CommandGetCommand (unsigned long tag)
 
bool GetDebug () const
 
MetaDataDictionaryGetMetaDataDictionary ()
 
const MetaDataDictionaryGetMetaDataDictionary () const
 
virtual ModifiedTimeType GetMTime () const
 
virtual const TimeStampGetTimeStamp () const
 
bool HasObserver (const EventObject &event) const
 
void InvokeEvent (const EventObject &)
 
void InvokeEvent (const EventObject &) const
 
virtual void Modified () const
 
virtual void Register () const override
 
void RemoveAllObservers ()
 
void RemoveObserver (unsigned long tag)
 
void SetDebug (bool debugFlag) const
 
void SetMetaDataDictionary (const MetaDataDictionary &rhs)
 
virtual void SetReferenceCount (int) override
 
virtual void UnRegister () const noexceptoverride
 
virtual void SetObjectName (std::string _arg)
 
virtual const std::string & GetObjectName () const
 
- Public Member Functions inherited from itk::LightObject
virtual void Delete ()
 
virtual int GetReferenceCount () const
 
 itkCloneMacro (Self)
 
void Print (std::ostream &os, Indent indent=0) const
 

Static Public Member Functions

static SimpleFastMutexLockGetLockMutex ()
 
static int GetPlanRigor ()
 
static std::string GetPlanRigorName (const int &value)
 
static int GetPlanRigorValue (const std::string &name)
 
static std::string GetWisdomFileDefaultBaseName ()
 
static void SetPlanRigor (const int &v)
 
static void SetPlanRigor (const std::string &name)
 
static void SetWisdomFilenameGenerator (WisdomFilenameGeneratorBase *wfg)
 
static void SetNewWisdomAvailable (const bool &v)
 
static bool GetNewWisdomAvailable ()
 
static void SetReadWisdomCache (const bool &v)
 
static bool GetReadWisdomCache ()
 
static void SetWriteWisdomCache (const bool &v)
 
static bool GetWriteWisdomCache ()
 
static void SetWisdomCacheBase (const std::string &v)
 
static std::string GetWisdomCacheBase ()
 
static bool ImportWisdomFileDouble (const std::string &fname)
 
static bool ExportWisdomFileDouble (const std::string &fname)
 
static bool ImportWisdomFileFloat (const std::string &fname)
 
static bool ExportWisdomFileFloat (const std::string &fname)
 
static bool ImportDefaultWisdomFileDouble ()
 
static bool ExportDefaultWisdomFileDouble ()
 
static bool ImportDefaultWisdomFileFloat ()
 
static bool ExportDefaultWisdomFileFloat ()
 
- Static Public Member Functions inherited from itk::Object
static bool GetGlobalWarningDisplay ()
 
static void GlobalWarningDisplayOff ()
 
static void GlobalWarningDisplayOn ()
 
static Pointer New ()
 
static void SetGlobalWarningDisplay (bool flag)
 
- Static Public Member Functions inherited from itk::LightObject
static void BreakOnError ()
 
static Pointer New ()
 

Private Member Functions

virtual ::itk::LightObject::Pointer CreateAnother () const
 
 FFTWGlobalConfiguration ()
 
 FFTWGlobalConfiguration (const Self &)
 
void operator= (const Self &)
 
 ~FFTWGlobalConfiguration ()
 

Static Private Member Functions

static Pointer GetInstance ()
 
static Pointer New ()
 

Private Attributes

SimpleFastMutexLock m_Lock
 
bool m_NewWisdomAvailable
 
int m_PlanRigor
 
bool m_ReadWisdomCache
 
std::string m_WisdomCacheBase
 
WisdomFilenameGeneratorBasem_WisdomFilenameGenerator
 
bool m_WriteWisdomCache
 

Static Private Attributes

static SimpleFastMutexLock m_CreationLock
 
static Pointer m_Instance
 

Additional Inherited Members

- Protected Member Functions inherited from itk::Object
 Object ()
 
bool PrintObservers (std::ostream &os, Indent indent) const
 
virtual void PrintSelf (std::ostream &os, Indent indent) const override
 
virtual void SetTimeStamp (const TimeStamp &time)
 
virtual ~Object ()
 
- Protected Member Functions inherited from itk::LightObject
virtual LightObject::Pointer InternalClone () const
 
 LightObject ()
 
virtual void PrintHeader (std::ostream &os, Indent indent) const
 
virtual void PrintTrailer (std::ostream &os, Indent indent) const
 
virtual ~LightObject ()
 
- Protected Attributes inherited from itk::LightObject
AtomicInt< int > m_ReferenceCount
 

Member Typedef Documentation

Definition at line 175 of file itkFFTWGlobalConfiguration.h.

Definition at line 176 of file itkFFTWGlobalConfiguration.h.

Definition at line 174 of file itkFFTWGlobalConfiguration.h.

Standard class typedefs.

Definition at line 172 of file itkFFTWGlobalConfiguration.h.

Definition at line 173 of file itkFFTWGlobalConfiguration.h.

Constructor & Destructor Documentation

itk::FFTWGlobalConfiguration::FFTWGlobalConfiguration ( )
private
itk::FFTWGlobalConfiguration::~FFTWGlobalConfiguration ( )
private
itk::FFTWGlobalConfiguration::FFTWGlobalConfiguration ( const Self )
private

Member Function Documentation

virtual ::itk::LightObject::Pointer itk::FFTWGlobalConfiguration::CreateAnother ( ) const
privatevirtual

Create an object from an instance, potentially deferring to a factory. This method allows you to create an instance of an object that is exactly the same type as the referring object. This is useful in cases where an object has been cast back to a base class.

Reimplemented from itk::Object.

static bool itk::FFTWGlobalConfiguration::ExportDefaultWisdomFileDouble ( )
static

Import or export some wisdom for the type double to/from the default file

static bool itk::FFTWGlobalConfiguration::ExportDefaultWisdomFileFloat ( )
static

Import or export some wisdom for the type float to/from the default file

static bool itk::FFTWGlobalConfiguration::ExportWisdomFileDouble ( const std::string &  fname)
static

Import or export some wisdom for the type double to/from a file

static bool itk::FFTWGlobalConfiguration::ExportWisdomFileFloat ( const std::string &  fname)
static

Import or export some wisdom for the type float to/from a file

static Pointer itk::FFTWGlobalConfiguration::GetInstance ( )
staticprivate

Return the singleton instance with no reference counting.

static SimpleFastMutexLock& itk::FFTWGlobalConfiguration::GetLockMutex ( )
static
virtual const char* itk::FFTWGlobalConfiguration::GetNameOfClass ( ) const
virtual

Run-time type information (and related methods).

Reimplemented from itk::Object.

static bool itk::FFTWGlobalConfiguration::GetNewWisdomAvailable ( )
static

Set/Get wether a new wisdom is available compared to the initial state. If a new wisdom is available, the wisdoms may be written to the cache file

static int itk::FFTWGlobalConfiguration::GetPlanRigor ( )
static
static std::string itk::FFTWGlobalConfiguration::GetPlanRigorName ( const int &  value)
static
static int itk::FFTWGlobalConfiguration::GetPlanRigorValue ( const std::string &  name)
static
static bool itk::FFTWGlobalConfiguration::GetReadWisdomCache ( )
static

Set/Get the behavior of wisdom file caching.

If the environmental variable "ITK_FFTW_WRITE_WISDOM_CACHE", is set, then the environmental setting overides default settings. If true, will create a wisdom file in the location

static std::string itk::FFTWGlobalConfiguration::GetWisdomCacheBase ( )
static

Define the directory where the wisdom cache will be placed. The environmental variable ITK_FFTW_WISDOM_CACHE_BASE will override the default behavior.

static std::string itk::FFTWGlobalConfiguration::GetWisdomFileDefaultBaseName ( )
static
Returns
Returns the full path for the file to be written if WriteWisdomCache is set to true. The file name is based on the naming strategy set in SetWisdomFilenameGenerator (defaults to HardwareWisdomFilenameGenerator). The file generated by GetWisdomFileDefaultBaseName() (with an "f" suffix for single precision wisdom files). The environmental variable ITK_FFTW_WISDOM_CACHE_BASE can be used to set the base directory name to place the file name specified by the GetWisdomFileDefaultBaseName(). The default location is the users home account directory.
static bool itk::FFTWGlobalConfiguration::GetWriteWisdomCache ( )
static

Set/Get the behavior of wisdom file caching.

If the environmental variable "ITK_FFTW_WRITE_WISDOM_CACHE", is set, then the environmental setting overides default settings. If true, will create a wisdom file in the location

static bool itk::FFTWGlobalConfiguration::ImportDefaultWisdomFileDouble ( )
static

Import or export some wisdom for the type double to/from the default file

static bool itk::FFTWGlobalConfiguration::ImportDefaultWisdomFileFloat ( )
static

Import or export some wisdom for the type float to/from the default file

static bool itk::FFTWGlobalConfiguration::ImportWisdomFileDouble ( const std::string &  fname)
static

Import or export some wisdom for the type double to/from a file

static bool itk::FFTWGlobalConfiguration::ImportWisdomFileFloat ( const std::string &  fname)
static

Import or export some wisdom for the type float to/from a file

static Pointer itk::FFTWGlobalConfiguration::New ( )
staticprivate

This is a singleton pattern New. There will only be ONE reference to a FFTWGlobalConfiguration object per process. The single instance will be unreferenced when the program exits.

void itk::FFTWGlobalConfiguration::operator= ( const Self )
private
static void itk::FFTWGlobalConfiguration::SetNewWisdomAvailable ( const bool &  v)
static

Set/Get wether a new wisdom is available compared to the initial state. If a new wisdom is available, the wisdoms may be written to the cache file

Referenced by itk::fftw::Proxy< float >::Plan_dft(), itk::fftw::Proxy< double >::Plan_dft(), itk::fftw::Proxy< float >::Plan_dft_c2r(), itk::fftw::Proxy< double >::Plan_dft_c2r(), itk::fftw::Proxy< float >::Plan_dft_r2c(), and itk::fftw::Proxy< double >::Plan_dft_r2c().

static void itk::FFTWGlobalConfiguration::SetPlanRigor ( const int &  v)
static

Set the behavior of wisdom plan creation.

If the environmental variable "ITK_FFTW_PLAN_RIGOR", is set, then the environmental setting overides default settings.

Parameters
vOne of the FFTW planner rigor flags FFTW_ESTIMATE, FFTW_MEASURE, FFTW_PATIENT, FFTW_EXHAUSTIVE
static void itk::FFTWGlobalConfiguration::SetPlanRigor ( const std::string &  name)
static
static void itk::FFTWGlobalConfiguration::SetReadWisdomCache ( const bool &  v)
static

Set/Get the behavior of wisdom file caching.

If the environmental variable "ITK_FFTW_WRITE_WISDOM_CACHE", is set, then the environmental setting overides default settings. If true, will create a wisdom file in the location

static void itk::FFTWGlobalConfiguration::SetWisdomCacheBase ( const std::string &  v)
static

Define the directory where the wisdom cache will be placed. The environmental variable ITK_FFTW_WISDOM_CACHE_BASE will override the default behavior.

static void itk::FFTWGlobalConfiguration::SetWisdomFilenameGenerator ( WisdomFilenameGeneratorBase wfg)
static

allows application developers to create arbitrary rules for auto-generating cache file names. A default cache strategy is set to generate separate cache files for each unique operating system and hardware permutation. Alternate respresentative strategies are available to meet common use cases.

See Also
HardwareWisdomFilenameGenerator
SimpleWisdomFilenameGenerator
HostnameWisdomFilenameGenerator
static void itk::FFTWGlobalConfiguration::SetWriteWisdomCache ( const bool &  v)
static

Set/Get the behavior of wisdom file caching.

If the environmental variable "ITK_FFTW_WRITE_WISDOM_CACHE", is set, then the environmental setting overides default settings. If true, will create a wisdom file in the location

Member Data Documentation

SimpleFastMutexLock itk::FFTWGlobalConfiguration::m_CreationLock
staticprivate

Definition at line 309 of file itkFFTWGlobalConfiguration.h.

Pointer itk::FFTWGlobalConfiguration::m_Instance
staticprivate

Definition at line 308 of file itkFFTWGlobalConfiguration.h.

SimpleFastMutexLock itk::FFTWGlobalConfiguration::m_Lock
private

Definition at line 311 of file itkFFTWGlobalConfiguration.h.

bool itk::FFTWGlobalConfiguration::m_NewWisdomAvailable
private

Definition at line 312 of file itkFFTWGlobalConfiguration.h.

int itk::FFTWGlobalConfiguration::m_PlanRigor
private

Definition at line 313 of file itkFFTWGlobalConfiguration.h.

bool itk::FFTWGlobalConfiguration::m_ReadWisdomCache
private

Definition at line 315 of file itkFFTWGlobalConfiguration.h.

std::string itk::FFTWGlobalConfiguration::m_WisdomCacheBase
private

Definition at line 316 of file itkFFTWGlobalConfiguration.h.

WisdomFilenameGeneratorBase* itk::FFTWGlobalConfiguration::m_WisdomFilenameGenerator
private

Definition at line 319 of file itkFFTWGlobalConfiguration.h.

bool itk::FFTWGlobalConfiguration::m_WriteWisdomCache
private

Definition at line 314 of file itkFFTWGlobalConfiguration.h.


The documentation for this class was generated from the following file: