LLVM OpenMP 20.0.0git
ompt-internal.h
Go to the documentation of this file.
1/*
2 * ompt-internal.h - header of OMPT internal data structures
3 */
4
5//===----------------------------------------------------------------------===//
6//
7// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
8// See https://llvm.org/LICENSE.txt for license information.
9// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef __OMPT_INTERNAL_H__
14#define __OMPT_INTERNAL_H__
15
16#include "ompt-event-specific.h"
17#include "omp-tools.h"
18
19#define OMPT_VERSION 1
20
21#define _OMP_EXTERN extern "C"
22
23#define OMPT_INVOKER(x) \
24 ((x == fork_context_gnu) ? ompt_parallel_invoker_program \
25 : ompt_parallel_invoker_runtime)
26
27#define ompt_callback(e) e##_callback
28
30#define ompt_event_macro(event, callback, eventid) \
31 callback ompt_callback(event);
32
33 FOREACH_OMPT_EVENT(ompt_event_macro)
34
35#undef ompt_event_macro
37
39 unsigned int enabled : 1;
40#define ompt_event_macro(event, callback, eventid) unsigned int event : 1;
41
42 FOREACH_OMPT_EVENT(ompt_event_macro)
43
44#undef ompt_event_macro
46
47#define TASK_TYPE_DETAILS_FORMAT(info) \
48 ((info->td_flags.task_serial || info->td_flags.tasking_ser) \
49 ? ompt_task_undeferred \
50 : 0x0) | \
51 ((!(info->td_flags.tiedness)) ? ompt_task_untied : 0x0) | \
52 (info->td_flags.final ? ompt_task_final : 0x0) | \
53 (info->td_flags.target \
54 ? ompt_task_target \
55 : (info->td_flags.tasktype ? ompt_task_explicit \
56 : ompt_task_implicit)) | \
57 (info->td_flags.merged_if0 ? ompt_task_mergeable : 0x0)
58
59typedef struct {
60 ompt_frame_t frame;
61 ompt_data_t task_data;
64 ompt_dispatch_chunk_t dispatch_chunk;
66
67typedef struct {
68 ompt_data_t parallel_data;
71
72typedef struct ompt_lw_taskteam_s {
75 int heap;
78
79typedef struct {
80 ompt_data_t thread_data;
81 ompt_data_t task_data; /* stored here from implicit barrier-begin until
82 implicit-task-end */
83 ompt_data_t target_task_data; /* required by target support */
84 void *return_address; /* stored here on entry of runtime */
85 ompt_state_t state;
86 ompt_wait_id_t wait_id;
88 int parallel_flags; // information for the last parallel region invoked
91
93
94#if OMPT_SUPPORT && OMPT_OPTIONAL
95#if USE_FAST_MEMORY
96#define KMP_OMPT_DEPS_ALLOC __kmp_fast_allocate
97#define KMP_OMPT_DEPS_FREE __kmp_fast_free
98#else
99#define KMP_OMPT_DEPS_ALLOC __kmp_thread_malloc
100#define KMP_OMPT_DEPS_FREE __kmp_thread_free
101#endif
102#endif /* OMPT_SUPPORT && OMPT_OPTIONAL */
103
104#ifdef __cplusplus
105extern "C" {
106#endif
107
108void ompt_pre_init(void);
109void ompt_post_init(void);
110void ompt_fini(void);
111
112#define OMPT_GET_RETURN_ADDRESS(level) __builtin_return_address(level)
113#define OMPT_GET_FRAME_ADDRESS(level) __builtin_frame_address(level)
114
115int __kmp_control_tool(uint64_t command, uint64_t modifier, void *arg);
116
118
119#if KMP_OS_WINDOWS
120#define UNLIKELY(x) (x)
121#define OMPT_NOINLINE __declspec(noinline)
122#else
123#define UNLIKELY(x) __builtin_expect(!!(x), 0)
124#define OMPT_NOINLINE __attribute__((noinline))
125#endif
126
127#ifdef __cplusplus
128}
129#endif
130
131#endif
struct ompt_callbacks_internal_s ompt_callbacks_internal_t
struct ompt_callbacks_active_s ompt_callbacks_active_t
struct ompt_lw_taskteam_s ompt_lw_taskteam_t
ompt_callbacks_active_t ompt_enabled
#define ompt_event_macro(event, callback, eventid)
Definition: ompt-internal.h:40
void ompt_post_init(void)
void ompt_pre_init(void)
int __kmp_control_tool(uint64_t command, uint64_t modifier, void *arg)
ompt_callbacks_internal_t ompt_callbacks
void ompt_fini(void)
ompt_team_info_t ompt_team_info
Definition: ompt-internal.h:73
struct ompt_lw_taskteam_s * parent
Definition: ompt-internal.h:76
ompt_task_info_t ompt_task_info
Definition: ompt-internal.h:74
ompt_dispatch_chunk_t dispatch_chunk
Definition: ompt-internal.h:64
struct kmp_taskdata * scheduling_parent
Definition: ompt-internal.h:62
ompt_data_t task_data
Definition: ompt-internal.h:61
ompt_frame_t frame
Definition: ompt-internal.h:60
void * master_return_address
Definition: ompt-internal.h:69
ompt_data_t parallel_data
Definition: ompt-internal.h:68
ompt_data_t thread_data
Definition: ompt-internal.h:80
ompt_data_t task_data
Definition: ompt-internal.h:81
ompt_data_t target_task_data
Definition: ompt-internal.h:83
ompt_wait_id_t wait_id
Definition: ompt-internal.h:86
ompt_state_t state
Definition: ompt-internal.h:85