From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8345 invoked by alias); 20 Oct 2015 18:34:46 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 8268 invoked by uid 89); 20 Oct 2015 18:34:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.4 required=5.0 tests=AWL,BAYES_50,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: smtp.ispras.ru Received: from smtp.ispras.ru (HELO smtp.ispras.ru) (83.149.199.79) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 20 Oct 2015 18:34:44 +0000 Received: from condor.intra.ispras.ru (unknown [83.149.199.91]) by smtp.ispras.ru (Postfix) with ESMTP id 772EE2050C; Tue, 20 Oct 2015 21:34:37 +0300 (MSK) Received: by condor.intra.ispras.ru (Postfix, from userid 23246) id E41FE1225DAD; Tue, 20 Oct 2015 21:34:36 +0300 (MSK) From: Alexander Monakov To: gcc-patches@gcc.gnu.org Cc: Jakub Jelinek , Dmitry Melnik Subject: [gomp4 08/14] libgomp nvptx: populate proc.c Date: Tue, 20 Oct 2015 18:34:00 -0000 Message-Id: <1445366076-16082-9-git-send-email-amonakov@ispras.ru> In-Reply-To: <1445366076-16082-1-git-send-email-amonakov@ispras.ru> References: <1445366076-16082-1-git-send-email-amonakov@ispras.ru> X-IsSubscribed: yes X-SW-Source: 2015-10/txt/msg01935.txt.bz2 This provides minimal implementations of gomp_dynamic_max_threads and omp_get_num_procs. * config/nvptx/proc.c: New. --- libgomp/config/nvptx/proc.c | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/libgomp/config/nvptx/proc.c b/libgomp/config/nvptx/proc.c index e69de29..6331b8c 100644 --- a/libgomp/config/nvptx/proc.c +++ b/libgomp/config/nvptx/proc.c @@ -0,0 +1,40 @@ +/* Copyright (C) 2015 Free Software Foundation, Inc. + + This file is part of the GNU Offloading and Multi Processing Library + (libgomp). + + Libgomp is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + Libgomp is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. + + Under Section 7 of GPL version 3, you are granted additional + permissions described in the GCC Runtime Library Exception, version + 3.1, as published by the Free Software Foundation. + + You should have received a copy of the GNU General Public License and + a copy of the GCC Runtime Library Exception along with this program; + see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + . */ + +/* This file contains system specific routines related to counting + online processors and dynamic load balancing. */ + +#include "libgomp.h" + +unsigned +gomp_dynamic_max_threads (void) +{ + return gomp_icv (false)->nthreads_var; +} + +int +omp_get_num_procs (void) +{ + return gomp_icv (false)->nthreads_var; +}