Skip to content
Snippets Groups Projects
Commit c3e43dda authored by Tom Fischer's avatar Tom Fischer
Browse files

some changes in programming settings for test purposes

fixed a small issue concerning compiling with OpenMP support
parent c46d5758
No related branches found
No related tags found
No related merge requests found
......@@ -28,7 +28,7 @@ IF(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUCC)
# see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33144
SET(CMAKE_CXX_FLAGS "-O3 -mtune=native -msse4.2 -DNDEBUG")
ELSE()
SET(CMAKE_CXX_FLAGS "-O3 -march=native -mtune=native -msse4.2 -DNDEBUG")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -march=native -mtune=native -msse4.2 -DNDEBUG")
ENDIF()
ENDIF()
# -g
......
......@@ -35,7 +35,6 @@ namespace MathLib {
unsigned CGParallel(CRSMatrix<double,unsigned> const * mat, double const * const b,
double* const x, double& eps, unsigned& nsteps, unsigned num_threads)
{
omp_set_num_threads(num_threads);
unsigned N = mat->getNRows();
double * __restrict__ p(new double[N]);
double * __restrict__ q(new double[N]);
......
......@@ -57,11 +57,10 @@ int main(int argc, char *argv[])
}
#ifdef _OPENMP
omp_set_num_threads(n_threads);
MathLib::CRSMatrixOpenMP<double, unsigned> mat (n, iA, jA, A, n_threads);
std::cout << "OpenMP matrix class used" << std::endl;
#else
MathLib::CRSMatrix<double, unsigned> mat (n, iA, jA, A);
std::cout << "matrix class without OpenMP used" << std::endl;
#endif
// CRSMatrixPThreads<double> mat (n, iA, jA, A, n_threads);
std::cout << mat.getNRows() << " x " << mat.getNCols() << std::endl;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment