This repository consists of codes for the Mathy Compiler. The Demo for this project is here
The Mathy compiler generates ready-to-run cuda code for commonly used mathematical expressions like forall, summation, product etc.
The project was written in C++ using Flex and Bison.
- g++
sudo apt install g++
- flex
sudo apt install flex
- bison
sudo apt install bison
Run make
in the src
directory to generate the executable a.out
This will generate some intermediate files also.
If the Mathy code is present in input.txt, running ./a.out input.txt output.cu
will create a file output.cu
which will contain the equivalent Cuda code. The program assumes that all arrays are of type float.
Run make clean
to remove the executable and intermediate files.
Run python3 benchmark.py
to generate the cuda files for mathy text files present in benchmark/input and write the outputs to benchmark/output.
The benchmarks have been implemented based on PolyBench benchmarks.
The results of the output code against the benchmark code have been agglomerated in this Report.
Please refer to the wiki for the Grammar and features of the Mathy language.