18 #ifndef __itkFFTWGlobalConfiguration_h
19 #define __itkFFTWGlobalConfiguration_h
24 #if defined(ITK_USE_FFTWF) || defined(ITK_USE_FFTWD)
28 #include "itksys/SystemTools.hxx"
29 #include "itksys/SystemInformation.hxx"
63 #define FFTWPathSep "\\"
65 #define FFTWPathSep "/"
99 return baseCacheDirectory+
FFTWPathSep+
".itksimple.wisdom";
109 itksys::SystemInformation hostInfo;
110 hostInfo.RunOSCheck();
111 return baseCacheDirectory+
FFTWPathSep +
".itkwisdomfftw"+
FFTWPathSep+
".itk_"+hostInfo.GetHostname()+
".wisdom";
136 itksys::SystemInformation hardwareInfo;
137 hardwareInfo.RunCPUCheck();
138 hardwareInfo.RunOSCheck();
139 hardwareInfo.RunMemoryCheck();
140 std::stringstream OSD(
"");
144 OSD << hardwareInfo.GetOSName() <<
"_";
148 OSD << hardwareInfo.GetOSRelease() <<
"_";
152 OSD << hardwareInfo.GetOSVersion() <<
"_";
156 OSD << hardwareInfo.GetOSPlatform() <<
"_";
160 const char *
const bitsizeString=( hardwareInfo.Is64Bits() ) ?
"64_":
"32_";
161 OSD << bitsizeString;
165 OSD << hardwareInfo.GetNumberOfLogicalCPU() <<
"x"<< hardwareInfo.GetNumberOfPhysicalCPU() <<
"_";
169 OSD << hardwareInfo.GetVendorString() <<
"_";
173 OSD << hardwareInfo.GetVendorID() <<
"_";
177 OSD << hardwareInfo.GetTypeID() <<
"_";
181 OSD << hardwareInfo.GetFamilyID() <<
"_";
185 OSD << hardwareInfo.GetModelID() <<
"_";
189 OSD << hardwareInfo.GetSteppingCode();
192 std::string noSpaceStr=OSD.str();
194 noSpaceStr.erase(std::remove_if(noSpaceStr.begin(), noSpaceStr.end(),::isspace), noSpaceStr.end());
430 itkFactorylessNewMacro(
Self);
FFTWGlobalConfiguration()
void SetUseModelID(const bool flag)
Critical section locking class that can be allocated on the stack.
WisdomFilenameGeneratorBase * m_WisdomFilenameGenerator
static SimpleFastMutexLock & GetLockMutex()
static void SetWriteWisdomCache(const bool &v)
Set the behavior of wisdom file caching.
static std::string GetWisdomFileDefaultBaseName()
static bool GetWriteWisdomCache()
HardwareWisdomFilenameGenerator()
bool GetUseOSName() const
static bool GetReadWisdomCache()
static bool ExportDefaultWisdomFileFloat()
bool GetUseOSVersion() const
bool GetUseOSPlatform() const
static std::string GetPlanRigorName(const int &value)
static std::string GetWisdomCacheBase()
virtual std::string GenerateWisdomFilename(const std::string baseCacheDirectory) const ITK_OVERRIDE
static bool ImportWisdomFileFloat(const std::string &fname)
WisdomFilenameGeneratorBase()
SimpleFastMutexLock m_Lock
FFTWGlobalConfiguration Self
bool m_UseNumberOfProcessors
static bool ExportWisdomFileFloat(const std::string &fname)
static bool GetNewWisdomAvailable()
bool GetUseNumberOfProcessors() const
static bool ImportDefaultWisdomFileFloat()
static bool ExportWisdomFileDouble(const std::string &fname)
void operator=(const Self &)
virtual std::string GenerateWisdomFilename(const std::string baseCacheDirectory) const =0
bool GetUseTypeID() const
std::string m_WisdomFilename
static bool ExportDefaultWisdomFileDouble()
ManualWisdomFilenameGenerator(const std::string wfn)
void SetUseNumberOfProcessors(const bool flag)
static void SetReadWisdomCache(const bool &v)
Set the behavior of wisdom file caching.
static Pointer m_Instance
static Pointer GetInstance()
void SetUseOSBitSize(const bool flag)
static SimpleFastMutexLock m_CreationLock
void SetUseFamilyID(const bool flag)
void SetUseOSName(const bool flag)
static bool ImportDefaultWisdomFileDouble()
bool GetUseFamilyID() const
static void SetPlanRigor(const std::string &name)
bool GetUseModelID() const
SimpleFastMutexLock MutexType
virtual ~WisdomFilenameGeneratorBase()
static int GetPlanRigor()
void SetUseOSRelease(const bool flag)
void SetUseVendorString(const bool flag)
static void SetPlanRigor(const int &v)
Set the behavior of wisdom plan creation.
bool GetUseSteppingCode() const
static void SetNewWisdomAvailable(const bool &v)
virtual std::string GenerateWisdomFilename(const std::string) const ITK_OVERRIDE
bool GetUseVendorString() const
bool GetUseOSBitSize() const
void SetWisdomFilename(const std::string wfn)
static void SetWisdomFilenameGenerator(WisdomFilenameGeneratorBase *wfg)
allows application developers to create arbitrary rules for auto-generating cache file names...
bool GetUseOSRelease() const
virtual std::string GenerateWisdomFilename(const std::string baseCacheDirectory) const ITK_OVERRIDE
static bool ImportWisdomFileDouble(const std::string &fname)
~FFTWGlobalConfiguration()
static void SetWisdomCacheBase(const std::string &v)
Define the directory where the wisdom cache will be placed. The environmental variable ITK_FFTW_WISDO...
static int GetPlanRigorValue(const std::string &name)
void SetUseSteppingCode(const bool flag)
void SetUseTypeID(const bool flag)
void SetUseOSVersion(const bool flag)
std::string m_WisdomCacheBase
SmartPointer< const Self > ConstPointer
Base class for most ITK classes.
bool m_NewWisdomAvailable
void SetUseOSPlatform(const bool flag)
virtual std::string GenerateWisdomFilename(const std::string baseCacheDirectory) const ITK_OVERRIDE
SmartPointer< Self > Pointer