Adding check on Array to ensure it is within bounds (debug mode only)

This commit is contained in:
Mark Berrill
2015-04-16 10:54:58 -04:00
parent 1f212e2b68
commit 197b788330
3 changed files with 33 additions and 20 deletions

View File

@@ -32,7 +32,7 @@ ENDFUNCTION()
# Macro to configure CUDA
MACRO( CONFIGURE_CUDA )
CHECK_ENABLE_FLAG( USE_CUDA 0 )
IF( USE_CUDA )
IF ( USE_CUDA )
# Include FindCUDA
INCLUDE( FindCUDA )
IF ( NOT CUDA_FOUND )
@@ -91,7 +91,7 @@ MACRO( CONFIGURE_MPI )
SET ( MPI_INCLUDE_PATH ${MPI_DIRECTORY}/include )
VERIFY_PATH ( ${MPI_INCLUDE_PATH} )
IF ( NOT EXISTS ${MPI_INCLUDE_PATH}/mpi.h )
MESSAGE ( FATAL_ERROR "mpi.h not found in ${MPI_INCLUDE_PATH}/include" )
MESSAGE( FATAL_ERROR "mpi.h not found in ${MPI_INCLUDE_PATH}" )
ENDIF ()
INCLUDE_DIRECTORIES ( ${MPI_INCLUDE_PATH} )
SET ( MPI_INCLUDE ${MPI_INCLUDE_PATH} )
@@ -116,20 +116,14 @@ MACRO( CONFIGURE_MPI )
ENDIF()
ELSEIF ( MPI_COMPILER )
# The mpi compiler should take care of everything
IF ( NOT MPIEXEC )
MESSAGE( FATAL_ERROR "MPIEXEC should be set" )
ENDIF()
ELSE()
# Perform the default search for MPI
INCLUDE ( FindMPI )
IF ( NOT MPI_FOUND )
MESSAGE( " MPI_INCLUDE = ${MPI_INCLUDE}" )
MESSAGE( " MPI_LINK_FLAGS = ${MPI_LINK_FLAGS}" )
MESSAGE( " MPI_LIBRARIES = ${MPI_LIBRARIES}" )
MESSAGE( FATAL_ERROR "Did not find MPI" )
ENDIF ()
INCLUDE_DIRECTORIES( "${MPI_INCLUDE_PATH}" )
SET( MPI_INCLUDE "${MPI_INCLUDE_PATH}" )
INCLUDE_DIRECTORIES ( ${MPI_INCLUDE_PATH} )
SET ( MPI_INCLUDE ${MPI_INCLUDE_PATH} )
ENDIF()
# Check if we need to use MPI for serial tests
CHECK_ENABLE_FLAG( USE_MPI_FOR_SERIAL_TESTS 0 )