Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

Question about ippiCopyManaged_8u_C1R function

wesky1984
Beginner
365 Views
I am trying to copy my own 2D matrix data to ipp8u by usingippiCopyManaged_8u_C1R.
But it couldn't copy correctly:
Only the first row of matrix can be copiedproperly. The others are wrong.
The following is my code:
a[size.width*1] is not equal to ipp_template[step*1], which means copying is wrong.
Any wrong in my code?
[cpp]#include #include #include #include #include "ipp.h" //use ipp 7.0 library int main (void){ IppiSize size; size.width = 512; //if it's less than 256, the copying is ok size.height = 10; __declspec(align(32)) unsigned char* a = (unsigned char*)malloc(size.width*size.height); //2d Matrix data for(int i = 0; i < size.width*size.height; i++) { a = i %255; } int step; Ipp8u *ipp_template = ippiMalloc_8u_C1( size.width, size.height, &step); IppStatus err = ippiCopyManaged_8u_C1R((Ipp8u*)a, (Ipp8u)size.width, ipp_template, step, size, IPP_TEMPORAL_COPY); bool bEqual = (a[size.width*1] == ipp_template[step*1]); //No equal, why? return 0; } [/cpp]

0 Kudos
2 Replies
Ying_H_Intel
Employee
365 Views
Hi
0 Kudos
wesky1984
Beginner
365 Views
I didn't notice the type before.
Thank you very much!
0 Kudos
Reply