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
- Host: GitHub
- URL: https://github.com/sandialabs/math-bytecode
- Owner: sandialabs
- License: mit
- Created: 2021-10-01T15:50:19.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-11-02T18:06:03.000Z (over 2 years ago)
- Last Synced: 2025-01-11T15:32:44.649Z (4 months ago)
- Topics: scr-2689, snl-science-libs
- Language: C++
- Homepage:
- Size: 83 KB
- Stars: 0
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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