Add OpenCL

This commit is contained in:
Dennis Felsing 2015-02-03 20:13:02 +01:00
parent 024b6ef594
commit 51ebb503c2
1 changed files with 24 additions and 0 deletions

View File

@ -39,6 +39,30 @@ provides configuration for the code generator and implements the logic of the ga
**Mentor:** def- ([@def-](http://github.com/def-)), ?
___
#### Add a code generator for OpenCL
**Desirable skills:** Good OpenCL knowledge, knowledge of the compiler internals, basics of type theory.
**Description:**
Nimrod currently supports C, C++, Objective C and JavaScript code generation. However to run efficiently on GPUs an OpenCL backend is required. The easy way to do this is to copy OpenCL's low level mode of operation with its different ``private``, ``local``, ``global`` storage and simply provide a nimrodic syntax for OpenCL. So apart from syntactic sugar users get all of Nimrod's meta programming advantages plus good integration into Nimrod's infrastructure.
The vision is a ``gpu`` pragma that means a proc and all of its dependencies are translated into OpenCL instead of C but can be invoked from ordinary Nimrod code that is translated to C. The ``gpu`` code generator is allowed to only translate a subset of Nimrod, in particular things like function pointers that are not supported by OpenCL do not have to be supported. The compiler should produce a clean error message for unsupported features.
**Expected Result:** The GPU code generator works on a selected set of examples/test cases.
**Tasks:**
* Add support for new pointer types in the compiler like ``global``, ``private``.
* Add support for work groupss.
* Add support for the ``gpu`` pragma that translates to the OpenCL, version 2: https://www.khronos.org/registry/cl/sdk/2.0/docs/man/xhtml/
**Bonus points:** Support version 1.2 of the OpenCL specification: https://www.khronos.org/registry/cl/sdk/1.2/docs/man/xhtml/. This should be significantly harder as version 1.2 doesn't support a shared address space with the host environment.
**Difficulty:** Hard
**Mentor:** Araq ([@Araq](http://github.com/Araq))
___
#### Improve the JavaScript Backend