diff options
author | Anton Samokhvalov <[email protected]> | 2022-02-10 16:45:15 +0300 |
---|---|---|
committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:45:15 +0300 |
commit | 72cb13b4aff9bc9cf22e49251bc8fd143f82538f (patch) | |
tree | da2c34829458c7d4e74bdfbdf85dff449e9e7fb8 /contrib/libs/cxxsupp/openmp/ompt-specific.h | |
parent | 778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (diff) |
Restoring authorship annotation for Anton Samokhvalov <[email protected]>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/cxxsupp/openmp/ompt-specific.h')
-rw-r--r-- | contrib/libs/cxxsupp/openmp/ompt-specific.h | 180 |
1 files changed, 90 insertions, 90 deletions
diff --git a/contrib/libs/cxxsupp/openmp/ompt-specific.h b/contrib/libs/cxxsupp/openmp/ompt-specific.h index e8f84a9a585..2cc213ff140 100644 --- a/contrib/libs/cxxsupp/openmp/ompt-specific.h +++ b/contrib/libs/cxxsupp/openmp/ompt-specific.h @@ -1,90 +1,90 @@ -#ifndef OMPT_SPECIFIC_H -#define OMPT_SPECIFIC_H - -#include "kmp.h" - -/***************************************************************************** - * types - ****************************************************************************/ - -typedef kmp_info_t ompt_thread_t; - - - -/***************************************************************************** - * forward declarations - ****************************************************************************/ - -void __ompt_team_assign_id(kmp_team_t *team, ompt_parallel_id_t ompt_pid); -void __ompt_thread_assign_wait_id(void *variable); - -void __ompt_lw_taskteam_init(ompt_lw_taskteam_t *lwt, ompt_thread_t *thr, - int gtid, void *microtask, - ompt_parallel_id_t ompt_pid); - -void __ompt_lw_taskteam_link(ompt_lw_taskteam_t *lwt, ompt_thread_t *thr); - -ompt_lw_taskteam_t * __ompt_lw_taskteam_unlink(ompt_thread_t *thr); - -ompt_parallel_id_t __ompt_parallel_id_new(int gtid); -ompt_task_id_t __ompt_task_id_new(int gtid); - -ompt_team_info_t *__ompt_get_teaminfo(int depth, int *size); - -ompt_task_info_t *__ompt_get_taskinfo(int depth); - -void __ompt_thread_begin(ompt_thread_type_t thread_type, int gtid); - -void __ompt_thread_end(ompt_thread_type_t thread_type, int gtid); - -int __ompt_get_parallel_team_size_internal(int ancestor_level); - -ompt_task_id_t __ompt_get_task_id_internal(int depth); - -ompt_frame_t *__ompt_get_task_frame_internal(int depth); - - - -/***************************************************************************** - * macros - ****************************************************************************/ - -#define OMPT_HAVE_WEAK_ATTRIBUTE KMP_HAVE_WEAK_ATTRIBUTE -#define OMPT_HAVE_PSAPI KMP_HAVE_PSAPI -#define OMPT_STR_MATCH(haystack, needle) __kmp_str_match(haystack, 0, needle) - - - -//****************************************************************************** -// inline functions -//****************************************************************************** - -inline ompt_thread_t * -ompt_get_thread_gtid(int gtid) -{ - return (gtid >= 0) ? __kmp_thread_from_gtid(gtid) : NULL; -} - - -inline ompt_thread_t * -ompt_get_thread() -{ - int gtid = __kmp_gtid_get_specific(); - return ompt_get_thread_gtid(gtid); -} - - -inline void -ompt_set_thread_state(ompt_thread_t *thread, ompt_state_t state) -{ - thread->th.ompt_thread_info.state = state; -} - - -inline const char * -ompt_get_runtime_version() -{ - return &__kmp_version_lib_ver[KMP_VERSION_MAGIC_LEN]; -} - -#endif +#ifndef OMPT_SPECIFIC_H +#define OMPT_SPECIFIC_H + +#include "kmp.h" + +/***************************************************************************** + * types + ****************************************************************************/ + +typedef kmp_info_t ompt_thread_t; + + + +/***************************************************************************** + * forward declarations + ****************************************************************************/ + +void __ompt_team_assign_id(kmp_team_t *team, ompt_parallel_id_t ompt_pid); +void __ompt_thread_assign_wait_id(void *variable); + +void __ompt_lw_taskteam_init(ompt_lw_taskteam_t *lwt, ompt_thread_t *thr, + int gtid, void *microtask, + ompt_parallel_id_t ompt_pid); + +void __ompt_lw_taskteam_link(ompt_lw_taskteam_t *lwt, ompt_thread_t *thr); + +ompt_lw_taskteam_t * __ompt_lw_taskteam_unlink(ompt_thread_t *thr); + +ompt_parallel_id_t __ompt_parallel_id_new(int gtid); +ompt_task_id_t __ompt_task_id_new(int gtid); + +ompt_team_info_t *__ompt_get_teaminfo(int depth, int *size); + +ompt_task_info_t *__ompt_get_taskinfo(int depth); + +void __ompt_thread_begin(ompt_thread_type_t thread_type, int gtid); + +void __ompt_thread_end(ompt_thread_type_t thread_type, int gtid); + +int __ompt_get_parallel_team_size_internal(int ancestor_level); + +ompt_task_id_t __ompt_get_task_id_internal(int depth); + +ompt_frame_t *__ompt_get_task_frame_internal(int depth); + + + +/***************************************************************************** + * macros + ****************************************************************************/ + +#define OMPT_HAVE_WEAK_ATTRIBUTE KMP_HAVE_WEAK_ATTRIBUTE +#define OMPT_HAVE_PSAPI KMP_HAVE_PSAPI +#define OMPT_STR_MATCH(haystack, needle) __kmp_str_match(haystack, 0, needle) + + + +//****************************************************************************** +// inline functions +//****************************************************************************** + +inline ompt_thread_t * +ompt_get_thread_gtid(int gtid) +{ + return (gtid >= 0) ? __kmp_thread_from_gtid(gtid) : NULL; +} + + +inline ompt_thread_t * +ompt_get_thread() +{ + int gtid = __kmp_gtid_get_specific(); + return ompt_get_thread_gtid(gtid); +} + + +inline void +ompt_set_thread_state(ompt_thread_t *thread, ompt_state_t state) +{ + thread->th.ompt_thread_info.state = state; +} + + +inline const char * +ompt_get_runtime_version() +{ + return &__kmp_version_lib_ver[KMP_VERSION_MAGIC_LEN]; +} + +#endif |