Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Intel Community
- Software
- Software Development SDKs and Libraries
- Intel® Integrated Performance Primitives
- Retrieving data from specific indices

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

thorant

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-02-2008
04:34 AM

82 Views

Retrieving data from specific indices

I have situation where I have a vector and a set of indices in this vector. The number of indices is equal the number of elements in the vector. Then I want copy the value of the vector at the specific indices over to a second vector. Can IPP (or other intel libraries) be used to perform this task?

I guess you would do something like taking the pointer to the beginning of the vector and add the indices and take the value at this memory location:

B = value_at(A+ix);

Any help would be highly appreciated.

I will use this to perform interpolation. Find the interpolation coefficients based on the closest index to the point you would like to interpolate.

Thor Andreas

PS: Any Intel libraries who does interpolation? spline?

Link Copied

4 Replies

kavermeer

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-09-2008
06:27 AM

82 Views

If you find another solution, please let us know!

Koen

thorant

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-10-2008
09:50 PM

82 Views

I have developed my own interpolation library based on the IPP functions. The library does linear,shifted linear and cubic spline interpolation for 32f and 32fc. But to optimize this library such a function I sugested would be very nice.

Thanks

Thor Andreas

Vladimir_Dudnik

Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

05-27-2008
03:02 AM

82 Views

Hi Andreas,

it seems that SIMD can't be applied efficiently for such algorithm so just a pure C code should be good enough. What do you think?

Regards,

Vladimir

thorant

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

05-27-2008
04:54 AM

82 Views

Hi Vladimir,

Sounds reasonable. I did not really expect to find such an operation either. I though that there might have been a routine that could e.g. load a 32bit value from 4 memory locations at the same time, but that migtht not be that easy to implement

. Doing this by using a regular for loop works OK though.

What I am doing is this:

for(int k=0;k{

iKhat = (int)floor(pTi);

iKhat = max(0,iKhat); iKhat = min(iKhat,pLength-2);

iTfractional = pTi- iKhat;

Out= iCoefs[iKhat+1]*iTfractional + iCoefs[iKhat]*(1.0f-iTfractional);

}

The flooring,max/min, the subtraction,addition and multiplication can be done using SIMD, but its the retrieving of the coefs from the remapped positions kHat which is not possible to do using some kind of SIMD. But this might not be so performance degrading.

Thanks,

Thor Andreas

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

For more complete information about compiler optimizations, see our Optimization Notice.