Teuchos - Trilinos Tools Package
Version of the Day
Toggle main menu visibility
Loading...
Searching...
No Matches
core
src
Teuchos_Behavior.cpp
1
// @HEADER
2
// *****************************************************************************
3
// Teuchos: Common Tools Package
4
//
5
// Copyright 2004 NTESS and the Teuchos contributors.
6
// SPDX-License-Identifier: BSD-3-Clause
7
// *****************************************************************************
8
// @HEADER
9
10
#ifndef TEUCHOS_BEHAVIOR_HPP
11
#define TEUCHOS_BEHAVIOR_HPP
12
13
#include "Teuchos_Behavior.hpp"
14
#include "Teuchos_EnvVariables.hpp"
15
#include "
Teuchos_TestForException.hpp
"
16
17
namespace
Teuchos
{
18
19
constexpr
const
std::string_view FENCE_TIMERS =
"TEUCHOS_FENCE_TIMERS"
;
20
21
constexpr
bool
fenceTimersDefault() {
22
#ifdef HAVE_TEUCHOS_TIMER_KOKKOS_FENCE
23
return
true
;
24
#else
25
return
false
;
26
#endif
// HAVE_TEUCHOS_TIMER_KOKKOS_FENCE
27
}
28
29
30
bool
Behavior::fenceTimers() {
31
constexpr
bool
defaultValue = Teuchos::fenceTimersDefault();
32
33
static
bool
value_ = defaultValue;
34
static
bool
initialized_ =
false
;
35
return
Teuchos::idempotentlyGetEnvironmentVariable
(value_, initialized_, Teuchos::FENCE_TIMERS,
36
defaultValue);
37
}
38
39
}
// namespace Teuchos
40
41
#endif
Teuchos_TestForException.hpp
Standard test and throw macros.
Teuchos
The Teuchos namespace contains all of the classes, structs and enums used by Teuchos,...
Teuchos::idempotentlyGetEnvironmentVariable
T idempotentlyGetEnvironmentVariable(T &value, bool &initialized, const std::string_view environmentVariableName, const T defaultValue)
Read a variable from the environment. Example usage:
Definition
Teuchos_EnvVariables.cpp:182
Generated by
1.17.0