Improved SIMD test data to use all bits
[gromacs.git] / src / gromacs / simd / tests / data.h
blobb66abcece7bcb2ebdc5723cda11a1f272b854e1b
1 /*
2 * This file is part of the GROMACS molecular simulation package.
4 * Copyright (c) 2014,2015,2016,2017, by the GROMACS development team, led by
5 * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
6 * and including many others, as listed in the AUTHORS file in the
7 * top-level source directory and at http://www.gromacs.org.
9 * GROMACS is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public License
11 * as published by the Free Software Foundation; either version 2.1
12 * of the License, or (at your option) any later version.
14 * GROMACS is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with GROMACS; if not, see
21 * http://www.gnu.org/licenses, or write to the Free Software Foundation,
22 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 * If you want to redistribute modifications to GROMACS, please
25 * consider that scientific software is very special. Version
26 * control is crucial - bugs must be traceable. We will be happy to
27 * consider code for inclusion in the official distribution, but
28 * derived work must not be called official GROMACS. Details are found
29 * in the README & COPYING files - if they are missing, get the
30 * official version at http://www.gromacs.org.
32 * To help us fund GROMACS development, we humbly ask that you cite
33 * the research papers on the package. Check out http://www.gromacs.org.
35 #ifndef GMX_SIMD_TESTS_DATA_H
36 #define GMX_SIMD_TESTS_DATA_H
38 /*! \internal \file
39 * \brief Common test data constants for SIMD, SIMD4 and scalar tests
41 * To avoid silent bugs due to double/float truncation if we ever use the
42 * wrong return type of routines, we want to use test data that fills all
43 * available bits in either single or double precision. The values themselves
44 * are meaningless.
45 * Note that the data is used to initialize the SIMD constants, which for
46 * technical (alignment) reasons in some compilers cannot be placed inside
47 * the text fixture classes. For that reason this data cannot go in the
48 * fixtures either.
50 * \author Erik Lindahl <erik.lindahl@scilifelab.se>
51 * \ingroup module_simd
54 #include "gromacs/utility/real.h"
56 namespace gmx
58 namespace test
61 /*! \cond internal */
62 /*! \addtogroup module_simd */
63 /*! \{ */
64 extern const real czero; //!< Value 0.0 in real precision
65 extern const real c0; //!< Random fp value using entire mantissa
66 extern const real c1; //!< Random fp value using entire mantissa
67 extern const real c2; //!< Random fp value using entire mantissa
68 extern const real c3; //!< Random fp value using entire mantissa
69 extern const real c4; //!< Random fp value using entire mantissa
70 extern const real c5; //!< Random fp value using entire mantissa
71 extern const real c5; //!< Random fp value using entire mantissa
72 extern const real c6; //!< Random fp value using entire mantissa
73 extern const real c7; //!< Random fp value using entire mantissa
74 extern const real c8; //!< Random fp value using entire mantissa
75 extern const real c9; //!< Random fp value using entire mantissa
77 /*! \} */
78 /*! \endcond */
80 } // namespace test
81 } // namespace gmx
83 #endif