[vsipl++] vsip::Vector and mlock
Stefan Seefeld
stefan at codesourcery.com
Thu Nov 6 13:21:10 UTC 2008
Gaetano Mendola wrote:
> I need to do the same with vsip::vector<T> becouse I'm
> replacing in my application that std::vector with a
> vsip::Vector (I need to perform an FFT on it), is it
> safe do:
>
> vsip::Vector<T> myVector;
> ...
> mlock(&myVector(0), sizeof(t)*myVector.size());
While Sourcery VSIPL++ provides direct data access, this is quite a bit
more involved than the above, as VSIPL++ views encapsulate memory
management quite differently compared to std::vector<>.
I certainly wouldn't expect you to be able to replace std::vector by
vsip::Vector in your program without any additional porting effort.
Sourcery VSIPL++ provides its own means to control memory management, if
you really want (memory pools, NUMA, etc.).
However, before trying to apply a very specific optimization strategy
such as the above, I would suggest you profile the application once it
is ported to VSIPL++, to get a clear idea where the bottlenecks are. May
be locking memory is indeed helpful, but chances are there are other
places that have a bigger impact.
Regards,
Stefan
--
Stefan Seefeld
CodeSourcery
stefan at codesourcery.com
(650) 331-3385 x718
More information about the vsipl++
mailing list