- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear all,
How can I write the following code using the mkl (or other Intel library) optimized vector routines? The main idea is to remove the for in the "main" code.
for (v=vsize;v--;){
if (estimate
estimate
} else {
estimate
}
}
Thanks in advance,
Luis
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Luis,
there are no such routines into MKL, but you can find similar functionality in Intel IPP.
Please see into signal processing functionality - threshold functions, which performs the threshold operation on the elements of a vector by limiting the element values by specified value.
as an example:
IppStatus ippsThreshold_64f(const Ipp64f* pSrc, Ipp64f* pDst, int len, Ipp64f level, IppCmpOp relOp);
where Ipp64f == double precison
Please let us know if any furher guiestions or example .
--Gennady
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
for (v=vsize;v--;){
if (estimate
estimate
} else {
estimate
}
}
You should be able to vectorize this with icc, something along the line of
#pragma vector always
for (v=0; v
If you don't like for() you should be using Fortran:
estimate(0:vsize-1) = merge(200d0,1d0,estimate(0:vsize-1) > .05d0)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page