
Mathias Gaunard a écrit :
It is possible to do better than posix_memalign. When you use posix_memalign, you do not provide the alignment information when freeing the memory. This does reduce the efficiency of posix_memalign.
In C++, however, you always know the alignment of the memory when you free it.
I just checked this out indeed. Good to know for later.
I'm fairly sure there is already a library that does just that.
Yes I just rediscovered it myself too.
-> typed_bitfield that wraps a type T and a properly sized byte array and provide proper byte access operator[]. Useful for decomposing large types into bytes for low level operations.
aligned_storage from type traits? Hmmm, guess I have to watch this but I don't think it does what I think it does. I'll have a look. Mind you that if it's already done, then that's less for me to maintain. How would it work without writing vec<float, 4> k = {5, 5, 5, 5}; ?
How can the minimum of a vector yield a vector? And isn't that already provided by Boost.uBlas?
Guess I typed this too early or too late in the evening/morning. More details : vec<T> encapsulates ONE sidm register, not a array. So the type is enough to know, for a given platform, how many component fits in the SIMD type (basically size of vector = 16/sizeof(T) for 128 bits wide SIMD extension, which is ofc handled correctly for less or greater extension). Then again, there is a float missing before r as the min is indeed a scalar As for uBlas, uBlas handle array of data and may use SIMD extension. This library provide a POD like type for SIMD values. -- ___________________________________________ Joel Falcou - Assistant Professor PARALL Team - LRI - Universite Paris Sud XI Tel : (+33)1 69 15 66 35