[Numpy-discussion] Objected-oriented SIMD API for Numpy
Wed Oct 21 00:44:39 CDT 2009
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. You can have a look at the following
pages for further details:
http://tirania.org/blog/archive/2008/Nov-03.html (blog post)
http://go-mono.com/docs/index.aspx?tlink=0@N%3aMono.Simd (API reference)
It seems to me that such an API would possibly be a great fit in Numpy
too. It would also be possible to add classes that don't directly map
to SIMD types. For example, Vector8f can easily be implemented in
terms of 2 Vector4f. In addition to vectors, additional API may be
added to support operations on matrices of fixed width or height.
I search the archives for similar discussions but I only found a
discussion about memory-alignment so I hope I am not restarting an
existing discussion here. Memory-alignment is an import related issue
since non-aligned movs can tank the performance.
Any thoughts? I don't know the Numpy code base yet but I'm willing to
help if such an effort is started.
More information about the NumPy-Discussion