- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
There is not in-place function ippsAdd_32u_I.
Nevertheless is it allowed to to use same source and destination array ?:
Ipp32u a[5];
Ipp32u b[5];
ippsAdd_32u( a, b, b, 5 )
Best regards,
Markus
There is not in-place function ippsAdd_32u_I.
Nevertheless is it allowed to to use same source and destination array ?:
Ipp32u a[5];
Ipp32u b[5];
ippsAdd_32u( a, b, b, 5 )
Best regards,
Markus
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Markus,
we do separate in-place and out-of-place functions at API level specifically to allow optimized code do not worry about arrays overlapping for out-of-place case. This allow to achieve additional performance benefits. Although forsome particular functions and particular cpu-specific optimization out-of-place case could work the same way as in-place caseit is notguaranteed.
Regards,
Vladimir
we do separate in-place and out-of-place functions at API level specifically to allow optimized code do not worry about arrays overlapping for out-of-place case. This allow to achieve additional performance benefits. Although forsome particular functions and particular cpu-specific optimization out-of-place case could work the same way as in-place caseit is notguaranteed.
Regards,
Vladimir
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I think not possible to use same source and destination array for not in-place function ippsAdd_32u.
As mentioned in the documentation, pSrcDst is Pointer to the source and destination vector for in-place operation.
Good question.
Regards,
Naveen Gv
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Actually I did some testing and it is working but should I expect to have some undefined behaviour sometimes ?
output:
u32a
1 2 3 4 5 6 7 8 9 10
u32b
1 4 9 16 25 36 49 64 81 100
ippStsNoErr: No error, it's OK
result u32b
2 6 12 20 30 42 56 72 90 110
code:
const int len = 10;
Ipp32u * u32a = ippsMalloc_32u( len );
Ipp32u * u32b = ippsMalloc_32u( len );
for( int i=0; i < len; i++ )
{
u32a = i+1;
u32b = ( i+1 ) * ( i+1 );
}
cout << "u32a" << endl;
for( int i=0; i < len; i++ )
{
cout << u32a << " ";
}
cout << endl << endl;
cout << "u32b" << endl;
for( int i=0; i < len; i++ )
{
cout << u32b << " ";
}
cout << endl << endl;
IppStatus st = ippsAdd_32u( u32a, u32b, u32b, len );
cout << ippGetStatusString( st ) << endl << endl;
cout << "result u32b" << endl;
for( int i=0; i < len; i++ )
{
cout << u32b << " ";
}
cout << endl << endl;
Best regards,
Markus
Actually I did some testing and it is working but should I expect to have some undefined behaviour sometimes ?
output:
u32a
1 2 3 4 5 6 7 8 9 10
u32b
1 4 9 16 25 36 49 64 81 100
ippStsNoErr: No error, it's OK
result u32b
2 6 12 20 30 42 56 72 90 110
code:
const int len = 10;
Ipp32u * u32a = ippsMalloc_32u( len );
Ipp32u * u32b = ippsMalloc_32u( len );
for( int i=0; i < len; i++ )
{
u32a = i+1;
u32b = ( i+1 ) * ( i+1 );
}
cout << "u32a" << endl;
for( int i=0; i < len; i++ )
{
cout << u32a << " ";
}
cout << endl << endl;
cout << "u32b" << endl;
for( int i=0; i < len; i++ )
{
cout << u32b << " ";
}
cout << endl << endl;
IppStatus st = ippsAdd_32u( u32a, u32b, u32b, len );
cout << ippGetStatusString( st ) << endl << endl;
cout << "result u32b" << endl;
for( int i=0; i < len; i++ )
{
cout << u32b << " ";
}
cout << endl << endl;
Best regards,
Markus
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Markus,
we do separate in-place and out-of-place functions at API level specifically to allow optimized code do not worry about arrays overlapping for out-of-place case. This allow to achieve additional performance benefits. Although forsome particular functions and particular cpu-specific optimization out-of-place case could work the same way as in-place caseit is notguaranteed.
Regards,
Vladimir
we do separate in-place and out-of-place functions at API level specifically to allow optimized code do not worry about arrays overlapping for out-of-place case. This allow to achieve additional performance benefits. Although forsome particular functions and particular cpu-specific optimization out-of-place case could work the same way as in-place caseit is notguaranteed.
Regards,
Vladimir

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page