38 #ifndef MAT_MATINCLUDE 39 #define MAT_MATINCLUDE 64 #define MAT_OMP_INIT enum omp_failType {noFail = 0, standardFail, runtimeFail, matFail}; \ 65 volatile omp_failType omp_fail = noFail; \ 66 std::exception omp_exce; \ 67 std::runtime_error omp_runtime(""); \ 68 Failure omp_matFail; \ 71 #define MAT_OMP_START try { 72 #define MAT_OMP_END } \ 73 catch(Failure & omp_fail_caught) { \ 74 omp_fail = matFail; omp_matFail = omp_fail_caught; } \ 75 catch(std::runtime_error & omp_runtime_caught) { \ 76 omp_fail = runtimeFail; omp_runtime = omp_runtime_caught; } \ 77 catch(std::exception & omp_exce_caught) { \ 78 omp_fail = standardFail; omp_exce = omp_exce_caught; \ 80 #define MAT_OMP_FINALIZE if(omp_fail) \ 81 { std::cerr<<"Exception was thrown in OpenMP parallel region\n"; \ 83 case standardFail: throw omp_exce; break; \ 84 case runtimeFail: throw omp_runtime; break; \ 85 case matFail: throw omp_matFail; break; \ 86 default: throw Failure("Odd error in omp parallel loop\n");} \ 92 #define MAT_OMP_FINALIZE 99 static unsigned int nProcs;
100 static unsigned int matrixParallelLevel;
106 throw Failure(
"mat::Params::getNProcs(): nProcs == 0 Forgot to call setNProcs()?");
115 #ifdef USE_SSE_INTRINSICS 116 Memory_buffer_thread::instance().init_buffers(nProcs);
122 if (matrixParallelLevel == 0)
123 throw Failure(
"mat::Params::getMatrixParallelLevel(): matrixParallelLevel == 0 Forgot to call setMatrixParallelLevel()?");
124 return matrixParallelLevel;
131 matrixParallelLevel = mPL;
146 template<
typename Treal>
148 return template_blas_get_machine_epsilon<Treal>();
151 template<
typename Treal>
153 return getMachineEpsilon<Treal>();
static Treal getRelPrecision()
Definition: matInclude.h:152
static Treal getMachineEpsilon()
Definition: matInclude.h:147
static void setMatrixParallelLevel(unsigned int const mPL)
Definition: matInclude.h:129
std::string getNormTypeString(normType nType)
Definition: matInclude.cc:62
static void setNProcs(unsigned int const nP)
Definition: matInclude.h:112
float peak
Definition: matInclude.h:172
Definition: matInclude.h:165
double ticTime
Definition: matInclude.h:158
void tic()
Definition: matInclude.cc:84
Values()
Definition: matInclude.h:173
Classes describing debug policies with different debug levels.
Class used to keep track of the block sizes used at different levels in the hierarchical matrix data ...
Definition: matInclude.h:96
Definition: allocate.cc:39
Definition: matInclude.h:156
float toc()
Definition: matInclude.cc:88
Definition: matInclude.h:138
float res
Definition: matInclude.h:170
Definition: matInclude.h:139
float virt
Definition: matInclude.h:171
static void getMemUsage(Values &values)
Definition: matInclude.cc:134
Definition: matInclude.h:139
static unsigned int getMatrixParallelLevel()
Definition: matInclude.h:120
Definition: matInclude.h:138
static int getNumberFromBuffer(const char *buffer, const char *s)
Definition: matInclude.cc:96
static double get_wall_seconds()
Definition: matInclude.cc:74
static unsigned int getNProcs()
Definition: matInclude.h:103
Code for managing aligned memory buffers, used if SSE intrinsics enabled.
Time()
Definition: matInclude.cc:82
Definition: matInclude.h:139
Definition: matInclude.h:169
normType getNormType(const char *normStr)
Definition: matInclude.cc:52
normType
Definition: matInclude.h:139
The Failure class is used for exception handling.