-
Notifications
You must be signed in to change notification settings - Fork 7
Home
The goal of this project is a library that would allow writing basic GPU programs using a subset of Common Lisp syntax and standard library (notably, full macro support), plus appropriate extensions. The term basic is defined by my current needs :)
GPU code is expressed as S-expressions following Common Lisp syntax with some custom declarations and special forms. It is parsed by a CL walker and translated to C code, which is compiled to GPU byte code using an external compiler provided by the GPU vendor. The resulting compiled code is then wrapped in order to allow easy invocation from ordinary Lisp functions.
The underlying platform and used implementation methods impose the following major restrictions:
- No consing is possible in GPU code (platform restriction).
- All variable and expression types must be either declared or easily inferrable.
- Arithmetic functions follow C type promotion rules and have C rounding and overflow semantics.
- The type system currently supports only primitive C types and specialized arrays of primitive types.
- The order of function argument evaluation is unspecified. The code generator warns if its side effect analysis detects any obviously unsafe code.
- TODO: Custom functions are supported via unconditional inlining. Recursion is not allowed.
Individual built-in functions have their own specific limitations.