@@ -64,64 +78,77 @@ Otherwise, some environment variables are required:
...
@@ -64,64 +78,77 @@ Otherwise, some environment variables are required:
*`CUDA_TOOLKIT_PATH` --- Path to the CUDA toolkit
*`CUDA_TOOLKIT_PATH` --- Path to the CUDA toolkit
*`CUDA_INCLUDE_PATH` --- Path to the CUDA headers
*`CUDA_INCLUDE_PATH` --- Path to the CUDA headers
*`CUDA_LIB_PATH` --- Path to CUDA libraries
*`CUDA_LIB_PATH` --- Path to CUDA libraries
`set_paths.sh` can be used for this.
Modify the values of these variables in `set_paths.sh` according to your system, and source the script:
`hpvm/set_paths.sh` can be used for this. Modify the values of these variables in set_paths.sh and source the script:
```shell
```shell
source set_paths.sh
source set_paths.sh
```
```
HPVM installer script can be used to download, configure and build HPVM along with LLVM and Clang.
HPVM installer script can be used to download, configure and build HPVM along with LLVM and Clang.
```shell
```shell
bash install.sh
bash install.sh
```
```
Post Installation Build the HPVM Compilation Tool `approxhpvm.py` using:
```
On launch, the installer asks whether it should also build HPVM.
make approxhpvm.py
If HPVM is to be built, the installer asks the number of threads to be used.
```
The default number of threads used to build HPVM is two (2).
If you use this automatic build, skip the next section.
* Specifically, the HPVM installer downloads LLVM, and Clang, copies HPVM source into
llvm/tools and builds the entire tree. It also builds a modified LLVM C-Backend,
based on the one maintained by [Julia Computing](https://github.com/JuliaComputing/llvm-cbe),
as a part of HPVM and is currently used to generate OpenCL kernels for GPUs.
### Manually Build HPVM
Specifically, the HPVM installer downloads LLVM, and Clang, copies HPVM source into
Alternatively, you can manually build HPVM with CMake.
llvm/tools and builds the entire tree. It also builds a modified LLVM C-Backend, based on the one maintained by [Julia Computing](https://github.com/JuliaComputing/llvm-cbe), as a part of HPVM and is currently used
Please note that in this case,
to generate OpenCL kernels for GPUs.
the installer script still *must* be executed to obtain some required components,
but without the build step.
In the beginning of the building process, the installer provides users the choice of automatically or manually building HPVM.
In current directory (`hpvm/`), do
If HPVM is selected to be built automatically, the installer allows users to type in the number of threads they want to use.
The default number of threads used to build HPVM is two.
Alternatively, CMake can be run manually using the following steps in ./hpvm-release/hpvm directory.
```shell
```shell
mkdir build
mkdir build
cd build
cd build
cmake ../llvm [options]
cmake ../llvm [options]
export PATH=$(realpath ./bin):$PATH
```
```
**Note** that if the installer script was not used,
you must _manually add `build/bin` directory to your $PATH variable_ (as absolute path).
Some common options that can be used with CMake are:
Some common options that can be used with CMake are:
* -DCMAKE_INSTALL_PREFIX=directory --- Specify for directory the full pathname of where you want the HPVM tools and libraries to be installed.
* -DCMAKE_INSTALL_PREFIX=directory --- Specify for directory the full pathname of where you want the HPVM tools and libraries to be installed.
* -DCMAKE_BUILD_TYPE=type --- Valid options for type are Debug, Release, RelWithDebInfo, and MinSizeRel. Default is Debug.
* -DCMAKE_BUILD_TYPE=type --- Valid options for type are Debug, Release, RelWithDebInfo, and MinSizeRel. Default is Debug.
* -DLLVM_ENABLE_ASSERTIONS=On --- Compile with assertion checks enabled (default is Yes for Debug builds, No for all other build types).
* -DLLVM_ENABLE_ASSERTIONS=On --- Compile with assertion checks enabled (default is Yes for Debug builds, No for all other build types).
In order to manually build and install HPVM, GNU Make can be run using the following in the build directory.
**Note** that if the installer script was not used,
you must _manually add `build/bin` directory to your $PATH variable_ as absolute path (as shown above).
Now, compile the HPVM Compilation Tool `approxhpvm.py` using:
```shell
```shell
make -j<number of threads>
make -j<number of threads> approxhpvm.py
make install
```
```
In the end of the installation process, the installer automatically runs all the regression tests to ensure that the installation is
With all the aforementioned steps, HPVM should be built, installed, tested and ready to use.
successful. If HPVM is built and installed manually, the tests can be automatically run by executing the following step from the ./hpvm-release/hpvm directory.
In particular, `approxhpvm.py` should be an executable command from your command line.
When not using the installer, you may want to run the regression tests using this script (outside of build directory):
```shell
```shell
cd ..
bash scripts/automate_tests.sh
bash scripts/automate_tests.sh
```
```
With all the aforementioned steps, HPVM should be built, installed, tested and ready to use.
## Benchmarks and Tests
## Benchmarks and Tests
We are providing the following [HPVM benchmarks](/hpvm/test/benchmarks):
We are providing the following [HPVM benchmarks](/hpvm/test/benchmarks):
* Select benchmarks from the [Parboil](http://impact.crhc.illinois.edu/parboil/parboil.aspx) benchmark suite, located under [test/benchmarks/parboil](/hpvm/test/benchmarks/parboil).
* Select benchmarks from the [Parboil](http://impact.crhc.illinois.edu/parboil/parboil.aspx) benchmark suite, located under [test/benchmarks/parboil](/hpvm/test/benchmarks/parboil).
* An edge detection pipeline benchmark, located under [test/benchmarks/pipeline](/hpvm/test/benchmarks/pipeline).
* An edge detection pipeline benchmark, located under [test/benchmarks/pipeline](/hpvm/test/benchmarks/pipeline).
* A Camera ISP pipeline, located under [test/benchmarks/hpvm-cava](/hpvm/test/benchmarks/hpvm-cava), adapted from C code provided from our collaborators at [Harvard](http://vlsiarch.eecs.harvard.edu).
* A Camera ISP pipeline, located under [test/benchmarks/hpvm-cava](/hpvm/test/benchmarks/hpvm-cava), adapted from C code provided from our collaborators at [Harvard](http://vlsiarch.eecs.harvard.edu).
...
@@ -131,4 +158,5 @@ Benchmark descriptions and instructions on how to compile and run them are [here
...
@@ -131,4 +158,5 @@ Benchmark descriptions and instructions on how to compile and run them are [here
We are also providing [unit tests](/hpvm/test/unitTests) and [regression tests](/hpvm/test/regressionTests).
We are also providing [unit tests](/hpvm/test/unitTests) and [regression tests](/hpvm/test/regressionTests).
## Support
## Support
All questions can be directed to [hpvm-dev@lists.cs.illinois.edu](mailto:hpvm-dev@lists.cs.illinois.edu).
All questions can be directed to [hpvm-dev@lists.cs.illinois.edu](mailto:hpvm-dev@lists.cs.illinois.edu).