00001 /* 00002 00003 OpenMP runtime library to be used in conjunction with Open64 Compiler Suites. 00004 00005 Copyright (C) 2003 - 2009 Tsinghua University. 00006 00007 This library is free software; you can redistribute it and/or 00008 modify it under the terms of the GNU Lesser General Public 00009 License as published by the Free Software Foundation; either 00010 version 2.1 of the License, or (at your option) any later version. 00011 00012 This library is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 Lesser General Public License for more details. 00016 00017 You should have received a copy of the GNU Lesser General Public 00018 License along with this library; if not, write to the Free Software 00019 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00020 00021 Contact information: HPC Institute, Department of Computer Science and Technology, 00022 Tsinghua University, Beijing 100084, CHINA, or: 00023 00024 http://hpc.cs.tsinghua.edu.cn 00025 00026 */ 00027 00028 /* 00029 * File: omp_init.cxx 00030 * Abstract: initialize the internal data structures used in libopenmp by C++ ctor 00031 * History: 21/10/2008, created by Lai JianXin 00032 */ 00033 00034 /* 00035 * To align with the Pathscale OMP lowering 00036 * Put '__ompc_sug_numthreads' here so that this file can be linked into the executable. 00037 */ 00038 int __ompc_sug_numthreads = 0; 00039 00040 extern "C" int __ompc_init_rtl(int num_threads); 00041 00042 /* 00043 * class __ompc_rtl_initializer 00044 * initialize the libopenmp by a static instance. 00045 */ 00046 class __ompc_rtl_initializer { 00047 private: 00048 __ompc_rtl_initializer() { 00049 // initialize the openmp rtl 00050 __ompc_init_rtl(0); 00051 } 00052 ~__ompc_rtl_initializer() { 00053 // Do nothing since __ompc_fini_rtl is added to atexit. 00054 } 00055 static __ompc_rtl_initializer inst_; 00056 }; 00057 __ompc_rtl_initializer __ompc_rtl_initializer::inst_; 00058
1.5.6