OpenMP version of PolybenchGPU
The algorithms in PolybenchGPU are reimplemented using OpenMP. There are existing implementations, such as Unibench, but Unibench suffers from incorrect implementations that may cause incorrect computation results or invalid nvprof results. This reimplementaiton is aimed at solving these issues.
- LLVM with OpenMP. See how you can get both here and follow my blog here for more details on how to build llvm and OpenMP target offloading.
To quickly start building and running, clone this repository first and follow the steps below.
- Clone this git repository.
- Go to the directory
PolybenchOMP
and create a build directory.
cd PolybencOMP
mkdir build
- Configure the project.
# Set the path to LLVM installation
export LLVM_INSTALL=/where/llvm/is/installed
# Go to the build directory
cd build
# Configure the project
cmake -DCMAKE_BUILD_TYPE=Release -DRUN_TEST=1 \
-DCMAKE_C_COMPILER=$LLVM_INSTALL/bin/clang \
-DCMAKE_CXX_COMPILER=$LLVM_INSTALL/bin/clang++ \
-DOPENMP_LIBRARIES=$LLVM_INSTALL/lib \
-DCMAKE_INSTALL_PREFIX=$(pwd)/../install \
-DOPENMP_INCLUDES=~/llvm-project/install/include \
..
- Install all the benchmarks.
make install -j16
RUN_OFFLOAD_GPU
default is on. This option turns on building for nvptx target offloading.RUN_TEST
default is off. When turned on, the benchmarks compare results with a servial version of the algorithm. For now this option is only controlling OMPGPU targets. OMPCPU always have the test code on.
- Running on Windows is neither tested nor supported.
- Target offloading is not supported on macOS.
- cmake may fail on when running for the first time on macOS. Rerun should solve the problem.