On Tue, 5 Apr 2011 15:10:08 -0700, "Eli Stevens (Gmail)" <[email protected]> wrote: > Hello, just a quick FYI: > > Numpy 1.6.0 has added support for half-floats (IEEE 754-2008 16-bit > floating point: > http://en.wikipedia.org/wiki/Half_precision_floating-point_format ). > I've submitted patches to CPython to update the struct module (and, by > inclusion, PEP 3118) for python 3.3 to update the standard to allow > the buffer interface to export half floats (issue here: > http://bugs.python.org/issue11734 ); it seems likely that those > patches will be accepted soon. Likewise, I've submitted (and had > accepted) a patch to numpy that exports the half-floats through the > buffer interface (note that this change doesn't require the changes to > the struct module; it works fine under python 2.7, for example). My > current use case involves trying to work with the data from Cython, > but there's nothing preventing PyOpenCL from accessing such data. > > I'm not certain what kind of uses this might have for PyOpenCL, but I > imagine there might be some benefits to being able to work with > float16s in a more natural way than was available before. > > Unfortunately I'm not in a position where I'll be able to work on > enhancements to PyOpenCL ATM, but I'd be happy to help with questions > or pointers to the CPython or numpy changes as best I can, should > someone decide to put some work into supporting this.
Thanks for the heads-up! I took a quick look. It seems like native support for half-floats is made a bit complicated by OpenCL requiring that you fetch two of them at the same time, by vload_half2 (or some such). Shouldn't be hard, but it might take some work to get elementwise kernels etc. working. Andreas
pgpFgKMT5Ygt8.pgp
Description: PGP signature
_______________________________________________ PyOpenCL mailing list [email protected] http://lists.tiker.net/listinfo/pyopencl
