Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Memory access info-gathering infrastructure for CUDA. Based on LLVM.

NotificationsYou must be signed in to change notification settings

gkrls/kerma

Repository files navigation

Build StatusDocumentation

KERnel Memory Accesses

Dependencies

Ubuntu 18.04 LTS

Only tested in 18.04. In principle it should work on higher versions too, but no guarantees

LLVM 10

Currently the build system does not automatically pull the LLVM dependencies so we need to manually install them

# Download precompiled LLVM 10 binarieswget -c https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/clang+llvm-10.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xztar xf clang+llvm-10.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz -C /my/llvm/install/dir --strip-components=1# (Optional) Create `$LLVM_HOME` env var pointing to the llvm installationecho -eexport LLVM_HOME=$(realpath /my/llvm/install/dir)>>~/.bashrcsource~/.bashrc

cxxtools

(we should really have CMake configure this but for now its ok)

sudo apt updatesudo apt install libcxxtools-dev

Optional Dependencies

Documentation

  • dot
  • Doxygen
sudo apt install graphvizsudo apt install doxygen

Build

cd kermamkdir buildcd build && cmake ..make -j4

If all went well there should be a directoryout underbuild with the following structure:

out/├── bin/├── docs/├── include/├── lib/└── rt/

This is the directory to use asKERMA_HOME in KermaView, meaning that in KermaView you should setKERMA_HOME=path/to/kerma/build/out in the.env file.


Cuda Instrumentation pipeline

                   +---------------+                   |   Device IR   |                   |Instrumentation|                   +----+----+-----+                        ^    |                        |    |                        |    |                        |    |          clang         +    v     llc                  ptxas             fatbinary     +---------------> device.bc +-------> device.ptx +-------> device.o +---------> device.fatbin     |                                                                                  +     +                                                                                  |program.cu                                                                              |     +                                                                                  |     |    clang                      clang             clang                            |     +---------------> host.cu.inc +-------> host.bc +-------> host.o +---------------->+ clang (link)                       (host src w.           +   ^                                     |                        Cuda wrappers)        |   |                                     |                                              |   |                                     v                                              |   |                                  program.exe                                              v   |                                         +----+---+------+                                         |    Host IR    |                                         |Instrumentation|                                         +----+---+------+

TODO: Add flags for each step

Notes

Steps

  • Step 0

    clang++ -std=c++11 -c -S -g -O0 -emit-llvm -fno-discard-value-names      \        -Xclang -disable-O0-optnone                                      \        <file> -cuda-gpu-arch=<arch>
  • Step 1

    opt -S -mem2reg -instnamer <file>.ll > <file>.1.ll
  • Step 2

    opt -S -load <KermaTransformPlugin> --kerma-md --kerma-mi [<kerma-md options>] [<kerma-mi-options>] <file>.1.ll > <file>.2.ll

Passes to check

About

Memory access info-gathering infrastructure for CUDA. Based on LLVM.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp