netlist: move things where they belong (nw)

OMP defines belong into pconfig.h since pomp.h - used by netlist -
depends on them.
This commit is contained in:
couriersud 2019-04-29 20:58:21 +02:00
parent e6f25d18c8
commit 68d89ba465
3 changed files with 34 additions and 39 deletions

View File

@ -473,10 +473,11 @@ void netlist_t::print_stats() const
log().verbose("Total loop {1:15}", m_stat_mainloop());
log().verbose("Total time {1:15}", total_time);
/* Only one serialization should be counted in total time */
/* But two are contained in m_stat_mainloop */
if (!!USE_QUEUE_STATS)
// FIXME: clang complains about unreachable code without
if (USE_QUEUE_STATS || (!USE_QUEUE_STATS && m_stats))
{
/* Only one serialization should be counted in total time */
/* But two are contained in m_stat_mainloop */
nperftime_t<true> overhead;
nperftime_t<true> test;
{

View File

@ -75,29 +75,9 @@
#endif
//============================================================
// General Macros
// Time resolution
//============================================================
#if defined(OPENMP)
#define HAS_OPENMP ( OPENMP >= 200805 )
#elif defined(_OPENMP)
#define HAS_OPENMP ( _OPENMP >= 200805 )
#else
#define HAS_OPENMP (0)
#endif
//============================================================
// General
//============================================================
/* The following adds about 10% to 20% performance for analog
* netlists like kidniki.
*/
#if !defined(USE_OPENMP)
#define USE_OPENMP (0)
#endif // !defined(USE_OPENMP)
// Use nano-second resolution - Sufficient for now
static constexpr const auto NETLIST_INTERNAL_RES = 1000000000;
@ -113,14 +93,4 @@ static constexpr const auto NETLIST_CLOCK = NETLIST_INTERNAL_RES;
//#define nl_double float
using nl_double = double;
//============================================================
// WARNINGS
//============================================================
#if (USE_OPENMP)
#if (!(HAS_OPENMP))
#error To use openmp compile and link with "-fopenmp"
#endif
#endif
#endif /* NLCONFIG_H_ */

View File

@ -33,6 +33,15 @@
#define PHAS_INT128 (0)
#endif
/*
* OpenMP adds about 10% to 20% performance for analog
* netlists like kidniki.
*/
#ifndef USE_OPENMP
#define USE_OPENMP (0)
#endif
/*
* Set this to one if you want to use aligned storage optimizations.
*/
@ -95,19 +104,23 @@
#endif
#endif
#ifndef PHAS_INT128
#define PHAS_INT128 (0)
#endif
#if (PHAS_INT128)
typedef __uint128_t UINT128;
typedef __int128_t INT128;
#endif
//============================================================
// Standard defines
// Check for OpenMP
//============================================================
#if defined(OPENMP)
#define HAS_OPENMP ( OPENMP >= 200805 )
#elif defined(_OPENMP)
#define HAS_OPENMP ( _OPENMP >= 200805 )
#else
#define HAS_OPENMP (0)
#endif
//============================================================
// Pointer to Member Function
//============================================================
@ -156,4 +169,15 @@ typedef __int128_t INT128;
#define MEMBER_ABI
#endif
//============================================================
// WARNINGS
//============================================================
#if (USE_OPENMP)
#if (!(HAS_OPENMP))
#error To use openmp compile and link with "-fopenmp"
#endif
#endif
#endif /* PCONFIG_H_ */