-
Notifications
You must be signed in to change notification settings - Fork 0
/
isyclcc
executable file
·39 lines (31 loc) · 1.28 KB
/
isyclcc
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
#!/bin/bash
##########################################################################
# #
# Copyright (c) 2019 Paul Keir, University of the West of Scotland. #
# #
##########################################################################
usage() { echo isyclcc: error: $2 >&2; exit $1; }
[ $# -eq 0 ] && usage 1 "no input files"
[ -z "$INTELSYCL_DIR" ] && usage 2 "create and initialise a INTELSYCL_DIR environment var"
COMPILE_ONLY=0
PREPROCESS_ONLY=0
while [[ $# > 0 ]]; do
case "$1" in
-E) PREPROCESS_ONLY=1; CMD="$CMD $1" ;;
-c) COMPILE_ONLY=1; CMD="$CMD $1" ;;
-g) ;;
-? ) CMD="$CMD $1 $2"; shift ;; # e.g. -I /path/a/b or -L /foo
-?*) CMD="$CMD $1" ;; # e.g. -I/path/a/b or -O3
*) EXT=${1##*.}
if [[ $EXT = 'a' ]]; then
CMD="$CMD -foffload-static-lib=$1"
else
CMD="$CMD $1"
fi
;;
esac
shift # $2 becomes $1; $3 becomes $2 etc.
done
if ((!COMPILE_ONLY && !PREPROCESS_ONLY)); then CMD="$CMD -lOpenCL"; fi
$INTELSYCL_DIR/bin/clang++ -std=c++11 -fsycl $CMD
exit $?