The aim of the project is to implement the method from The key to a data parallel compiler in Haskell and research it. The expected result of the research is a library that enables one to implement a parallel compiler without bothering of parallelizing computations on AST by themselves.
See the Dependancies section.
LLVM 9 must be installed
Accelerate has its own brew formula to install LLVM 9 properly. It should be used to install llvm:
brew tap llvm-hs/llvm
brew install llvm-hs/llvm/llvm-9
It will take some time to build and install LLVM 9 this way.
When using Pop OS cuda can be installed with the following command:
sudo apt install system76-cuda-latest
# Or, even better, first install apt-fast which will speed up your download and use it
apt-fast -y install system76-cuda-latest
The installation might not set the links to the needed files, so the build of this project will fail. This can be fixed by:
- Add
/use/lib/cuda/bin
to yourPATH
in your.bashrc
/.zshrc
/etc.:
export PATH=$PATH:/usr/lib/cuda/bin
- Put symbolic link to libnvvm to the location where it can be found by a linker:
sudo ln -s /usr/lib/cuda/nvvm/lib64/libnvvm.so.4 /usr/lib/
sudo ldconfig
The proejct can be built to run either using a CPU or GPU backend.
-
Build the project without
gpu
flag:stack build --flag par-tree:-gpu # Or just stack build # since gpu flag is set to false by default
-
Run the built executable:
stack exec par-tree-exe
-
Build the project with
gpu
flag:stack build --flag par-tree:gpu
-
Run the built executable:
stack exec par-tree-exe