Arcane  v3.14.10.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
FloatingPointExceptionSentry.cc
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2023 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* FloatingPointExceptionSentry.cc (C) 2000-2023 */
9/* */
10/* Activation/désactivation temporaire des exceptions flottantes */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14#include "arcane/utils/PlatformUtils.h"
15#include "arcane/utils/FloatingPointExceptionSentry.h"
16
17/*---------------------------------------------------------------------------*/
18/*---------------------------------------------------------------------------*/
19
20namespace Arcane
21{
22
23/*---------------------------------------------------------------------------*/
24/*---------------------------------------------------------------------------*/
25
26FloatingPointExceptionSentry::
27FloatingPointExceptionSentry(bool want_active)
28: m_want_active(want_active)
29, m_is_active(platform::isFloatingExceptionEnabled())
30{
31 platform::enableFloatingException(m_want_active);
32}
33
34/*---------------------------------------------------------------------------*/
35/*---------------------------------------------------------------------------*/
36
37FloatingPointExceptionSentry::
38~FloatingPointExceptionSentry()
39{
40 platform::enableFloatingException(m_is_active);
41}
42
43/*---------------------------------------------------------------------------*/
44/*---------------------------------------------------------------------------*/
45
46} // namespace Arcane
47
48/*---------------------------------------------------------------------------*/
49/*---------------------------------------------------------------------------*/
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
ARCCORE_BASE_EXPORT bool isFloatingExceptionEnabled()
Indique si les exceptions flottantes du processeur sont activées.