[Numpy-discussion] From CorePy: New ExtBuffer object
Stéfan van der Walt
Mon Jun 8 20:42:22 CDT 2009
Just a heads-up on something they're talking about over at CorePy.
---------- Forwarded message ----------
From: Andrew Friedley <firstname.lastname@example.org>
Subject: [Corepy-devel] New ExtBuffer object
To: CorePy Development <email@example.com>
I wrote a new buffer object today, called ExtBuffer, that can be used
with libraries/objects that support the Python 2.6 buffer interface
(e.g. NumPy). This brings page-aligned memory (and huge-page) support
to anything that can use a buffer object (eg NumPy arrays). ExtBuffer
can also be initialized using a pointer to an existing memory region.
This allows you, for example, to set up a NumPy array spanning a Cell
SPU's memory mapped local store, accessing LS like any other NumPy
The ExtBuffer is included as part of the 'corepy.lib.extarray' module,
and can be used like this:
import corepy.lib.extarray as extarray
buf = extarray.extbuffer(4096, huge = True)
array = numpy.frombuffer(buf, dtype=numpy.int32)
I wrote a some documentation here:
If anyone has any questions, thoughts, ideas, bugs, etc, please let me know!
Corepy-devel mailing list
More information about the Numpy-discussion