Okay looks like FFI is the only way to go, Thanks.<br><br>Cheers,<br>Oleksandr.<br><br><div class="gmail_quote">On Sun, Sep 27, 2009 at 9:50 PM, wren ng thornton <span dir="ltr">&lt;<a href="mailto:wren@freegeek.org">wren@freegeek.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">Olex P wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>
<br>
Yes, I mean &quot;sizeOf 2&quot;. It&#39;s useful not only on GPUs but also in &quot;normal&quot;<br>
software. Think of huge data sets in computer graphics (particle clouds,<br>
volumetric data, images etc.) Some data (normals, density, temperature and<br>
so on) can be easily represented as float 16 making files 200 GB instead of<br>
300 GB. Good benefits.<br>
</blockquote>
<br></div>
I think, if you&#39;re going to want any kind of performance and portability, then you&#39;ll have to use the FFI to wrap some C code that performs the primops. From there you can define the instances for Floating, RealFloat, etc. to use them like normal types in Haskell.<br>

<br>
There are a number of embedded systems that still use 24-bit floating registers, so it&#39;d be nice to provide both Float16 and Float24. But since these aren&#39;t natively supported in C, it&#39;s not clear how best to write the primops so they&#39;re portable across GPUs and embedded systems.<br>

<br>
-- <br>
Live well,<br><font color="#888888">
~wren</font><div><div></div><div class="h5"><br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</div></div></blockquote></div><br>