]> git.ipfire.org Git - thirdparty/gcc.git/blame - libgomp/oacc-plugin.c
[PR89433] Repeated use of the C/C++ OpenACC 'routine' directive
[thirdparty/gcc.git] / libgomp / oacc-plugin.c
CommitLineData
a5544970 1/* Copyright (C) 2014-2019 Free Software Foundation, Inc.
1df3f842 2
41dbbb37
TS
3 Contributed by Mentor Embedded.
4
f1f3453e
TS
5 This file is part of the GNU Offloading and Multi Processing Library
6 (libgomp).
1df3f842
JJ
7
8 Libgomp is free software; you can redistribute it and/or modify it
9 under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3, or (at your option)
11 any later version.
12
13 Libgomp is distributed in the hope that it will be useful, but WITHOUT ANY
14 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 more details.
17
18 Under Section 7 of GPL version 3, you are granted additional
19 permissions described in the GCC Runtime Library Exception, version
20 3.1, as published by the Free Software Foundation.
21
22 You should have received a copy of the GNU General Public License and
23 a copy of the GCC Runtime Library Exception along with this program;
24 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
25 <http://www.gnu.org/licenses/>. */
26
41dbbb37 27/* Initialize and register OpenACC dispatch table from libgomp plugin. */
1df3f842 28
41dbbb37
TS
29#include "libgomp.h"
30#include "oacc-plugin.h"
31#include "oacc-int.h"
1df3f842 32
1f4c5b9b 33/* This plugin function is now obsolete. */
41dbbb37 34void
1f4c5b9b
CLT
35GOMP_PLUGIN_async_unmap_vars (void *ptr __attribute__((unused)),
36 int async __attribute__((unused)))
1df3f842 37{
1f4c5b9b 38 gomp_fatal ("invalid plugin function");
41dbbb37 39}
1df3f842 40
41dbbb37
TS
41/* Return the target-specific part of the TLS data for the current thread. */
42
43void *
44GOMP_PLUGIN_acc_thread (void)
45{
46 struct goacc_thread *thr = goacc_thread ();
47 return thr ? thr->target_tls : NULL;
48}
ec00d3fa
TV
49
50int
51GOMP_PLUGIN_acc_default_dim (unsigned int i)
52{
53 if (i >= GOMP_DIM_MAX)
54 {
55 gomp_fatal ("invalid dimension argument: %d", i);
56 return -1;
57 }
58 return goacc_default_dims[i];
59}