Skip to content

Adapt from Kerma. IR level CUDA code analysis based on LLVM10, support CUDA-11.8 on Ubuntu 22.04

Notifications You must be signed in to change notification settings

xenshinu/CUDA-IR-LLVMPass

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Instructions

To build original CUDA code

nvcc axpy.cu -o axpy

or

clang++ axpy.cu -o axpy --cuda-gpu-arch=sm_61 -L/usr/local/cuda/lib64 -lcudart_static -ldl -lrt -pthread

To see IR of original CUDA code

clang++ -std=c++11 -emit-llvm -c -S axpy.cu --cuda-gpu-arch=sm_61

To build executable file with LLVM pass

clang++ -flegacy-pass-manager  -Xclang -load -Xclang build/Pass/libSkeletonPass.* axpy.cu -o axpy --cuda-gpu-arch=sm_61 -L/usr/local/cuda-11.8/lib64/ -lcudart_static -ldl -lrt -pthread

To see IR after LLVM pass

clang++ -flegacy-pass-manager -Xclang -load -Xclang build/Pass/libSkeletonPass.* -std=c++11 -emit-llvm -c -S axpy.cu --cuda-gpu-arch=sm_61

About

Adapt from Kerma. IR level CUDA code analysis based on LLVM10, support CUDA-11.8 on Ubuntu 22.04

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages