An open API service indexing awesome lists of open source software.

https://github.com/sandialabs/math-bytecode

A C++ library to compile C-like code at runtime and produce GPU-interpretable bytecode
https://github.com/sandialabs/math-bytecode

scr-2689 snl-science-libs

Last synced: 3 months ago
JSON representation

A C++ library to compile C-like code at runtime and produce GPU-interpretable bytecode

Awesome Lists containing this project

README

        

Math Bytecode
=============
`math-bytecode` is a C++17 library that uses `ParseGen` to implement a compiler for a subset of the C language.
The language that `math-bytecode` supports is basically the body of a C function, allowing only variables of
type `double` and operations on them.
The body of the function is provided as a C++ `std::string` and is then compiled into bytecode stored in
an object of type `math_bytecode::compiled_function`.
The bytecode can then be executed by an object of type `math_bytecode::executable_function`
as if it were a regular C++ function call.
The executable function object is designed to be used in the interior of "hot loops" inside
physics simulation codes, and `math-bytecode` is an ideal way to accept arbitrary mathematical
functions from users for things like initial and boundary conditions.
`math-bytecode` uses `P3A` to be portably performant across HPC hardware like Intel CPUs,
NVIDIA GPUs, and AMD GPUs.

At Sandia, Math Bytecode is SCR# 2689.0