diff options
Diffstat (limited to 'setup_environment')
| -rw-r--r-- | setup_environment | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/setup_environment b/setup_environment index 28fd2d6..79dd34a 100644 --- a/setup_environment +++ b/setup_environment @@ -11,6 +11,7 @@ if [ ! -n "$CUDA_INSTALL_PATH" ]; then echo "ERROR ** Install CUDA Toolkit and set CUDA_INSTALL_PATH."; return; fi + if [ ! -d "$CUDA_INSTALL_PATH" ]; then echo "ERROR ** CUDA_INSTALL_PATH=$CUDA_INSTALL_PATH invalid (directory does not exist)"; return; @@ -96,6 +97,33 @@ if [ "x$HOSTNAME_F" == "x$OPENCL_REMOTE_GPU_HOST" ]; then unset OPENCL_REMOTE_GPU_HOST fi +# The following checks to see if the GPGPU-Sim power model is enabled. +# GPGPUSIM_POWER_MODEL points to the directory where gpgpusim_mcpat is located. +# If this is not set, it checks the default directory "distribution/../mcpat/". +echo "=== GPGPUSim Power model ===" +if [ -d $GPGPUSIM_ROOT/src/mcpat/ ]; then + if [ ! -f $GPGPUSIM_ROOT/src/mcpat/gpgpu_sim.verify ]; then + echo "ERROR ** gpgpu_sim.verify not found in $GPGPUSIM_ROOT/../mcpat"; + return; + fi + export GPGPUSIM_POWER_MODEL=$GPGPUSIM_ROOT/src/mcpat/; + echo "GPGPU-Sim_McPAT power model detected... Using default directory $GPGPUSIM_POWER_MODEL."; + echo "If you want to specify a non-default directory, modify GPGPUSIM_POWER_MODEL manually after running setup_environment." +elif [ -n "$GPGPUSIM_POWER_MODEL" ]; then + if [ ! -f $GPGPUSIM_POWER_MODEL/gpgpu_sim.verify ]; then + echo "ERROR ** gpgpu_sim.verify not found in $GPGPUSIM_ROOT/../mcpat/ - Either incorrect directory or incorrect McPAT version"; + return; + fi + echo "GPGPU-Sim_McPAT power model detected... Using directory $GPGPUSIM_POWER_MODEL."; +elif [ ! -d $GPGPUSIM_POWER_MODEL ]; then + echo "ERROR ** GPGPUSIM_POWER_MODEL ($GPGPUSIM_POWER_MODEL) does not exist... Please set this to the gpgpusim_mcpat directory or unset this environment variable."; + return; +else + echo "GPGPU-Sim_McPAT power model not detected..."; +fi +echo "============================" + + echo "setup_environment succeeded"; export GPGPUSIM_SETUP_ENVIRONMENT_WAS_RUN=1 |
