blob: ff0ad966b72e3ee256424494c24be7931f059ae4 [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
21 extern "C" {
22#endif // __cplusplus
23
24/* * This external variable can be set by any debugger to flag to the runtime that we
25 are currently executing inside a debugger. This will allow the debugger to override
Jonathan Peyton61118492016-05-20 19:03:38 +000026 the number of threads spawned in a parallel region by using __kmp_omp_num_threads() (below).
27 * When __kmp_debugging is TRUE, each team and each task gets a unique integer identifier
Jonathan Peyton8fbb49a2015-07-09 18:16:58 +000028 that can be used by debugger to conveniently identify teams and tasks.
29 * The debugger has access to __kmp_omp_debug_struct_info which contains information
Jonathan Peyton61118492016-05-20 19:03:38 +000030 about the OpenMP library's important internal structures. This access will allow the debugger
Jonathan Peyton8fbb49a2015-07-09 18:16:58 +000031 to read detailed information from the typical OpenMP constructs (teams, threads, tasking, etc. )
32 during a debugging session and offer detailed and useful information which the user can probe
33 about the OpenMP portion of their code.
34 */
35extern int __kmp_debugging; /* Boolean whether currently debugging OpenMP RTL */
36// Return number of threads specified by the debugger for given parallel region.
Jonathan Peyton61118492016-05-20 19:03:38 +000037/* The ident field, which represents a source file location, is used to check if the
38 debugger has changed the number of threads for the parallel region at source file
Jonathan Peyton8fbb49a2015-07-09 18:16:58 +000039 location ident. This way, specific parallel regions' number of threads can be changed
40 at the debugger's request.
41 */
42int __kmp_omp_num_threads( ident_t const * ident );
43
44#ifdef __cplusplus
45 } // extern "C"
46#endif // __cplusplus
47
48
49#endif // KMP_DEBUGGER_H
50
51#endif // USE_DEBUGGER