Skip to content
This repository has been archived by the owner on Jan 7, 2023. It is now read-only.

Commit

Permalink
Merge pull request #3 from dfangshuo/master
Browse files Browse the repository at this point in the history
add CLANG_BIN_PATH
  • Loading branch information
AmeerHajAli authored Mar 17, 2020
2 parents e48c89d + d5e8c1e commit b7ba5fd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions preprocess/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@
# External dependencies
# CLANG_PATH - should be set to the location of lib clang
CLANG_PATH=/usr/lib/llvm-6.0/lib/libclang.so.1
# CLANG_BIN_PATH should be set to the location of bin/clang
CLANG_BIN_PATH=/usr/bin/clang
# CODE2VEC_LOC - should be the location of base codevec
CODE2VEC_LOC=../code2vec
# SOURCE_DIR - top level folder for C source files
Expand Down Expand Up @@ -96,3 +98,4 @@ export CLANG_PATH=$(realpath ${CLANG_PATH})
SOURCE_DIR=$(realpath ${SOURCE_DIR})
export NeuroVectorizer_DIR=$(realpath ${NeuroVectorizer_DIR})
export PYTHONPATH=$CODE2VEC_LOC:$PYTHONPATH
export CLANG_BIN_PATH=$(realpath ${CLANG_BIN_PATH})
6 changes: 3 additions & 3 deletions utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def get_bruteforce_runtimes(rundir,files,vec_action_meaning,
rm_cmd = 'rm ' + filename[:-1]+'o '
if os.path.exists(filename[:-1]+'o'):
os.system(rm_cmd)
cmd1 = 'timeout 4s /usr/bin/clang -O3 -lm '+full_path_header
cmd1 = 'timeout 4s ' + os.environ['CLANG_BIN_PATH'] + ' -O3 -lm '+full_path_header
+' ' +filename+' -Rpass=loop-vectorize -mllvm -force-vector-width='
+str(VF)+' -mllvm -force-vector-interleave='+str(IF)
+' -o ' +filename[:-1]+'o'
Expand Down Expand Up @@ -114,7 +114,7 @@ def get_O3_runtimes(rundir,files):
rm_cmd = 'rm ' + filename[:-1]+'o '
if os.path.exists(filename[:-1]+'o'):
os.system(rm_cmd)
cmd1 = 'timeout 2s /usr/bin/clang -O3 -lm '+full_path_header +' ' +filename+' -o ' +filename[:-1]+'o'
cmd1 = 'timeout 2s ' + os.environ['CLANG_BIN_PATH'] + ' -O3 -lm '+full_path_header +' ' +filename+' -o ' +filename[:-1]+'o'
print(cmd1)
os.system(cmd1)
cmd2 = filename[:-1]+'o '
Expand Down Expand Up @@ -169,7 +169,7 @@ def run_llvm_test_shell_command(rundir,filename):
'''runs the file after the pragma is injected
and returns runtime.'''
full_path_header = os.path.join(rundir,'header.c')
cmd1 = 'timeout 4s /usr/bin/clang -O3 -lm '+full_path_header \
cmd1 = 'timeout 4s '+ os.environ['CLANG_BIN_PATH'] + ' -O3 -lm '+full_path_header \
+' ' +filename+' -o ' +filename[:-1]+'o'
cmd2 = filename[:-1]+'o '
os.system(cmd1)
Expand Down

0 comments on commit b7ba5fd

Please sign in to comment.