diff options
Diffstat (limited to 'libgomp/plugin/plugin-host.c')
-rw-r--r-- | libgomp/plugin/plugin-host.c | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/libgomp/plugin/plugin-host.c b/libgomp/plugin/plugin-host.c index 1faf5bc194e..da3c5f4cdb7 100644 --- a/libgomp/plugin/plugin-host.c +++ b/libgomp/plugin/plugin-host.c @@ -44,6 +44,7 @@ #include <stdlib.h> #include <string.h> #include <stdio.h> +#include <stdbool.h> #ifdef HOST_NONSHM_PLUGIN #define STATIC @@ -55,6 +56,10 @@ #define SELF "host: " #endif +#ifdef HOST_NONSHM_PLUGIN +#include "plugin-host.h" +#endif + STATIC const char * GOMP_OFFLOAD_get_name (void) { @@ -106,7 +111,7 @@ GOMP_OFFLOAD_fini_device (int n __attribute__ ((unused))) STATIC int GOMP_OFFLOAD_load_image (int n __attribute__ ((unused)), - void *i __attribute__ ((unused)), + const void *t __attribute__ ((unused)), struct addr_pair **r __attribute__ ((unused))) { return 0; @@ -114,7 +119,7 @@ GOMP_OFFLOAD_load_image (int n __attribute__ ((unused)), STATIC void GOMP_OFFLOAD_unload_image (int n __attribute__ ((unused)), - void *i __attribute__ ((unused))) + const void *t __attribute__ ((unused))) { } @@ -174,7 +179,10 @@ GOMP_OFFLOAD_openacc_parallel (void (*fn) (void *), void *targ_mem_desc __attribute__ ((unused))) { #ifdef HOST_NONSHM_PLUGIN + struct nonshm_thread *thd = GOMP_PLUGIN_acc_thread (); + thd->nonshm_exec = true; fn (devaddrs); + thd->nonshm_exec = false; #else fn (hostaddrs); #endif @@ -232,11 +240,20 @@ STATIC void * GOMP_OFFLOAD_openacc_create_thread_data (int ord __attribute__ ((unused))) { +#ifdef HOST_NONSHM_PLUGIN + struct nonshm_thread *thd + = GOMP_PLUGIN_malloc (sizeof (struct nonshm_thread)); + thd->nonshm_exec = false; + return thd; +#else return NULL; +#endif } STATIC void -GOMP_OFFLOAD_openacc_destroy_thread_data (void *tls_data - __attribute__ ((unused))) +GOMP_OFFLOAD_openacc_destroy_thread_data (void *tls_data) { +#ifdef HOST_NONSHM_PLUGIN + free (tls_data); +#endif } |