Skip to content

Latest commit

 

History

History
48 lines (32 loc) · 1.44 KB

README_build_with_llvm.md

File metadata and controls

48 lines (32 loc) · 1.44 KB

Build kernel_slicer as a part of Clang/LLVM project

Brief

kernel_slicer can be built within LLVM project with build script.

Installation process

Description

This script will download the source code of LLVM project and integrate kernel_slicer into it.

Installation steps

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.

Executable

After build you can find executable kslicer in build/bin/ directory of llvm-project.

Sanity check

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