blob: 4713d880feb7ce2973639869cebfb4b7e7ff0bbc [file] [log] [blame]
Jonathan Peyton8fbb49a2015-07-09 18:16:58 +00001#if USE_DEBUGGER
2/*
3 * kmp_debugger.h -- debugger support.
4 */
5
6
7//===----------------------------------------------------------------------===//
8//
9// The LLVM Compiler Infrastructure
10//
11// This file is dual licensed under the MIT and the University of Illinois Open
12// Source Licenses. See LICENSE.txt for details.
13//
14//===----------------------------------------------------------------------===//
15
16
17#ifndef KMP_DEBUGGER_H
18#define KMP_DEBUGGER_H
19
20#ifdef __cplusplus
Jonathan Peyton30419822017-05-12 18:01:32 +000021extern "C" {
Jonathan Peyton8fbb49a2015-07-09 18:16:58 +000022#endif // __cplusplus
23
Jonathan Peyton30419822017-05-12 18:01:32 +000024/* This external variable can be set by any debugger to flag to the runtime
25 that we are currently executing inside a debugger. This will allow the
26 debugger to override the number of threads spawned in a parallel region by
27 using __kmp_omp_num_threads() (below).
28 * When __kmp_debugging is TRUE, each team and each task gets a unique integer
29 identifier that can be used by debugger to conveniently identify teams and
30 tasks.
31 * The debugger has access to __kmp_omp_debug_struct_info which contains
32 information about the OpenMP library's important internal structures. This
33 access will allow the debugger to read detailed information from the typical
34 OpenMP constructs (teams, threads, tasking, etc. ) during a debugging
35 session and offer detailed and useful information which the user can probe
36 about the OpenMP portion of their code. */
37extern int __kmp_debugging; /* Boolean whether currently debugging OpenMP RTL */
Jonathan Peyton8fbb49a2015-07-09 18:16:58 +000038// Return number of threads specified by the debugger for given parallel region.
Jonathan Peyton30419822017-05-12 18:01:32 +000039/* The ident field, which represents a source file location, is used to check if
40 the debugger has changed the number of threads for the parallel region at
41 source file location ident. This way, specific parallel regions' number of
42 threads can be changed at the debugger's request. */
43int __kmp_omp_num_threads(ident_t const *ident);
Jonathan Peyton8fbb49a2015-07-09 18:16:58 +000044
45#ifdef __cplusplus
Jonathan Peyton30419822017-05-12 18:01:32 +000046} // extern "C"
Jonathan Peyton8fbb49a2015-07-09 18:16:58 +000047#endif // __cplusplus
48
Jonathan Peyton8fbb49a2015-07-09 18:16:58 +000049#endif // KMP_DEBUGGER_H
50
51#endif // USE_DEBUGGER