libstdc++
compiletime_settings.h
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 // Copyright (C) 2007, 2009 Free Software Foundation, Inc.
00004 //
00005 // This file is part of the GNU ISO C++ Library.  This library is free
00006 // software; you can redistribute it and/or modify it under the terms
00007 // of the GNU General Public License as published by the Free Software
00008 // Foundation; either version 3, or (at your option) any later
00009 // version.
00010 
00011 // This library is distributed in the hope that it will be useful, but
00012 // WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // General Public License for more details.
00015 
00016 // Under Section 7 of GPL version 3, you are granted additional
00017 // permissions described in the GCC Runtime Library Exception, version
00018 // 3.1, as published by the Free Software Foundation.
00019 
00020 // You should have received a copy of the GNU General Public License and
00021 // a copy of the GCC Runtime Library Exception along with this program;
00022 // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
00023 // <http://www.gnu.org/licenses/>.
00024 
00025 /** @file parallel/compiletime_settings.h
00026  *  @brief Defines on options concerning debugging and performance, at
00027  *  compile-time.
00028  *  This file is a GNU parallel extension to the Standard C++ Library.
00029  */
00030 
00031 // Written by Johannes Singler.
00032 
00033 #include <cstdio>
00034 
00035 /** @brief Determine verbosity level of the parallel mode.
00036  *  Level 1 prints a message each time a parallel-mode function is entered. */
00037 #define _GLIBCXX_VERBOSE_LEVEL 0
00038 
00039 /** @def _GLIBCXX_CALL
00040  *  @brief Macro to produce log message when entering a function.
00041  *  @param __n Input size.
00042  *  @see _GLIBCXX_VERBOSE_LEVEL */
00043 #if (_GLIBCXX_VERBOSE_LEVEL == 0)
00044 #define _GLIBCXX_CALL(__n)
00045 #endif
00046 #if (_GLIBCXX_VERBOSE_LEVEL == 1)
00047 #define _GLIBCXX_CALL(__n) \
00048   printf("   %__s:\niam = %d, __n = %ld, __num_threads = %d\n", \
00049   __PRETTY_FUNCTION__, omp_get_thread_num(), (__n), __get_max_threads());
00050 #endif
00051 
00052 #ifndef _GLIBCXX_SCALE_DOWN_FPU
00053 /** @brief Use floating-point scaling instead of modulo for mapping
00054  *  random numbers to a range.  This can be faster on certain CPUs. */
00055 #define _GLIBCXX_SCALE_DOWN_FPU 0
00056 #endif
00057 
00058 #ifndef _GLIBCXX_ASSERTIONS
00059 /** @brief Switch on many _GLIBCXX_PARALLEL_ASSERTions in parallel code.
00060  *  Should be switched on only locally. */
00061 #define _GLIBCXX_ASSERTIONS 0
00062 #endif
00063 
00064 #ifndef _GLIBCXX_RANDOM_SHUFFLE_CONSIDER_L1
00065 /** @brief Switch on many _GLIBCXX_PARALLEL_ASSERTions in parallel code.
00066  *  Consider the size of the L1 cache for
00067 *  gnu_parallel::__parallel_random_shuffle(). */
00068 #define _GLIBCXX_RANDOM_SHUFFLE_CONSIDER_L1 0
00069 #endif
00070 #ifndef _GLIBCXX_RANDOM_SHUFFLE_CONSIDER_TLB
00071 /** @brief Switch on many _GLIBCXX_PARALLEL_ASSERTions in parallel code.
00072  *  Consider the size of the TLB for
00073 *  gnu_parallel::__parallel_random_shuffle(). */
00074 #define _GLIBCXX_RANDOM_SHUFFLE_CONSIDER_TLB 0
00075 #endif