28.07.2013 Views

Making OpenCL? Simple with Haskell - AMD Developer Central

Making OpenCL? Simple with Haskell - AMD Developer Central

Making OpenCL? Simple with Haskell - AMD Developer Central

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

AND SO ON FOR THE REST OF OPENCL API<br />

Standard use of <strong>Haskell</strong> FFI to implement the calls in an out of <strong>Haskell</strong><br />

into the <strong>OpenCL</strong> C world:<br />

foreign import stdcall "cl.h clGetPlatformIDs" clGetPlatformIDs<br />

:: CLCountedArrayGetter(Platform)<br />

foreign import stdcall "cl.h clGetPlatformInfo" clGetPlatformInfo<br />

:: Platform -> CLPlatformInfo -> CLGetter<br />

<strong>Simple</strong> extensions to handle OpenGL interop, <strong>with</strong> the HOpenGL (GLUT)<br />

packages. Allows performance, directly from <strong>Haskell</strong>, close to original C<br />

version.<br />

32 | <strong>Making</strong> <strong>OpenCL</strong> <strong>Simple</strong> | January, 2011 | Public

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!