天天看點

語言識别之IPP簡介IPP使用入門

IPP使用入門

1、Exmaple

IPP入門的話,直接看example就好,快準狠!看完直接開始寫代碼。

語言識别之IPP簡介IPP使用入門

2、Special

對于IPP裡面的東西做一些特别的說明。

資料類型:

語言識别之IPP簡介IPP使用入門

原語細節:

語言識别之IPP簡介IPP使用入門

描述語言:

語言識别之IPP簡介IPP使用入門

依賴範圍:

語言識别之IPP簡介IPP使用入門
語言識别之IPP簡介IPP使用入門

連結選擇:

我們經常看到動态連結和靜态連結,what 是動态連結和靜态連結?

語言識别之IPP簡介IPP使用入門
語言識别之IPP簡介IPP使用入門

3、Function

Init/InitCpu(初始化CPU)

The ippInit function detects the processor type and sets the dispatcher to use the processor-specific code of the Intel® IPP library corresponding to the instruction set capabilities available.

In some cases like debugging and performance analysis, you may want to get the data on the difference between various processor-specific codes on the same machine. Use the ippInitCpu function for this. This function sets the dispatcher to use the processor-specific code according to the specified processor type without querying the system.

The ippInit and ippInitCpu functions are a part of the ippCore library.

GetStatusString(直接将語音轉化為文本)

The ippGetStatusString function decodes the numeric status return value of Intel® IPP functions and converts them to a human readable text:

status= ippInit();
        if( status != ippStsNoErr ) {
                printf("IppInit() Error:\n");
                printf("%s\n", ippGetStatusString(status) );
                return -1;
        }
      

The ippGetStatusString function is a part of the ippCore library.

GetLibVersion(擷取庫的版本)

Each domain has its own GetLibVersion function that returns information about the library layer in use from the dispatcher. The code snippet below demonstrates the usage of the ippiGetLibVersion from the image processing domain:

const IppLibraryVersion* lib = ippiGetLibVersion();
printf(“%s %s %d.%d.%d.%d\n”, lib->Name, lib->Version,
lib->major, lib->minor, lib->majorBuild, lib->build);
      

Use this function in combination with ippInitCpu to compare the output of different implementations on the same machine.

Malloc/Free(記憶體申請和釋放)

Intel IPP functions provide better performance if they process data with aligned pointers. Intel IPP provides the following functions to ensure that data is 32-byte aligned:

void* ippMalloc(int length)
void ippFree(void* ptr)
      

The ippMalloc function provides a 32-byte aligned buffer, and the ippFree function frees it.

The signal and image processing libraries provide ippsMalloc and ippiMalloc functions, respectively, to allocate a 32-byte aligned buffer that can be freed by the ippsFree and ippiFree functions.

  1. Compute the size of the required buffer using the <operation function>GetSize function.
  2. Set up any buffers needed for initialization.
  3. Initialize the specification structure for the operation.
  4. Free the buffers need for initialization only.
  5. Set up working buffers for the main operation.
  6. Do the main operation.
  7. Free the specification and working buffers.

Thread Managing(調用幾個線程)

By default, the number of threads for Intel IPP threaded libraries follows the OpenMP* default, which is the number of logical processors visible to the operating system. If the value of the OMP_NUM_THREADS environment variable is less than the number of processors, then the number of threads for Intel IPP threaded libraries equals the value of the OMP_NUM_THREADS environment variable.

To configure the number of threads used by Intel IPP internally, at the very beginning of an application call the ippSetNumThreads(n) function, where n is the desired number of threads (1, ...). To disable internal parallelization, call the ippSetNumThreads(1) function.

Getting Information on Number of Threads(擷取線程數目)

To find the number of threads created by the Intel IPP, call the ippGetNumThreads function.

     到目前為止估計你已經對于IPP有那麼多多少少一點認識,接下來就去看example吧!或者直接百度,我隻是閑的蛋疼才看這些的

語言識别之IPP簡介IPP使用入門

PS:如果你想進行自動補全的話,按Alt + RIGHT ARROW or Ctrl + SPACEBAR。

繼續閱讀