diff options
| author | Thomas Schwinge <tschwinge@gcc.gnu.org> | 2017-01-31 15:32:58 +0100 |
|---|---|---|
| committer | Thomas Schwinge <tschwinge@gcc.gnu.org> | 2017-01-31 15:32:58 +0100 |
| commit | dced339c8a6fa30f90181da525fb0da4801bdf39 (patch) | |
| tree | f36f8b40db8041e76435b0fdb135725c95644f02 /libgomp/libgomp-plugin.h | |
| parent | 5b11971a564ab8a207e0fa416eb9e0424514529e (diff) | |
libgomp: Provide prototypes for functions implemented by libgomp plugins
libgomp/
* libgomp-plugin.h: #include <stdbool.h>.
(GOMP_OFFLOAD_get_name, GOMP_OFFLOAD_get_caps)
(GOMP_OFFLOAD_get_type, GOMP_OFFLOAD_get_num_devices)
(GOMP_OFFLOAD_init_device, GOMP_OFFLOAD_fini_device)
(GOMP_OFFLOAD_version, GOMP_OFFLOAD_load_image)
(GOMP_OFFLOAD_unload_image, GOMP_OFFLOAD_alloc, GOMP_OFFLOAD_free)
(GOMP_OFFLOAD_dev2host, GOMP_OFFLOAD_host2dev)
(GOMP_OFFLOAD_dev2dev, GOMP_OFFLOAD_can_run, GOMP_OFFLOAD_run)
(GOMP_OFFLOAD_async_run, GOMP_OFFLOAD_openacc_parallel)
(GOMP_OFFLOAD_openacc_register_async_cleanup)
(GOMP_OFFLOAD_openacc_async_test)
(GOMP_OFFLOAD_openacc_async_test_all)
(GOMP_OFFLOAD_openacc_async_wait)
(GOMP_OFFLOAD_openacc_async_wait_async)
(GOMP_OFFLOAD_openacc_async_wait_all)
(GOMP_OFFLOAD_openacc_async_wait_all_async)
(GOMP_OFFLOAD_openacc_async_set_async)
(GOMP_OFFLOAD_openacc_create_thread_data)
(GOMP_OFFLOAD_openacc_destroy_thread_data)
(GOMP_OFFLOAD_openacc_get_current_cuda_device)
(GOMP_OFFLOAD_openacc_get_current_cuda_context)
(GOMP_OFFLOAD_openacc_get_cuda_stream)
(GOMP_OFFLOAD_openacc_set_cuda_stream): New prototypes.
* libgomp.h (struct acc_dispatch_t, struct gomp_device_descr): Use
these.
* plugin/plugin-hsa.c (GOMP_OFFLOAD_load_image)
(GOMP_OFFLOAD_unload_image): Fix argument types.
liboffloadmic/
* plugin/libgomp-plugin-intelmic.cpp (GOMP_OFFLOAD_get_type): Fix
return type.
(GOMP_OFFLOAD_load_image): Fix argument types.
From-SVN: r245062
Diffstat (limited to 'libgomp/libgomp-plugin.h')
| -rw-r--r-- | libgomp/libgomp-plugin.h | 43 |
1 files changed, 40 insertions, 3 deletions
diff --git a/libgomp/libgomp-plugin.h b/libgomp/libgomp-plugin.h index 107117bf8a6..fba45ee1754 100644 --- a/libgomp/libgomp-plugin.h +++ b/libgomp/libgomp-plugin.h @@ -1,4 +1,6 @@ -/* Copyright (C) 2014-2017 Free Software Foundation, Inc. +/* The libgomp plugin API. + + Copyright (C) 2014-2017 Free Software Foundation, Inc. Contributed by Mentor Embedded. @@ -24,11 +26,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see <http://www.gnu.org/licenses/>. */ -/* An interface to various libgomp-internal functions for use by plugins. */ - #ifndef LIBGOMP_PLUGIN_H #define LIBGOMP_PLUGIN_H 1 +#include <stdbool.h> #include <stddef.h> #include <stdint.h> @@ -73,6 +74,42 @@ extern void GOMP_PLUGIN_error (const char *, ...) extern void GOMP_PLUGIN_fatal (const char *, ...) __attribute__ ((noreturn, format (printf, 1, 2))); +/* Prototypes for functions implemented by libgomp plugins. */ +extern const char *GOMP_OFFLOAD_get_name (void); +extern unsigned int GOMP_OFFLOAD_get_caps (void); +extern int GOMP_OFFLOAD_get_type (void); +extern int GOMP_OFFLOAD_get_num_devices (void); +extern bool GOMP_OFFLOAD_init_device (int); +extern bool GOMP_OFFLOAD_fini_device (int); +extern unsigned GOMP_OFFLOAD_version (void); +extern int GOMP_OFFLOAD_load_image (int, unsigned, const void *, + struct addr_pair **); +extern bool GOMP_OFFLOAD_unload_image (int, unsigned, const void *); +extern void *GOMP_OFFLOAD_alloc (int, size_t); +extern bool GOMP_OFFLOAD_free (int, void *); +extern bool GOMP_OFFLOAD_dev2host (int, void *, const void *, size_t); +extern bool GOMP_OFFLOAD_host2dev (int, void *, const void *, size_t); +extern bool GOMP_OFFLOAD_dev2dev (int, void *, const void *, size_t); +extern bool GOMP_OFFLOAD_can_run (void *); +extern void GOMP_OFFLOAD_run (int, void *, void *, void **); +extern void GOMP_OFFLOAD_async_run (int, void *, void *, void **, void *); +extern void GOMP_OFFLOAD_openacc_parallel (void (*) (void *), size_t, void **, + void **, int, unsigned *, void *); +extern void GOMP_OFFLOAD_openacc_register_async_cleanup (void *, int); +extern int GOMP_OFFLOAD_openacc_async_test (int); +extern int GOMP_OFFLOAD_openacc_async_test_all (void); +extern void GOMP_OFFLOAD_openacc_async_wait (int); +extern void GOMP_OFFLOAD_openacc_async_wait_async (int, int); +extern void GOMP_OFFLOAD_openacc_async_wait_all (void); +extern void GOMP_OFFLOAD_openacc_async_wait_all_async (int); +extern void GOMP_OFFLOAD_openacc_async_set_async (int); +extern void *GOMP_OFFLOAD_openacc_create_thread_data (int); +extern void GOMP_OFFLOAD_openacc_destroy_thread_data (void *); +extern void *GOMP_OFFLOAD_openacc_get_current_cuda_device (void); +extern void *GOMP_OFFLOAD_openacc_get_current_cuda_context (void); +extern void *GOMP_OFFLOAD_openacc_get_cuda_stream (int); +extern int GOMP_OFFLOAD_openacc_set_cuda_stream (int, void *); + #ifdef __cplusplus } #endif |
