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