Changeset View
Changeset View
Standalone View
Standalone View
openmp/runtime/src/kmp_runtime.cpp
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
/* | /* | ||||
Lint: Lint: clang-format-diff not found in user's PATH; not linting file. | |||||
* kmp_runtime.cpp -- KPTS runtime support library | * kmp_runtime.cpp -- KPTS runtime support library | ||||
*/ | */ | ||||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||||
// | // | ||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||||
// See https://llvm.org/LICENSE.txt for license information. | // See https://llvm.org/LICENSE.txt for license information. | ||||
▲ Show 20 Lines • Show All 1,376 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
/* most of the work for a fork */ | /* most of the work for a fork */ | ||||
/* return true if we really went parallel, false if serialized */ | /* return true if we really went parallel, false if serialized */ | ||||
int __kmp_fork_call(ident_t *loc, int gtid, | int __kmp_fork_call(ident_t *loc, int gtid, | ||||
enum fork_context_e call_context, // Intel, GNU, ... | enum fork_context_e call_context, // Intel, GNU, ... | ||||
kmp_int32 argc, microtask_t microtask, launch_t invoker, | kmp_int32 argc, microtask_t microtask, launch_t invoker, | ||||
/* TODO: revert workaround for Intel(R) 64 tracker #96 */ | /* TODO: revert workaround for Intel(R) 64 tracker #96 */ | ||||
#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && KMP_OS_LINUX | #if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && (KMP_OS_FREEBSD || KMP_OS_LINUX) | ||||
Lint: Pre-merge checks clang-format: please reformat the code -#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && (KMP_OS_FREEBSD || KMP_OS_LINUX) +#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && \ + (KMP_OS_FREEBSD || KMP_OS_LINUX) Lint: Pre-merge checks: clang-format: please reformat the code
```
-#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM ||… | |||||
va_list *ap | va_list *ap | ||||
#else | #else | ||||
va_list ap | va_list ap | ||||
#endif | #endif | ||||
) { | ) { | ||||
Lint: Pre-merge checks clang-format: please reformat the code - ) { +) { Lint: Pre-merge checks: clang-format: please reformat the code
```
- ) {
+) {
``` | |||||
void **argv; | void **argv; | ||||
int i; | int i; | ||||
int master_tid; | int master_tid; | ||||
int master_this_cons; | int master_this_cons; | ||||
kmp_team_t *team; | kmp_team_t *team; | ||||
kmp_team_t *parent_team; | kmp_team_t *parent_team; | ||||
kmp_info_t *master_th; | kmp_info_t *master_th; | ||||
kmp_root_t *root; | kmp_root_t *root; | ||||
▲ Show 20 Lines • Show All 94 Lines • ▼ Show 20 Lines | if (master_th->th.th_teams_microtask && ap && | ||||
// The team is actual (hot), all workers are ready at the fork barrier. | // The team is actual (hot), all workers are ready at the fork barrier. | ||||
// No lock needed to initialize the team a bit, then free workers. | // No lock needed to initialize the team a bit, then free workers. | ||||
parent_team->t.t_ident = loc; | parent_team->t.t_ident = loc; | ||||
__kmp_alloc_argv_entries(argc, parent_team, TRUE); | __kmp_alloc_argv_entries(argc, parent_team, TRUE); | ||||
parent_team->t.t_argc = argc; | parent_team->t.t_argc = argc; | ||||
argv = (void **)parent_team->t.t_argv; | argv = (void **)parent_team->t.t_argv; | ||||
for (i = argc - 1; i >= 0; --i) | for (i = argc - 1; i >= 0; --i) | ||||
/* TODO: revert workaround for Intel(R) 64 tracker #96 */ | /* TODO: revert workaround for Intel(R) 64 tracker #96 */ | ||||
#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && KMP_OS_LINUX | #if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && (KMP_OS_FREEBSD || KMP_OS_LINUX) | ||||
Lint: Pre-merge checks clang-format: please reformat the code -#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && (KMP_OS_FREEBSD || KMP_OS_LINUX) +#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && \ + (KMP_OS_FREEBSD || KMP_OS_LINUX) Lint: Pre-merge checks: clang-format: please reformat the code
```
-#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM ||… | |||||
*argv++ = va_arg(*ap, void *); | *argv++ = va_arg(*ap, void *); | ||||
#else | #else | ||||
*argv++ = va_arg(ap, void *); | *argv++ = va_arg(ap, void *); | ||||
#endif | #endif | ||||
// Increment our nested depth levels, but not increase the serialization | // Increment our nested depth levels, but not increase the serialization | ||||
if (parent_team == master_th->th.th_serial_team) { | if (parent_team == master_th->th.th_serial_team) { | ||||
// AC: we are in serialized parallel | // AC: we are in serialized parallel | ||||
__kmpc_serialized_parallel(loc, gtid); | __kmpc_serialized_parallel(loc, gtid); | ||||
▲ Show 20 Lines • Show All 282 Lines • ▼ Show 20 Lines | #endif | ||||
// team->t.t_pkfn = microtask; | // team->t.t_pkfn = microtask; | ||||
team->t.t_invoke = invoker; | team->t.t_invoke = invoker; | ||||
__kmp_alloc_argv_entries(argc, team, TRUE); | __kmp_alloc_argv_entries(argc, team, TRUE); | ||||
team->t.t_argc = argc; | team->t.t_argc = argc; | ||||
argv = (void **)team->t.t_argv; | argv = (void **)team->t.t_argv; | ||||
if (ap) { | if (ap) { | ||||
for (i = argc - 1; i >= 0; --i) | for (i = argc - 1; i >= 0; --i) | ||||
// TODO: revert workaround for Intel(R) 64 tracker #96 | // TODO: revert workaround for Intel(R) 64 tracker #96 | ||||
#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && KMP_OS_LINUX | #if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && (KMP_OS_FREEBSD || KMP_OS_LINUX) | ||||
Lint: Pre-merge checks clang-format: please reformat the code -#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && (KMP_OS_FREEBSD || KMP_OS_LINUX) +#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && \ + (KMP_OS_FREEBSD || KMP_OS_LINUX) Lint: Pre-merge checks: clang-format: please reformat the code
```
-#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM ||… | |||||
*argv++ = va_arg(*ap, void *); | *argv++ = va_arg(*ap, void *); | ||||
#else | #else | ||||
*argv++ = va_arg(ap, void *); | *argv++ = va_arg(ap, void *); | ||||
#endif | #endif | ||||
} else { | } else { | ||||
for (i = 0; i < argc; ++i) | for (i = 0; i < argc; ++i) | ||||
// Get args from parent team for teams construct | // Get args from parent team for teams construct | ||||
argv[i] = parent_team->t.t_argv[i]; | argv[i] = parent_team->t.t_argv[i]; | ||||
Show All 19 Lines | #if OMPT_SUPPORT | ||||
} | } | ||||
master_th->th.ompt_thread_info.state = ompt_state_overhead; | master_th->th.ompt_thread_info.state = ompt_state_overhead; | ||||
} | } | ||||
#endif | #endif | ||||
} else { | } else { | ||||
argv = args; | argv = args; | ||||
for (i = argc - 1; i >= 0; --i) | for (i = argc - 1; i >= 0; --i) | ||||
// TODO: revert workaround for Intel(R) 64 tracker #96 | // TODO: revert workaround for Intel(R) 64 tracker #96 | ||||
#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && KMP_OS_LINUX | #if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && (KMP_OS_FREEBSD || KMP_OS_LINUX) | ||||
Lint: Pre-merge checks clang-format: please reformat the code -#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && (KMP_OS_FREEBSD || KMP_OS_LINUX) +#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && \ + (KMP_OS_FREEBSD || KMP_OS_LINUX) Lint: Pre-merge checks: clang-format: please reformat the code
```
-#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM ||… | |||||
*argv++ = va_arg(*ap, void *); | *argv++ = va_arg(*ap, void *); | ||||
#else | #else | ||||
*argv++ = va_arg(ap, void *); | *argv++ = va_arg(ap, void *); | ||||
#endif | #endif | ||||
KMP_MB(); | KMP_MB(); | ||||
#if OMPT_SUPPORT | #if OMPT_SUPPORT | ||||
void *dummy; | void *dummy; | ||||
▲ Show 20 Lines • Show All 273 Lines • ▼ Show 20 Lines | KMP_DEBUG_ASSERT(team != root->r.r_hot_team || | ||||
team->t.t_parent->t.t_serialized))); | team->t.t_parent->t.t_serialized))); | ||||
KMP_MB(); | KMP_MB(); | ||||
/* now, setup the arguments */ | /* now, setup the arguments */ | ||||
argv = (void **)team->t.t_argv; | argv = (void **)team->t.t_argv; | ||||
if (ap) { | if (ap) { | ||||
for (i = argc - 1; i >= 0; --i) { | for (i = argc - 1; i >= 0; --i) { | ||||
// TODO: revert workaround for Intel(R) 64 tracker #96 | // TODO: revert workaround for Intel(R) 64 tracker #96 | ||||
#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && KMP_OS_LINUX | #if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && (KMP_OS_FREEBSD || KMP_OS_LINUX) | ||||
Lint: Pre-merge checks clang-format: please reformat the code -#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && (KMP_OS_FREEBSD || KMP_OS_LINUX) +#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && \ + (KMP_OS_FREEBSD || KMP_OS_LINUX) Lint: Pre-merge checks: clang-format: please reformat the code
```
-#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM ||… | |||||
void *new_argv = va_arg(*ap, void *); | void *new_argv = va_arg(*ap, void *); | ||||
#else | #else | ||||
void *new_argv = va_arg(ap, void *); | void *new_argv = va_arg(ap, void *); | ||||
#endif | #endif | ||||
KMP_CHECK_UPDATE(*argv, new_argv); | KMP_CHECK_UPDATE(*argv, new_argv); | ||||
argv++; | argv++; | ||||
} | } | ||||
} else { | } else { | ||||
▲ Show 20 Lines • Show All 6,165 Lines • Show Last 20 Lines |
clang-format-diff not found in user's PATH; not linting file.