| 1 |
/* |
| 2 |
* (C) Copyright 2013 ECMWF. |
| 3 |
* |
| 4 |
* This software is licensed under the terms of the Apache Licence Version 2.0 |
| 5 |
* which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. |
| 6 |
* In applying this licence, ECMWF does not waive the privileges and immunities |
| 7 |
* granted to it by virtue of its status as an intergovernmental organisation |
| 8 |
* nor does it submit to any jurisdiction. |
| 9 |
*/ |
| 10 |
|
| 11 |
#pragma once |
| 12 |
|
| 13 |
#include <string> |
| 14 |
|
| 15 |
//----------------------------------------------------------------------------------------------------------- |
| 16 |
|
| 17 |
namespace atlas { |
| 18 |
namespace runtime { |
| 19 |
namespace trace { |
| 20 |
|
| 21 |
class NoBarriers { |
| 22 |
public: |
| 23 |
NoBarriers(bool state) {} |
| 24 |
void restore() {} |
| 25 |
|
| 26 |
public: // static methods |
| 27 |
static bool state() { return false; } |
| 28 |
static void execute() {} |
| 29 |
static double time(); |
| 30 |
static std::string report(); |
| 31 |
}; |
| 32 |
|
| 33 |
class Barriers { |
| 34 |
public: |
| 35 |
Barriers(bool state); |
| 36 |
~Barriers(); |
| 37 |
void restore(); |
| 38 |
|
| 39 |
public: // static methods |
| 40 |
static bool state(); |
| 41 |
static void execute(); |
| 42 |
static double time(); |
| 43 |
static std::string report(); |
| 44 |
|
| 45 |
private: |
| 46 |
bool previous_state_; |
| 47 |
}; |
| 48 |
|
| 49 |
} // namespace trace |
| 50 |
} // namespace runtime |
| 51 |
} // namespace atlas |