-
Notifications
You must be signed in to change notification settings - Fork 0
/
sm70.bsub
executable file
·95 lines (80 loc) · 1.87 KB
/
sm70.bsub
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/bin/bash
set -o nounset
# Job settings
#BSUB -q gpuv100
#BSUB -J sm_70
#BSUB -n 16
#BSUB -R "span[hosts=1]"
#BSUB -R "rusage[mem=16GB]"
#BSUB -gpu "num=1:mode=exclusive_process"
#BSUB -W 8:00
# Program settings
# Where to install LLVM
export LLVMDIR=/work3/s174515/LLVMV100
# Where to find the source files
export PROJECTDIR=`pwd`
# What architecture to install except for "host"
export VENDOR=NVPTX # or NVPTX
# What subarchitecture to use
export GPUARCH=sm_70
module load cmake/3.23.2
module load gcc/11.3.0-binutils-2.38
module load cuda/11.5
export PATH=/work3/s174515/ninja:$PATH
export CC=`which gcc`
export CXX=`which g++`
if [[ "$VENDOR" == "AMDGPU" ]]; then
export OMPTARGET=amdgcn-amd-amdhsa
fi
if [[ "$VENDOR" == "NVPTX" ]]; then
export OMPTARGET=nvptx64
fi
# Making bin
mkdir -p $PROJECTDIR/bin
## Cloning LLVM source files
if [ -d "$LLVMDIR/llvm-project" ]
then
echo "Found existing LLVM source code in $LLVMDIR"
else
rm -rf $LLVMDIR
mkdir -p $LLVMDIR
cd $LLVMDIR
git init
git clone https://github.com/llvm/llvm-project
fi
cd $LLVMDIR/llvm-project
#git checkout 3d8010363895bd063a2d33172a07985b4c9b97ee
#git apply $PROJECTDIR/patches/D156263.diff
# Installing LLVM for VENDOR and GPUARCH
cd $PROJECTDIR
export LIBC_GPU_VENDOR_MATH=ON
export LIBC_GPU_BUILTIN_MATH=OFF
source install_libc.sh
# Running CPU tests
cd $PROJECTDIR
./cpu_builtin.sh
cd $PROJECTDIR
./cpu_libc.sh
# Running GPU tests
cd $PROJECTDIR
if [[ "$VENDOR" == "AMDGPU" ]]; then
./gpu_ocml.sh
fi
cd $PROJECTDIR
if [[ "$VENDOR" == "NVPTX" ]]; then
./gpu_nv.sh
fi
# Built-in math functions
cd $PROJECTDIR
export LIBC_GPU_VENDOR_MATH=OFF
export LIBC_GPU_BUILTIN_MATH=ON
source install_libc.sh
cd $PROJECTDIR
./gpu_builtin.sh
# Built-in math functions
cd $PROJECTDIR
export LIBC_GPU_VENDOR_MATH=OFF
export LIBC_GPU_BUILTIN_MATH=OFF
source install_libc.sh
cd $PROJECTDIR
./gpu_libc.sh