Image Component Library (ICL)
IppInterface.h
Go to the documentation of this file.
1 /********************************************************************
2 ** Image Component Library (ICL) **
3 ** **
4 ** Copyright (C) 2006-2013 CITEC, University of Bielefeld **
5 ** Neuroinformatics Group **
6 ** Website: www.iclcv.org and **
7 ** http://opensource.cit-ec.de/projects/icl **
8 ** **
9 ** File : ICLUtils/src/ICLUtils/IppInterface.h **
10 ** Module : ICLUtils **
11 ** Authors: Viktor Richter **
12 ** **
13 ** **
14 ** GNU LESSER GENERAL PUBLIC LICENSE **
15 ** This file may be used under the terms of the GNU Lesser General **
16 ** Public License version 3.0 as published by the **
17 ** **
18 ** Free Software Foundation and appearing in the file LICENSE.LGPL **
19 ** included in the packaging of this file. Please review the **
20 ** following information to ensure the license requirements will **
21 ** be met: http://www.gnu.org/licenses/lgpl-3.0.txt **
22 ** **
23 ** The development of this software was supported by the **
24 ** Excellence Cluster EXC 277 Cognitive Interaction Technology. **
25 ** The Excellence Cluster EXC 277 is a grant of the Deutsche **
26 ** Forschungsgemeinschaft (DFG) in the context of the German **
27 ** Excellence Initiative. **
28 ** **
29 ********************************************************************/
30 
31 #pragma once
32 
33 #include <map>
34 
35 #include <ICLUtils/BasicTypes.h>
36 #include <ICLUtils/Exception.h>
37 #include <ICLUtils/Mutex.h>
38 
39 /*
40 TODOS:
41 - this represents IppStatus-enum as signed integer. is that okay?
42 - cleaner debug output
43 - choose IPP environment variables
44 - what about building icl? something like IppInterface::available()?
45 - windows version
46 */
47 
48 namespace icl{
49  namespace utils{
50 
52  public:
53  ICLDynamicLibLoadException (const char* error) throw() :
54  ICLException (std::string("Can't load library: ") + std::string(error)) {}
55  virtual ~ICLDynamicLibLoadException() throw() {}
56  };
58  public:
59  ICLDynamicFunctionLoadException (const char* error) throw() :
60  ICLException (std::string("Can't load function from library: ") + std::string(error)) {}
61  virtual ~ICLDynamicFunctionLoadException() throw() {}
62  };
63 
65  public:
67  static IppInterface* get();
68 
70  static icl32s statusNoError();
71 
73  const char* ippGetStatusString(icl32s StsCode);
74 
76  const icl32f* pSrc, icl32s srcStride1, icl32s srcStride2, icl32f* pBuffer,
77  icl32f* pDstVectors, icl32s dstStride1, icl32s dstStride2,
78  icl32f* pDstValues, icl32s widthHeight);
79 
81  const icl64f* pSrc, icl32s srcStride1, icl32s srcStride2, icl64f* pBuffer,
82  icl64f* pDstVectors, icl32s dstStride1, icl32s dstStride2,
83  icl64f* pDstValues, icl32s widthHeight);
84 
86  const icl32f* pSrc, icl32s srcStride1, icl32s srcStride2, icl32f* pBuffer,
87  icl32f* pDst, icl32s dstStride1, icl32s dstStride2, icl32s widthHeight);
88 
90  const icl64f* pSrc, icl32s srcStride1, icl32s srcStride2, icl64f* pBuffer,
91  icl64f* pDst, icl32s dstStride1, icl32s dstStride2, icl32s widthHeight);
92 
94  const icl32f* pSrc, icl32s srcStride1, icl32s srcStride2, icl32s widthHeight,
95  icl32f* pBuffer, icl32f* pDst);
96 
98  const icl64f* pSrc, icl32s srcStride1, icl32s srcStride2, icl32s widthHeight,
99  icl64f* pBuffer, icl64f* pDst);
100 
102 
117  void* ippSymbolPointer(std::string symbol_name, std::string lib_name="");
118 
119 
120  private:
122  IppInterface();
123  ~IppInterface();
124 
126  std::map<std::string,void*> m_LibHandles;
127 
131  std::map<std::string,void*> m_FunctionHandles;
132  };
133 
134 
135  } // namespace utils
136 } // namespace icl
137 
virtual ~ICLDynamicLibLoadException()
Definition: IppInterface.h:55
ICLDynamicLibLoadException(const char *error)
Definition: IppInterface.h:53
undocument this line if you encounter any issues!
Definition: Any.h:37
Class interface for un-copyable classes.
Definition: Uncopyable.h:64
Definition: IppInterface.h:51
IppInterface()
private constructor to ensure singleton
static icl32s statusNoError()
returns the no error status value of ipp as icl32s
ICLException(const std::string &msg)
Definition: Exception.h:45
icl32s ippmEigenValuesVectorsSym_m_64f(const icl64f *pSrc, icl32s srcStride1, icl32s srcStride2, icl64f *pBuffer, icl64f *pDstVectors, icl32s dstStride1, icl32s dstStride2, icl64f *pDstValues, icl32s widthHeight)
icl32s ippmInvert_m_64f(const icl64f *pSrc, icl32s srcStride1, icl32s srcStride2, icl64f *pBuffer, icl64f *pDst, icl32s dstStride1, icl32s dstStride2, icl32s widthHeight)
Ipp32s icl32s
32bit signed integer type for the ICL
Definition: BasicTypes.h:58
void * ippSymbolPointer(std::string symbol_name, std::string lib_name="")
a getter for the address of an ipp symbol determined by given name
Ipp32f icl32f
32Bit floating point type for the ICL
Definition: BasicTypes.h:55
ICLDynamicFunctionLoadException(const char *error)
Definition: IppInterface.h:59
Definition: IppInterface.h:64
Ipp64f icl64f
64Bit floating point type for the ICL
Definition: BasicTypes.h:52
icl32s ippmInvert_m_32f(const icl32f *pSrc, icl32s srcStride1, icl32s srcStride2, icl32f *pBuffer, icl32f *pDst, icl32s dstStride1, icl32s dstStride2, icl32s widthHeight)
static IppInterface * get()
getter function for singleton class
icl32s ippmDet_m_32f(const icl32f *pSrc, icl32s srcStride1, icl32s srcStride2, icl32s widthHeight, icl32f *pBuffer, icl32f *pDst)
icl32s ippmDet_m_64f(const icl64f *pSrc, icl32s srcStride1, icl32s srcStride2, icl32s widthHeight, icl64f *pBuffer, icl64f *pDst)
icl32s ippmEigenValuesVectorsSym_m_32f(const icl32f *pSrc, icl32s srcStride1, icl32s srcStride2, icl32f *pBuffer, icl32f *pDstVectors, icl32s dstStride1, icl32s dstStride2, icl32f *pDstValues, icl32s widthHeight)
std::map< std::string, void * > m_LibHandles
A map holding handles to all dynamically loaded libs.
Definition: IppInterface.h:126
ICLCV_API void error(const char *msg)
Display error message and terminate program.
virtual ~ICLDynamicFunctionLoadException()
Definition: IppInterface.h:61
Definition: IppInterface.h:57
Base class for Exception handling in the ICL.
Definition: Exception.h:42
std::map< std::string, void * > m_FunctionHandles
A map holding handles to all dynamically loaded functions.
Definition: IppInterface.h:131
Mutex m_FunctionHandleMutex
A mutex for the function handle map.
Definition: IppInterface.h:129
const char * ippGetStatusString(icl32s StsCode)
the passed StsCode needs to be an ipp status code, otherwise the behaviour is not defined
Mutex class of the ICL.
Definition: Mutex.h:54