Project details here.
armd4ocl
(or "armed-for-opencl") uses the Rust macro system to embed
OpenCL language syntax into Rust. Users no longer have to write OpenCL
programs into a raw string in a Rust program or load a text file containing
an OpenCL program into an application's memory.
Users can express OpenCL programs using an opencl_str!
macro. The opencl_str!
macro syntax checks the user's code and exports well formed OpenCL programs
as a &std::str
. This macro should be useable with any Rust binding for
OpenCL.
- Read the Issue Tracker prior to using this library to learn it's limitations and edge cases. This macro only provides user's with syntax checking, it does not provide static code analysis. Syntax checking is limited to what the author is capable of doing with the Rust macro system and what the Rust macro system allows.
- The OpenCL strings generated by
opencl_str!
will not have one-to-one formatting with the user-provided input; the output will not be pretty-printed. - Users should note that
for
,while
,if
,else if
,else
are strict keywords in the Rust language. Strict keywords cannot be overloaded by the macro system. To use this macro in OpenCL programs, users are required to replace their use of the OpenCLfor
,while
,if
,else if
,else
keyword by usingfor_
,while_
,if_
,else_if_
,else_
as an alternative token. - Since the macro is a syntax checker, it will allow recursive function calls in an OpenCL program. Recursion is not permitted in OpenCL programs according to the language standard.
Boost Software License
- Users can embed OpenCL programs into a Rust application
- Compile-time syntax checking of OpenCL programs
cargo test
- Procedural macro support
Christopher Taylor