-
Notifications
You must be signed in to change notification settings - Fork 0
/
gfx90a_builtin.flux
executable file
·73 lines (66 loc) · 1.65 KB
/
gfx90a_builtin.flux
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
#!/bin/bash
set -o nounset
# Job settings
#flux: --job-name=gfx90a_builtin
# Request one node
#flux: --nodes=1
# Run one process per node
#flux: -n 1
# Request 32 cores per node
#flux: -c 32
# Request one GPU
#flux: -g 1
# Time
#flux: --time=3h
#flux: --exclusive
# Program settings
# Where to install LLVM
export LLVMDIR=/dev/shm/rydahl1/LLVMgfx90abuiltin
# Where to find LLVM sources
export LLVMSRCDIR=/p/lustre1/rydahl/
# Where to find the source files
export PROJECTDIR=`pwd`
# What architecture to install except for "host"
export VENDOR=AMDGPU # or NVPTX
# What subarchitecture to use
export GPUARCH=gfx90a
if [[ "$VENDOR" == "AMDGPU" ]]; then
export OMPTARGET=amdgcn-amd-amdhsa
fi
if [[ "$VENDOR" == "NVPTX" ]]; then
export OMPTARGET=nvptx
fi
module load rocm
module load python
module load gcc/12.2.0
export PATH=/usr/tce/packages/python/python-3.9.12/bin:$PATH
export CC=`which gcc`
export CXX=`which g++`
# Making bin
mkdir -p $PROJECTDIR/bin
## Cloning LLVM source files
if [ -d "$LLVMDIR/llvm-project" ]
then
echo "Found existing LLVM source code in $LLVMDIR"
elif [ -d "$LLVMSRCDIR/llvm-project" ]
then
echo "Found existing LLVM source code in $LLVMSRCDIR"
mkdir -p $LLVMDIR/llvm-project
cp -r $LLVMSRCDIR/llvm-project $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
# 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