Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-09 07:49:13

0001 #!/bin/bash -l 
0002 usage(){ cat << EOU
0003 erfcinvf_Test.sh 
0004 ===================
0005 
0006 Related scripts:
0007 
0008 sysrap/tests/gaussQTables.sh 
0009    get familiar with Geant4 gaussTable 
0010 
0011 sysrap/tests/S4MTRandGaussQTest.sh
0012    using the table to implement S4MTRandGaussQTest::transformQuick 
0013 
0014 sysrap/tests/erfcinvf_Test.sh 
0015    getting good match to S4MTRandGaussQTest::transformQuick on device with erfcinvf 
0016 
0017 EOU
0018 }
0019 
0020 SDIR=$(cd $(dirname $BASH_SOURCE) && pwd)
0021 cd $SDIR
0022 
0023 msg="=== $BASH_SOURCE : "
0024 name=erfcinvf_Test
0025 
0026 defarg="build_run_ana"
0027 arg=${1:-$defarg}
0028 
0029 cuda_prefix=/usr/local/cuda
0030 CUDA_PREFIX=${CUDA_PREFIX:-$cuda_prefix}
0031 
0032 export FOLD=/tmp/$name
0033 mkdir -p $FOLD
0034 bin=$FOLD/$name
0035 
0036 vars="BASH_SOURCE SDIR name FOLD"
0037 
0038 
0039 if [ "${arg/info}" != "$arg" ]; then 
0040    for var in $vars ; do printf "%20s : %s \n" "$var" "${!var}" ; done 
0041 fi
0042 
0043 if [ "${arg/build}" != "$arg" ]; then 
0044     #opt="-use_fast_math"
0045     opt="" 
0046     echo $msg opt $opt
0047     nvcc $name.cu -std=c++11 $opt -I$HOME/np -I..  -I$CUDA_PREFIX/include -o $bin
0048     [ $? -ne 0 ] && echo compilation error && exit 1
0049 fi 
0050 
0051 UNAME=${UNAME:-$(uname)}
0052 
0053 echo $msg UNAME $UNAME FOLD $FOLD
0054 
0055 if [ "${arg/run}" != "$arg" ]; then 
0056     $bin
0057     [ $? -ne 0 ] && echo run  error && exit 2
0058 fi 
0059 
0060 if [ "${arg/ana}" != "$arg" ]; then 
0061     ${IPYTHON:-ipython} --pdb -i $name.py 
0062     [ $? -ne 0 ] && echo ana error && exit 3
0063 fi 
0064 
0065 if [ "${arg/grab}" != "$arg" ]; then 
0066     rsync -av P:$FOLD/ $FOLD
0067     [ $? -ne 0 ] && echo grab error && exit 4
0068 fi 
0069 
0070 
0071 
0072 exit 0 
0073