To describe an object by Standard method, specify one pointer to object's data and several strides. When the operation is performed on a single matrix or a vector, the required pointer is the pointer to the first object element. When the operation is performed on matrix or vector arrays, the required pointer is the pointer to the first element in the first matrix (vector) of an array. When the operation is performed on arrays of constants, the required pointer is the pointer to the first constant of an array.
The following fragment of C code describes a regular matrix array shown in Figure “Standard Description”, A:
// Allocate memory for the array of continuous matrices
Ipp32f pMatrices[5*5*3];
// Set stride2
int stride2 = sizeof(Ipp32f)*2;
// Set stride1
int stride1 = sizeof(Ipp32f)*10;
// Set stride0
int stride0 = sizeof(Ipp32f)*25;
* * *
// Call IPP MX function
ippm<Operation>_ma_32f(..., pMatrices, stride0, stride1, stride2, ...);
The following code fragment represents description for a regular array of vectors shown in Figure “Standard Description”, B:
// Allocate memory for the array of continuous vectors
Ipp32f pVectors[5*3];
// Set stride2
int stride2 = sizeof(Ipp32f)*2;
// Set stride0
int stride0 = sizeof(Ipp32f)*5;
* * *
// Call IPP MX function
ippm<Operation>_va_32f(...,pVectors, stride0, stride2, ...);
Single matrices and vectors are described in the same way without the stride 0 specification.
The following code fragment represents description for a regular array of constants shown in Figure “Standard Description”, C:
// Allocate memory for the array of continuous constants
// example is for count=3
Ipp32f pVal[5*3];
// Set stride0
int valStride0 = sizeof(Ipp32f)*5;
* * *
// Call IPP MX function
ippm<Operation>_ca_32f(..., pVal, valStride0, ...);
Strides are calculated in bytes.
Continuous objects also belong to the general regular case. Thus, all strides including stride 2, must be specified.
When operating on a matrix array, shown in Figure “Standard Description (Continuous Object)”, case A, specify the following strides (strides are calculated for Ipp32f data type):
int stride2 = sizeof(Ipp32f);
int stride1 = stride2*width;
int stride0 = stride1*height;
When operating on a vector array, shown in Figure “Standard Description (Continuous Object)”, case B, specify the following strides
int stride2 = sizeof(Ipp32f);
int stride0 = stride2*length;
When operating on an array of constants, shown in Figure “Standard Description (Continuous Object)”, case C, specify the following stride:
int stride0 = sizeof(Ipp32f);
Copyright © 2000 - 2011, Intel Corporation. All rights reserved.