[Numpy-discussion] Objected-oriented SIMD API for Numpy

Mathieu Blondel mathieu at mblondel.org
Wed Oct 21 23:32:13 EDT 2009


On Thu, Oct 22, 2009 at 11:31 AM, Sturla Molden <sturla at molden.no> wrote:
> Mathieu Blondel skrev:
>> Hello,
>>
>> About one year ago, a high-level, objected-oriented SIMD API was added
>> to Mono. For example, there is a class Vector4f for vectors of 4
>> floats and this class implements methods such as basic operators,
>> bitwise operators, comparison operators, min, max, sqrt, shuffle
>> directly using SIMD operations.
> I think you are confusing SIMD with Intel's MMX/SSE instruction set.

OK, I should have said "Object-oriented SIMD API that is implemented
using hardware SIMD instructions".

And when an ISA doesn't allow to perform a specific operation in only
one instruction (say the absolute value of the differences), the
operation can be implemented in terms of other instructions.

> SIMD instructions in hardware for length-4 vectors are mostly useful for
> 3D graphics. But they are not used a lot for that purpose, because GPUs
> are getting common. SSE is mostly for rendering 3D graphics without a
> GPU. There is nothing that prevents NumPy from having a Vector4f dtype,
> that internally stores four float32 and is aligned at 16 byte
> boundaries. But it would not be faster than the current float32 dtype.
> Do you know why?

Yes I know because this has already been explained in this very thread
by someone before you!


Mathieu



More information about the NumPy-Discussion mailing list