OpenACC acc_on_device: Harden builtin expansion.
[official-gcc.git] / libgomp / libgomp-plugin.c
blobb30c260cecd78dd2d47013c813cbc3e329049662
1 /* Copyright (C) 2014 Free Software Foundation, Inc.
3 Contributed by Mentor Embedded.
5 This file is part of the GNU Offloading and Multi Processing Library
6 (libgomp).
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.
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.
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.
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/>. */
27 /* Exported (non-hidden) functions exposing libgomp interface for plugins. */
29 #include <stdlib.h>
31 #include "libgomp.h"
32 #include "libgomp-plugin.h"
33 #include "libgomp_target.h"
35 void *
36 GOMP_PLUGIN_malloc (size_t size)
38 return gomp_malloc (size);
41 void *
42 GOMP_PLUGIN_malloc_cleared (size_t size)
44 return gomp_malloc_cleared (size);
47 void *
48 GOMP_PLUGIN_realloc (void *ptr, size_t size)
50 return gomp_realloc (ptr, size);
53 void
54 GOMP_PLUGIN_debug (int kind, const char *msg, ...)
56 va_list ap;
58 va_start (ap, msg);
59 gomp_debug (kind, msg, ap);
60 va_end (ap);
63 void
64 GOMP_PLUGIN_error (const char *msg, ...)
66 va_list ap;
68 va_start (ap, msg);
69 gomp_verror (msg, ap);
70 va_end (ap);
73 void
74 GOMP_PLUGIN_fatal (const char *msg, ...)
76 va_list ap;
78 va_start (ap, msg);
79 gomp_vfatal (msg, ap);
80 va_end (ap);
82 /* Unreachable. */
83 abort ();
86 void
87 GOMP_PLUGIN_mutex_init (gomp_mutex_t *mutex)
89 gomp_mutex_init (mutex);
92 void
93 GOMP_PLUGIN_mutex_destroy (gomp_mutex_t *mutex)
95 gomp_mutex_destroy (mutex);
98 void
99 GOMP_PLUGIN_mutex_lock (gomp_mutex_t *mutex)
101 gomp_mutex_lock (mutex);
104 void
105 GOMP_PLUGIN_mutex_unlock (gomp_mutex_t *mutex)
107 gomp_mutex_unlock (mutex);