Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
#!/bin/bash
#
# compile bc
# output: bc and bc-dbg
#
hornet=$(whoami | grep saq10002)
if [ "$hornet" == '' ] ; then
nvccArch='sm_12'
else
nvccArch='sm_20'
fi
executableName="bc"
executableDbgName="bc-dbg"
executableNoPredBitDbgName="bc-nobit-dbg"
executableNoPredBitName="bc-nobit"
compileCommand="nvcc -arch $nvccArch bc.cu -o $executableName 2>&1 | tee compile.txt | grep error"
compileDbgCommand="nvcc -DKERNEL_DEBUG=1 -arch $nvccArch bc.cu -o $executableDbgName 2>&1 | tee compile.txt | grep error"
compileNoPredBitCommand="nvcc -DUSE_BIT_PRED_MATRIX=0 -arch $nvccArch bc.cu -o $executableNoPredBitName 2>&1 | tee compile.txt | grep error"
compileNoPredBitDbgCommand="nvcc -DKERNEL_DEBUG=1 -DUSE_BIT_PRED_MATRIX=0 -arch $nvccArch bc.cu -o $executableNoPredBitDbgName 2>&1 | tee compile.txt | grep error"
#
echo "Compiling bc"
echo $1
echo $2
noPredBit=0
dbg=0
if [ "$1" == "dbg" ] || [ "$2" == "dbg" ] ; then
dbg=1
fi
if [ "$1" == "nobit" ] || [ "$2" == "nobit" ] ; then
noPredBit=1
fi
if [ $dbg -eq 1 ] ; then
if [ $noPredBit -eq 1 ] ; then
executableName=$executableNoPredBitDbgName
echo "Command: "$compileNoPredBitDbgCommand
nvcc -DKERNEL_DEBUG=1 -DUSE_BIT_PRED_MATRIX=0 -arch $nvccArch bc.cu -o $executableName 2>&1 > compile-dbg.txt | grep error
echo "*** Done compiling bc-nobit-dbg ***"
echo "debug + nobit mode"
echo "Executable: "$executableName
else
executableName=$executableDbgName
echo "debug mode"
echo "Command: "$compileDbgCommand
nvcc -DKERNEL_DEBUG=1 -arch $nvccArch bc.cu -o $executableName 2>&1 > compile-dbg.txt | grep error
echo "*** Done compiling bc-dbg ***"
echo "debug + nobit mode"
echo "Executable: "$executableName
fi
else
if [ $noPredBit -eq 1 ] ; then
executableName=$executableNoPredBitName
echo "Command: "$compileNoPredBitCommand
nvcc -DUSE_BIT_PRED_MATRIX=0 -arch $nvccArch bc.cu -o $executableName 2>&1 > compile.txt | grep error
echo "*** Done compiling bc-nobit ***"
echo "nobit mode"
echo "Executable: "$executableName
else
echo "Command: "$compileCommand
nvcc -arch $nvccArch bc.cu -o $executableName 2>&1 > compile.txt | grep error
echo "*** Done compiling bc ***"
echo "Executable: "$executableName
fi
fi