Commit d8864582ec874f26dbd329c6b2b80322333c2f85
Merge branch 'Add-OpenMP-Include-To-GCTAOnOffObservation' into integration
Showing
1 changed file
with
9 additions
and
0 deletions
inst/cta/src/GCTAOnOffObservation.cpp
| ... | ... | @@ -46,6 +46,11 @@ |
| 46 | 46 | #include "GCTAModelIrfBackground.hpp" |
| 47 | 47 | #include "GCTAOnOffObservation.hpp" |
| 48 | 48 | |
| 49 | +/* __ OpenMP section _____________________________________________________ */ | |
| 50 | +#ifdef _OPENMP | |
| 51 | +#include <omp.h> | |
| 52 | +#endif | |
| 53 | + | |
| 49 | 54 | /* __ Globals ____________________________________________________________ */ |
| 50 | 55 | const GCTAOnOffObservation g_onoff_obs_cta_seed; |
| 51 | 56 | const GObservationRegistry g_onoff_obs_cta_registry(&g_onoff_obs_cta_seed); |
| ... | ... | @@ -529,8 +534,12 @@ double GCTAOnOffObservation::likelihood(const GModels& models, |
| 529 | 534 | { |
| 530 | 535 | // Timing measurement |
| 531 | 536 | #if defined(G_LIKELIHOOD_DEBUG) |
| 537 | + #ifdef _OPENMP | |
| 538 | + double t_start = omp_get_wtime(); | |
| 539 | + #else | |
| 532 | 540 | clock_t t_start = clock(); |
| 533 | 541 | #endif |
| 542 | + #endif | |
| 534 | 543 | |
| 535 | 544 | // Initialise statistics |
| 536 | 545 | #if defined(G_LIKELIHOOD_DEBUG) | ... | ... |