Image Component Library (ICL)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
IppInterface.h
Go to the documentation of this file.
00001 /********************************************************************
00002 **                Image Component Library (ICL)                    **
00003 **                                                                 **
00004 ** Copyright (C) 2006-2013 CITEC, University of Bielefeld          **
00005 **                         Neuroinformatics Group                  **
00006 ** Website: www.iclcv.org and                                      **
00007 **          http://opensource.cit-ec.de/projects/icl               **
00008 **                                                                 **
00009 ** File   : ICLUtils/src/ICLUtils/IppInterface.h                   **
00010 ** Module : ICLUtils                                               **
00011 ** Authors: Viktor Richter                                         **
00012 **                                                                 **
00013 **                                                                 **
00014 ** GNU LESSER GENERAL PUBLIC LICENSE                               **
00015 ** This file may be used under the terms of the GNU Lesser General **
00016 ** Public License version 3.0 as published by the                  **
00017 **                                                                 **
00018 ** Free Software Foundation and appearing in the file LICENSE.LGPL **
00019 ** included in the packaging of this file.  Please review the      **
00020 ** following information to ensure the license requirements will   **
00021 ** be met: http://www.gnu.org/licenses/lgpl-3.0.txt                **
00022 **                                                                 **
00023 ** The development of this software was supported by the           **
00024 ** Excellence Cluster EXC 277 Cognitive Interaction Technology.    **
00025 ** The Excellence Cluster EXC 277 is a grant of the Deutsche       **
00026 ** Forschungsgemeinschaft (DFG) in the context of the German       **
00027 ** Excellence Initiative.                                          **
00028 **                                                                 **
00029 ********************************************************************/
00030 
00031 #pragma once
00032 
00033 #include <map>
00034 
00035 #include <ICLUtils/BasicTypes.h>
00036 #include <ICLUtils/Exception.h>
00037 #include <ICLUtils/Mutex.h>
00038 
00039 /*
00040 TODOS:
00041 - this represents IppStatus-enum as signed integer. is that okay?
00042 - cleaner debug output
00043 - choose IPP environment variables
00044 - what about building icl? something like IppInterface::available()?
00045 - windows version
00046 */
00047 
00048 namespace icl{
00049   namespace utils{
00050 
00051     class ICLDynamicLibLoadException : ICLException {
00052       public:
00053         ICLDynamicLibLoadException (const char* error) throw() :
00054           ICLException (std::string("Can't load library: ") + std::string(error)) {}
00055         virtual ~ICLDynamicLibLoadException() throw() {}
00056     };
00057     class ICLDynamicFunctionLoadException : ICLException {
00058       public:
00059         ICLDynamicFunctionLoadException (const char* error) throw() :
00060           ICLException (std::string("Can't load function from library: ") + std::string(error)) {}
00061         virtual ~ICLDynamicFunctionLoadException() throw() {}
00062     };
00063 
00064     class IppInterface : Uncopyable{
00065       public:
00067         static IppInterface* get();
00068 
00070         static icl32s statusNoError();
00071 
00073         const char* ippGetStatusString(icl32s StsCode);
00074 
00075         icl32s ippmEigenValuesVectorsSym_m_32f(
00076             const icl32f* pSrc, icl32s srcStride1, icl32s srcStride2, icl32f* pBuffer,
00077             icl32f* pDstVectors, icl32s dstStride1, icl32s dstStride2,
00078             icl32f* pDstValues,  icl32s widthHeight);
00079 
00080         icl32s ippmEigenValuesVectorsSym_m_64f(
00081             const icl64f* pSrc, icl32s srcStride1, icl32s srcStride2, icl64f* pBuffer,
00082             icl64f* pDstVectors, icl32s dstStride1, icl32s dstStride2,
00083             icl64f* pDstValues,  icl32s widthHeight);
00084 
00085         icl32s ippmInvert_m_32f(
00086             const icl32f* pSrc, icl32s srcStride1, icl32s srcStride2, icl32f* pBuffer,
00087             icl32f* pDst, icl32s dstStride1, icl32s dstStride2, icl32s widthHeight);
00088 
00089         icl32s ippmInvert_m_64f(
00090             const icl64f* pSrc, icl32s srcStride1, icl32s srcStride2, icl64f* pBuffer,
00091             icl64f* pDst, icl32s dstStride1, icl32s dstStride2, icl32s widthHeight);
00092 
00093         icl32s ippmDet_m_32f(
00094             const icl32f*  pSrc, icl32s srcStride1, icl32s srcStride2, icl32s widthHeight,
00095             icl32f* pBuffer, icl32f*  pDst);
00096 
00097         icl32s ippmDet_m_64f(
00098             const icl64f*  pSrc, icl32s srcStride1, icl32s srcStride2, icl32s widthHeight,
00099             icl64f* pBuffer, icl64f*  pDst);
00100 
00102 
00117         void* ippSymbolPointer(std::string symbol_name, std::string lib_name="");
00118 
00119 
00120       private:
00122         IppInterface();
00123         ~IppInterface();
00124 
00126         std::map<std::string,void*> m_LibHandles;
00127 
00129         Mutex m_FunctionHandleMutex;
00131         std::map<std::string,void*> m_FunctionHandles;
00132     };
00133 
00134 
00135   } // namespace utils
00136 } // namespace icl
00137 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines