https://github.com/lac-dcc/hamsa
A tool to extract complexities and costs from programs and kernels
https://github.com/lac-dcc/hamsa
Last synced: 7 months ago
JSON representation
A tool to extract complexities and costs from programs and kernels
- Host: GitHub
- URL: https://github.com/lac-dcc/hamsa
- Owner: lac-dcc
- License: gpl-3.0
- Created: 2022-10-17T21:09:13.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-04-19T14:08:15.000Z (over 2 years ago)
- Last Synced: 2025-04-05T17:43:26.760Z (9 months ago)
- Language: C++
- Homepage:
- Size: 729 KB
- Stars: 17
- Watchers: 4
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Hamsa
Kernels are nests of loops that process multidimensional arrays. **Hamsa** is a tool to extract kernels from programs and infer their asymptotic complexity. Figure 1 illustrates this:
For linear loop bounds, inferring the complexity is trivial. However, for non-linear bounds this task is more challenging. We intend to use the approach proposed by [Gulwani et al.](https://www.microsoft.com/en-us/research/wp-content/uploads/2016/12/sas11-bound.pdf) to implement it.
## Building the tool
First of all, you need to inform the directory where LLVM is built. You can do this by changing the value of `LLVM_BUILD_DIR` at `tool/setup.sh`.
After configuring the build dir, you can setup the tool by running this command:
./setup.sh
## Running
After you've built the tool, you can run it as a Clang plugin. However the `tool/run.sh` script makes it easier to run. You can use it like this:
./run.sh inputFile outputFile outputFormat
## Setup tutorial
You can also watch our [tutorial video](https://youtu.be/Vu9EpnKtjGU) about how to setup the tool and run it inside a Docker container.