Andrey Churbanov | e5f4492 | 2015-04-29 16:22:07 +0000 | [diff] [blame] | 1 | #ifndef OMPT_SPECIFIC_H |
| 2 | #define OMPT_SPECIFIC_H |
| 3 | |
| 4 | #include "kmp.h" |
| 5 | |
Jonathan Peyton | 82a13bf | 2015-09-21 18:01:02 +0000 | [diff] [blame^] | 6 | typedef kmp_info_t ompt_thread_t; |
| 7 | |
Andrey Churbanov | e5f4492 | 2015-04-29 16:22:07 +0000 | [diff] [blame] | 8 | void __ompt_team_assign_id(kmp_team_t *team, ompt_parallel_id_t ompt_pid); |
| 9 | void __ompt_thread_assign_wait_id(void *variable); |
| 10 | |
Jonathan Peyton | 82a13bf | 2015-09-21 18:01:02 +0000 | [diff] [blame^] | 11 | void __ompt_lw_taskteam_init(ompt_lw_taskteam_t *lwt, ompt_thread_t *thr, |
Andrey Churbanov | e5f4492 | 2015-04-29 16:22:07 +0000 | [diff] [blame] | 12 | int gtid, void *microtask, |
| 13 | ompt_parallel_id_t ompt_pid); |
| 14 | |
Jonathan Peyton | 82a13bf | 2015-09-21 18:01:02 +0000 | [diff] [blame^] | 15 | void __ompt_lw_taskteam_link(ompt_lw_taskteam_t *lwt, ompt_thread_t *thr); |
Andrey Churbanov | e5f4492 | 2015-04-29 16:22:07 +0000 | [diff] [blame] | 16 | |
Jonathan Peyton | 82a13bf | 2015-09-21 18:01:02 +0000 | [diff] [blame^] | 17 | ompt_lw_taskteam_t * __ompt_lw_taskteam_unlink(ompt_thread_t *thr); |
Andrey Churbanov | e5f4492 | 2015-04-29 16:22:07 +0000 | [diff] [blame] | 18 | |
| 19 | ompt_parallel_id_t __ompt_parallel_id_new(int gtid); |
| 20 | ompt_task_id_t __ompt_task_id_new(int gtid); |
| 21 | |
| 22 | ompt_team_info_t *__ompt_get_teaminfo(int depth, int *size); |
| 23 | |
| 24 | ompt_task_info_t *__ompt_get_taskinfo(int depth); |
| 25 | |
Jonathan Peyton | 82a13bf | 2015-09-21 18:01:02 +0000 | [diff] [blame^] | 26 | void __ompt_thread_begin(ompt_thread_type_t thread_type, int gtid); |
| 27 | |
| 28 | void __ompt_thread_end(ompt_thread_type_t thread_type, int gtid); |
| 29 | |
| 30 | int __ompt_get_parallel_team_size_internal(int ancestor_level); |
| 31 | |
| 32 | ompt_task_id_t __ompt_get_task_id_internal(int depth); |
| 33 | |
| 34 | ompt_frame_t *__ompt_get_task_frame_internal(int depth); |
| 35 | |
| 36 | |
| 37 | |
| 38 | //****************************************************************************** |
| 39 | // inline functions |
| 40 | //****************************************************************************** |
| 41 | |
| 42 | inline ompt_thread_t * |
Andrey Churbanov | e5f4492 | 2015-04-29 16:22:07 +0000 | [diff] [blame] | 43 | ompt_get_thread_gtid(int gtid) |
| 44 | { |
| 45 | return (gtid >= 0) ? __kmp_thread_from_gtid(gtid) : NULL; |
| 46 | } |
| 47 | |
Jonathan Peyton | 82a13bf | 2015-09-21 18:01:02 +0000 | [diff] [blame^] | 48 | |
| 49 | inline ompt_thread_t * |
Andrey Churbanov | e5f4492 | 2015-04-29 16:22:07 +0000 | [diff] [blame] | 50 | ompt_get_thread() |
| 51 | { |
| 52 | int gtid = __kmp_gtid_get_specific(); |
| 53 | return ompt_get_thread_gtid(gtid); |
| 54 | } |
| 55 | |
| 56 | |
Jonathan Peyton | 82a13bf | 2015-09-21 18:01:02 +0000 | [diff] [blame^] | 57 | inline void |
| 58 | ompt_set_thread_state(ompt_thread_t *thread, ompt_state_t state) |
| 59 | { |
| 60 | thread->th.ompt_thread_info.state = state; |
| 61 | } |
Andrey Churbanov | e5f4492 | 2015-04-29 16:22:07 +0000 | [diff] [blame] | 62 | |
| 63 | |
Jonathan Peyton | 82a13bf | 2015-09-21 18:01:02 +0000 | [diff] [blame^] | 64 | inline const char * |
| 65 | ompt_get_runtime_version() |
| 66 | { |
| 67 | return &__kmp_version_lib_ver[KMP_VERSION_MAGIC_LEN]; |
| 68 | } |
Andrey Churbanov | e5f4492 | 2015-04-29 16:22:07 +0000 | [diff] [blame] | 69 | |
| 70 | #endif |