Path: blob/main/contrib/llvm-project/openmp/runtime/src/kmp_omp.h
35258 views
#if USE_DEBUGGER1/*2* kmp_omp.h -- OpenMP definition for kmp_omp_struct_info_t.3* This is for information about runtime library structures.4*/56//===----------------------------------------------------------------------===//7//8// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.9// See https://llvm.org/LICENSE.txt for license information.10// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception11//12//===----------------------------------------------------------------------===//1314/* THIS FILE SHOULD NOT BE MODIFIED IN IDB INTERFACE LIBRARY CODE15It should instead be modified in the OpenMP runtime and copied to the16interface library code. This way we can minimize the problems that this is17sure to cause having two copies of the same file.1819Files live in libomp and libomp_db/src/include */2021/* CHANGE THIS WHEN STRUCTURES BELOW CHANGE22Before we release this to a customer, please don't change this value. After23it is released and stable, then any new updates to the structures or data24structure traversal algorithms need to change this value. */25#define KMP_OMP_VERSION 92627typedef struct {28kmp_int32 offset;29kmp_int32 size;30} offset_and_size_t;3132typedef struct {33kmp_uint64 addr;34kmp_int32 size;35kmp_int32 padding;36} addr_and_size_t;3738typedef struct {39kmp_uint64 flags; // Flags for future extensions.40kmp_uint6441file; // Pointer to name of source file where the parallel region is.42kmp_uint64 func; // Pointer to name of routine where the parallel region is.43kmp_int32 begin; // Beginning of source line range.44kmp_int32 end; // End of source line range.45kmp_int32 num_threads; // Specified number of threads.46} kmp_omp_nthr_item_t;4748typedef struct {49kmp_int32 num; // Number of items in the array.50kmp_uint64 array; // Address of array of kmp_omp_num_threads_item_t.51} kmp_omp_nthr_info_t;5253/* This structure is known to the idb interface library */54typedef struct {5556/* Change this only if you make a fundamental data structure change here */57kmp_int32 lib_version;5859/* sanity check. Only should be checked if versions are identical60* This is also used for backward compatibility to get the runtime61* structure size if it the runtime is older than the interface */62kmp_int32 sizeof_this_structure;6364/* OpenMP RTL version info. */65addr_and_size_t major;66addr_and_size_t minor;67addr_and_size_t build;68addr_and_size_t openmp_version;69addr_and_size_t banner;7071/* Various globals. */72addr_and_size_t threads; // Pointer to __kmp_threads.73addr_and_size_t roots; // Pointer to __kmp_root.74addr_and_size_t capacity; // Pointer to __kmp_threads_capacity.75#if KMP_USE_MONITOR76addr_and_size_t monitor; // Pointer to __kmp_monitor.77#endif78#if !KMP_USE_DYNAMIC_LOCK79addr_and_size_t lock_table; // Pointer to __kmp_lock_table.80#endif81addr_and_size_t func_microtask;82addr_and_size_t func_fork;83addr_and_size_t func_fork_teams;84addr_and_size_t team_counter;85addr_and_size_t task_counter;86addr_and_size_t nthr_info;87kmp_int32 address_width;88kmp_int32 indexed_locks;89kmp_int32 last_barrier; // The end in enum barrier_type90kmp_int32 deque_size; // TASK_DEQUE_SIZE9192/* thread structure information. */93kmp_int32 th_sizeof_struct;94offset_and_size_t th_info; // descriptor for thread95offset_and_size_t th_team; // team for this thread96offset_and_size_t th_root; // root for this thread97offset_and_size_t th_serial_team; // serial team under this thread98offset_and_size_t th_ident; // location for this thread (if available)99offset_and_size_t th_spin_here; // is thread waiting for lock (if available)100offset_and_size_t101th_next_waiting; // next thread waiting for lock (if available)102offset_and_size_t th_task_team; // task team struct103offset_and_size_t th_current_task; // innermost task being executed104offset_and_size_t105th_task_state; // alternating 0/1 for task team identification106offset_and_size_t th_bar;107offset_and_size_t th_b_worker_arrived; // the worker increases it by 1 when it108// arrives to the barrier109110/* teams information */111offset_and_size_t th_teams_microtask; // entry address for teams construct112offset_and_size_t th_teams_level; // initial level of teams construct113offset_and_size_t th_teams_nteams; // number of teams in a league114offset_and_size_t115th_teams_nth; // number of threads in each team of the league116117/* kmp_desc structure (for info field above) */118kmp_int32 ds_sizeof_struct;119offset_and_size_t ds_tid; // team thread id120offset_and_size_t ds_gtid; // global thread id121offset_and_size_t ds_thread; // native thread id122123/* team structure information */124kmp_int32 t_sizeof_struct;125offset_and_size_t t_master_tid; // tid of primary thread in parent team126offset_and_size_t t_ident; // location of parallel region127offset_and_size_t t_parent; // parent team128offset_and_size_t t_nproc; // # team threads129offset_and_size_t t_threads; // array of threads130offset_and_size_t t_serialized; // # levels of serialized teams131offset_and_size_t t_id; // unique team id132offset_and_size_t t_pkfn;133offset_and_size_t t_task_team; // task team structure134offset_and_size_t t_implicit_task; // taskdata for the thread's implicit task135offset_and_size_t t_cancel_request;136offset_and_size_t t_bar;137offset_and_size_t138t_b_master_arrived; // incremented when primary thread reaches barrier139offset_and_size_t140t_b_team_arrived; // increased by one when all the threads arrived141142/* root structure information */143kmp_int32 r_sizeof_struct;144offset_and_size_t r_root_team; // team at root145offset_and_size_t r_hot_team; // hot team for this root146offset_and_size_t r_uber_thread; // root thread147offset_and_size_t r_root_id; // unique root id (if available)148149/* ident structure information */150kmp_int32 id_sizeof_struct;151offset_and_size_t152id_psource; /* address of string ";file;func;line1;line2;;". */153offset_and_size_t id_flags;154155/* lock structure information */156kmp_int32 lk_sizeof_struct;157offset_and_size_t lk_initialized;158offset_and_size_t lk_location;159offset_and_size_t lk_tail_id;160offset_and_size_t lk_head_id;161offset_and_size_t lk_next_ticket;162offset_and_size_t lk_now_serving;163offset_and_size_t lk_owner_id;164offset_and_size_t lk_depth_locked;165offset_and_size_t lk_lock_flags;166167#if !KMP_USE_DYNAMIC_LOCK168/* lock_table_t */169kmp_int32 lt_size_of_struct; /* Size and layout of kmp_lock_table_t. */170offset_and_size_t lt_used;171offset_and_size_t lt_allocated;172offset_and_size_t lt_table;173#endif174175/* task_team_t */176kmp_int32 tt_sizeof_struct;177offset_and_size_t tt_threads_data;178offset_and_size_t tt_found_tasks;179offset_and_size_t tt_nproc;180offset_and_size_t tt_unfinished_threads;181offset_and_size_t tt_active;182183/* kmp_taskdata_t */184kmp_int32 td_sizeof_struct;185offset_and_size_t td_task_id; // task id186offset_and_size_t td_flags; // task flags187offset_and_size_t td_team; // team for this task188offset_and_size_t td_parent; // parent task189offset_and_size_t td_level; // task testing level190offset_and_size_t td_ident; // task identifier191offset_and_size_t td_allocated_child_tasks; // child tasks (+ current task)192// not yet deallocated193offset_and_size_t td_incomplete_child_tasks; // child tasks not yet complete194195/* Taskwait */196offset_and_size_t td_taskwait_ident;197offset_and_size_t td_taskwait_counter;198offset_and_size_t199td_taskwait_thread; // gtid + 1 of thread encountered taskwait200201/* Taskgroup */202offset_and_size_t td_taskgroup; // pointer to the current taskgroup203offset_and_size_t204td_task_count; // number of allocated and not yet complete tasks205offset_and_size_t td_cancel; // request for cancellation of this taskgroup206207/* Task dependency */208offset_and_size_t209td_depnode; // pointer to graph node if the task has dependencies210offset_and_size_t dn_node;211offset_and_size_t dn_next;212offset_and_size_t dn_successors;213offset_and_size_t dn_task;214offset_and_size_t dn_npredecessors;215offset_and_size_t dn_nrefs;216offset_and_size_t dn_routine;217218/* kmp_thread_data_t */219kmp_int32 hd_sizeof_struct;220offset_and_size_t hd_deque;221offset_and_size_t hd_deque_size;222offset_and_size_t hd_deque_head;223offset_and_size_t hd_deque_tail;224offset_and_size_t hd_deque_ntasks;225offset_and_size_t hd_deque_last_stolen;226227// The last field of stable version.228kmp_uint64 last_field;229230} kmp_omp_struct_info_t;231232#endif /* USE_DEBUGGER */233234/* end of file */235236237