blob: 7512ad940964b99e98fb95ea41253a624c5852a5 [file] [log] [blame]
Andrey Churbanove5f44922015-04-29 16:22:07 +00001#ifndef OMPT_SPECIFIC_H
2#define OMPT_SPECIFIC_H
3
4#include "kmp.h"
5
Jonathan Peyton82a13bf2015-09-21 18:01:02 +00006typedef kmp_info_t ompt_thread_t;
7
Andrey Churbanove5f44922015-04-29 16:22:07 +00008void __ompt_team_assign_id(kmp_team_t *team, ompt_parallel_id_t ompt_pid);
9void __ompt_thread_assign_wait_id(void *variable);
10
Jonathan Peyton82a13bf2015-09-21 18:01:02 +000011void __ompt_lw_taskteam_init(ompt_lw_taskteam_t *lwt, ompt_thread_t *thr,
Andrey Churbanove5f44922015-04-29 16:22:07 +000012 int gtid, void *microtask,
13 ompt_parallel_id_t ompt_pid);
14
Jonathan Peyton82a13bf2015-09-21 18:01:02 +000015void __ompt_lw_taskteam_link(ompt_lw_taskteam_t *lwt, ompt_thread_t *thr);
Andrey Churbanove5f44922015-04-29 16:22:07 +000016
Jonathan Peyton82a13bf2015-09-21 18:01:02 +000017ompt_lw_taskteam_t * __ompt_lw_taskteam_unlink(ompt_thread_t *thr);
Andrey Churbanove5f44922015-04-29 16:22:07 +000018
19ompt_parallel_id_t __ompt_parallel_id_new(int gtid);
20ompt_task_id_t __ompt_task_id_new(int gtid);
21
22ompt_team_info_t *__ompt_get_teaminfo(int depth, int *size);
23
24ompt_task_info_t *__ompt_get_taskinfo(int depth);
25
Jonathan Peyton82a13bf2015-09-21 18:01:02 +000026void __ompt_thread_begin(ompt_thread_type_t thread_type, int gtid);
27
28void __ompt_thread_end(ompt_thread_type_t thread_type, int gtid);
29
30int __ompt_get_parallel_team_size_internal(int ancestor_level);
31
32ompt_task_id_t __ompt_get_task_id_internal(int depth);
33
34ompt_frame_t *__ompt_get_task_frame_internal(int depth);
35
36
37
38//******************************************************************************
39// inline functions
40//******************************************************************************
41
42inline ompt_thread_t *
Andrey Churbanove5f44922015-04-29 16:22:07 +000043ompt_get_thread_gtid(int gtid)
44{
45 return (gtid >= 0) ? __kmp_thread_from_gtid(gtid) : NULL;
46}
47
Jonathan Peyton82a13bf2015-09-21 18:01:02 +000048
49inline ompt_thread_t *
Andrey Churbanove5f44922015-04-29 16:22:07 +000050ompt_get_thread()
51{
52 int gtid = __kmp_gtid_get_specific();
53 return ompt_get_thread_gtid(gtid);
54}
55
56
Jonathan Peyton82a13bf2015-09-21 18:01:02 +000057inline void
58ompt_set_thread_state(ompt_thread_t *thread, ompt_state_t state)
59{
60 thread->th.ompt_thread_info.state = state;
61}
Andrey Churbanove5f44922015-04-29 16:22:07 +000062
63
Jonathan Peyton82a13bf2015-09-21 18:01:02 +000064inline const char *
65ompt_get_runtime_version()
66{
67 return &__kmp_version_lib_ver[KMP_VERSION_MAGIC_LEN];
68}
Andrey Churbanove5f44922015-04-29 16:22:07 +000069
70#endif