Mercurial > hg > CbC > CbC_gcc
diff libgomp/oacc-int.h @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | 84e7813d76e9 |
children |
line wrap: on
line diff
--- a/libgomp/oacc-int.h Thu Oct 25 07:37:49 2018 +0900 +++ b/libgomp/oacc-int.h Thu Feb 13 11:34:05 2020 +0900 @@ -1,6 +1,6 @@ /* OpenACC Runtime - internal declarations - Copyright (C) 2013-2018 Free Software Foundation, Inc. + Copyright (C) 2013-2020 Free Software Foundation, Inc. Contributed by Mentor Embedded. @@ -40,6 +40,7 @@ #include "openacc.h" #include "config.h" +#include "acc_prof.h" #include <stddef.h> #include <stdbool.h> #include <stdarg.h> @@ -68,6 +69,12 @@ strictly push/pop semantics according to lexical scope. */ struct target_mem_desc *mapped_data; + /* Data of the OpenACC Profiling Interface. */ + acc_prof_info *prof_info; + acc_api_info *api_info; + /* Per-thread toggle of OpenACC Profiling Interface callbacks. */ + bool prof_callbacks_enabled; + /* These structures form a list: this is the next thread in that list. */ struct goacc_thread *next; @@ -75,7 +82,14 @@ void *target_tls; }; -#if defined HAVE_TLS || defined USE_EMUTLS +#ifdef __AMDGCN__ +static inline struct goacc_thread * +goacc_thread (void) +{ + /* Unused in the offload libgomp for OpenACC: return a dummy value. */ + return 0; +} +#elif defined HAVE_TLS || defined USE_EMUTLS extern __thread struct goacc_thread *goacc_tls_data; static inline struct goacc_thread * goacc_thread (void) @@ -99,6 +113,14 @@ void goacc_lazy_initialize (void); void goacc_host_init (void); +void goacc_wait (int, int, va_list *); +void goacc_init_asyncqueues (struct gomp_device_descr *); +bool goacc_fini_asyncqueues (struct gomp_device_descr *); +void goacc_async_free (struct gomp_device_descr *, struct goacc_asyncqueue *, + void *); +struct goacc_asyncqueue *get_goacc_asyncqueue (int); +struct goacc_asyncqueue *lookup_goacc_asyncqueue (struct goacc_thread *, bool, + int); static inline bool async_valid_stream_id_p (int async) { @@ -121,6 +143,28 @@ return async == acc_async_sync; } + +extern bool goacc_prof_enabled; +/* Tune for the (very common) case that profiling is not enabled. */ +#define GOACC_PROF_ENABLED \ + (__builtin_expect (__atomic_load_n (&goacc_prof_enabled, \ + MEMMODEL_ACQUIRE) == true, false)) + +void goacc_profiling_initialize (void); +bool _goacc_profiling_dispatch_p (bool); +/* Tune for the (very common) case that profiling is not enabled. */ +#define GOACC_PROFILING_DISPATCH_P(...) \ + (GOACC_PROF_ENABLED \ + && _goacc_profiling_dispatch_p (__VA_ARGS__)) +bool _goacc_profiling_setup_p (struct goacc_thread *, + acc_prof_info *, acc_api_info *); +/* Tune for the (very common) case that profiling is not enabled. */ +#define GOACC_PROFILING_SETUP_P(...) \ + (GOACC_PROFILING_DISPATCH_P (false) \ + && _goacc_profiling_setup_p (__VA_ARGS__)) +void goacc_profiling_dispatch (acc_prof_info *, acc_event_info *, + acc_api_info *); + #ifdef HAVE_ATTRIBUTE_VISIBILITY # pragma GCC visibility pop #endif