-
Notifications
You must be signed in to change notification settings - Fork 0
/
sm80.bsub
executable file
·99 lines (83 loc) · 1.93 KB
/
sm80.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
95
96
97
98
#!/bin/bash
set -o nounset
# Job settings
#BSUB -q gpua100
#BSUB -J sm_80
#BSUB -n 12
#BSUB -gpu "num=1:mode=exclusive_process"
#BSUB -R "span[hosts=1]"
#BSUB -R "rusage[mem=50GB]"
#BUSB -R "select[gpu80gb]"
#BSUB -W 8:00
# Program settings
# Where to install LLVM
export LLVMDIR=/work3/s174515/LLVMA100
# 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_80
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++`
$CC --version
$CXX --version
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