kernel_slicer
can be built within LLVM project with build script.
This script will download the source code of LLVM project and integrate kernel_slicer
into it.
Download LLVM project and integrate kernel_slicer
in it with prepared bash script:
wget https://raw.githubusercontent.com/Ray-Tracing-Systems/kernel_slicer/refs/heads/master/doc/other/build-with-llvm.sh
chmod +x build-with-llvm.sh
./build-with-llvm.sh
Build LLVM project with kernel_slicer
:
cd llvm-project
cmake -G Ninja -B build -S llvm -DLLVM_PARALLEL_LINK_JOBS=1 \
-DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra" \
-DCMAKE_BUILD_TYPE=Release \
-DKSLICER_LLVM_BUILD=ON
ninja -C build
Note that KSLICER_LLVM_BUILD
should be defined to make kslicer
a part of LLVM.
After build you can find executable kslicer
in build/bin/
directory of llvm-project
.
You can run a test to check that kslicer
works properly:
cd clang-tools-extra/kernel_slicer
../../build/bin/kslicer "apps/05_filter_bloom_good/test_class.cpp" \
-mainClass ToneMapping -stdlibfolder TINYSTL -pattern ipv -reorderLoops YX -Iapps/LiteMath IncludeToShaders -shaderCC GLSL -DKERNEL_SLICER -v