diff --git a/CMakeLists.txt b/CMakeLists.txt index bfc224cfd15f778225f438e19604748f801dd58e..175d3fb4781208d32be4ec16f4b6a4a3f79bfdb3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,6 +25,17 @@ IF(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUCC) ) ENDIF(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUCC) +IF (${CMAKE_C_COMPILER} MATCHES "icc.*$" OR ${CMAKE_CXX_COMPILER} MATCHES "icpc.*$") + IF( NOT CMAKE_BUILD_TYPE STREQUAL "Debug" ) + MESSAGE(STATUS "Set Intel release flags") + SET(CMAKE_CXX_FLAGS "-O3 -DNDEBUG") + ENDIF() + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated -Wall") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -openmp") +ENDIF(${CMAKE_C_COMPILER} MATCHES "icc.*$" OR ${CMAKE_CXX_COMPILER} MATCHES +"icpc.*$") + + # Set build directories SET( EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin ) SET( LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib ) diff --git a/SimpleTests/SolverTests/ConjugateGradientDiagonalPreconditioned.cpp b/SimpleTests/SolverTests/ConjugateGradientDiagonalPreconditioned.cpp index 44855d1109847006bbc95b2991fe8a9f90be30ae..d533628c4194028a1f4227372053dd540a065740 100644 --- a/SimpleTests/SolverTests/ConjugateGradientDiagonalPreconditioned.cpp +++ b/SimpleTests/SolverTests/ConjugateGradientDiagonalPreconditioned.cpp @@ -64,7 +64,11 @@ int main(int argc, char *argv[]) if (num_omp_threads == 1) { MathLib::CG(mat, b, x, eps, steps); } else { + #ifdef _OPENMP MathLib::CGParallel(mat, b, x, eps, steps, num_omp_threads); + #else + std::cout << "OpenMP is not switched on" << std::endl; + #endif } cpu_timer.stop();