forked from cerati/p2z-tests
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathO2GBuild.script
More file actions
executable file
·68 lines (55 loc) · 1.61 KB
/
O2GBuild.script
File metadata and controls
executable file
·68 lines (55 loc) · 1.61 KB
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
#! /bin/bash
#defaultInputFile="propagate-toz-test_OpenACC.c"
defaultInputFile="propagate-toz-test_OpenACC_v3.c"
if [ $# -eq 3 ]; then
numStreams=$1
inputFile="$2"
ompaccInter=$3
elif [ $# -eq 2 ]; then
numStreams=$1
inputFile="$2"
ompaccInter=$3
elif [ $# -eq 1 ]; then
numStreams=$1
inputFile="$defaultInputFile"
ompaccInter=0
else
numStreams=10
inputFile="$defaultInputFile"
ompaccInter=0
fi
if [ ! -f "./src/$inputFile" ]; then
echo "input file, ./src/$inputFile does not exits; exit"
exit
fi
verLevel=0
if [ "$openarc" == "" ] || [ ! -d "${openarc}" ]; then
echo "Environment variable, openarc, should be set to use this script; exit"
exit
fi
openarcrt="${openarc}/openarcrt"
openarclib="${openarc}/lib"
if [ ! -f "openarcConf.txt" ]; then
cp "openarcConf_NORMAL.txt" "openarcConf.txt"
fi
if [ "$numStreams" != "" ]; then
mv "openarcConf.txt" "openarcConf.txt_tmp"
cat "openarcConf.txt_tmp" | sed "s|__numStreams__|${numStreams}|g" > "openarcConf.txt"
rm "openarcConf.txt_tmp"
fi
if [ ! -d ./bin ]; then
mkdir bin
fi
if [ "$openarcrt" != "" ]; then
mv "openarcConf.txt" "openarcConf.txt_tmp"
cat "openarcConf.txt_tmp" | sed "s|__openarcrt__|${openarcrt}|g" > "openarcConf.txt"
rm "openarcConf.txt_tmp"
fi
java -classpath $openarclib/cetus.jar:$openarclib/antlr.jar openacc.exec.ACC2GPUDriver -verbosity=${verLevel} -ompaccInter=${ompaccInter} -gpuConfFile=openarcConf.txt ./src/$inputFile
echo ""
echo "====> To compile the translated output file:"
echo "\$ make COMPILER=openarc MODE=acc"
echo ""
echo "====> To run the compiled binary:"
echo "\$ cd bin; propagate_openarc_acc"
echo ""