diff options
author | Andrew Stubbs <ams@codesourcery.com> | 2019-11-13 12:37:50 +0000 |
---|---|---|
committer | Andrew Stubbs <ams@gcc.gnu.org> | 2019-11-13 12:37:50 +0000 |
commit | b3d14b3aa343eb7fc656e7f4d3c9b2dc04be63be (patch) | |
tree | 197bef20a1b2dd37032aba5764b760b48ddc6d59 /libgomp/config/accel/proc.c | |
parent | e3d0ee4acf2bc84a3e081442ba022ab148958a7b (diff) | |
download | gcc-b3d14b3aa343eb7fc656e7f4d3c9b2dc04be63be.zip gcc-b3d14b3aa343eb7fc656e7f4d3c9b2dc04be63be.tar.gz gcc-b3d14b3aa343eb7fc656e7f4d3c9b2dc04be63be.tar.bz2 |
Move generic libgomp files from nvptx to accel
2019-11-13 Andrew Stubbs <ams@codesourcery.com>
libgomp/
* configure.tgt (nvptx*-*-*): Add "accel" directory.
* config/nvptx/libgomp-plugin.c: Move ...
* config/accel/libgomp-plugin.c: ... to here.
* config/nvptx/lock.c: Move ...
* config/accel/lock.c: ... to here.
* config/nvptx/mutex.c: Move ...
* config/accel/mutex.c: ... to here.
* config/nvptx/mutex.h: Move ...
* config/accel/mutex.h: ... to here.
* config/nvptx/oacc-async.c: Move ...
* config/accel/oacc-async.c: ... to here.
* config/nvptx/oacc-cuda.c: Move ...
* config/accel/oacc-cuda.c: ... to here.
* config/nvptx/oacc-host.c: Move ...
* config/accel/oacc-host.c: ... to here.
* config/nvptx/oacc-init.c: Move ...
* config/accel/oacc-init.c: ... to here.
* config/nvptx/oacc-mem.c: Move ...
* config/accel/oacc-mem.c: ... to here.
* config/nvptx/oacc-plugin.c: Move ...
* config/accel/oacc-plugin.c: ... to here.
* config/nvptx/omp-lock.h: Move ...
* config/accel/omp-lock.h: ... to here.
* config/nvptx/openacc.f90: Move ...
* config/accel/openacc.f90: ... to here.
* config/nvptx/pool.h: Move ...
* config/accel/pool.h: ... to here.
* config/nvptx/proc.c: Move ...
* config/accel/proc.c: ... to here.
* config/nvptx/ptrlock.c: Move ...
* config/accel/ptrlock.c: ... to here.
* config/nvptx/ptrlock.h: Move ...
* config/accel/ptrlock.h: ... to here.
* config/nvptx/sem.c: Move ...
* config/accel/sem.c: ... to here.
* config/nvptx/sem.h: Move ...
* config/accel/sem.h: ... to here.
* config/nvptx/thread-stacksize.h: Move ...
* config/accel/thread-stacksize.h: ... to here.
From-SVN: r278132
Diffstat (limited to 'libgomp/config/accel/proc.c')
-rw-r--r-- | libgomp/config/accel/proc.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/libgomp/config/accel/proc.c b/libgomp/config/accel/proc.c new file mode 100644 index 0000000..8ca0b0a --- /dev/null +++ b/libgomp/config/accel/proc.c @@ -0,0 +1,41 @@ +/* Copyright (C) 2015-2019 Free Software Foundation, Inc. + Contributed by Alexander Monakov <amonakov@ispras.ru> + + 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 + <http://www.gnu.org/licenses/>. */ + +/* 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; +} |