Skip to content

Commit 0ac992e

Browse files
committed
[openmp] Revert 64874e5 since it was committed by mistake and the PR (#77853) wasn't approved yet.
1 parent 2c9f04c commit 0ac992e

File tree

9 files changed

+15
-84
lines changed

9 files changed

+15
-84
lines changed

openmp/runtime/src/kmp.h

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -502,21 +502,13 @@ static inline kmp_sched_t __kmp_sched_without_mods(kmp_sched_t kind) {
502502
}
503503

504504
/* Type to keep runtime schedule set via OMP_SCHEDULE or omp_set_schedule() */
505-
#if KMP_COMPILER_MSVC
506-
#pragma warning(push)
507-
// warning C4201: nonstandard extension used: nameless struct/union
508-
#pragma warning(disable : 4201)
509-
#endif
510505
typedef union kmp_r_sched {
511506
struct {
512507
enum sched_type r_sched_type;
513508
int chunk;
514509
};
515510
kmp_int64 sched;
516511
} kmp_r_sched_t;
517-
#if KMP_COMPILER_MSVC
518-
#pragma warning(pop)
519-
#endif
520512

521513
extern enum sched_type __kmp_sch_map[]; // map OMP 3.0 schedule types with our
522514
// internal schedule types
@@ -610,8 +602,6 @@ typedef int PACKED_REDUCTION_METHOD_T;
610602
#pragma warning(push)
611603
#pragma warning(disable : 271 310)
612604
#endif
613-
// Don't include everything related to NT status code, we'll do that explicitely
614-
#define WIN32_NO_STATUS
615605
#include <windows.h>
616606
#if KMP_MSVC_COMPAT
617607
#pragma warning(pop)
@@ -1907,20 +1897,12 @@ typedef struct KMP_ALIGN_CACHE dispatch_private_info32 {
19071897
// Because of parm1-4 are used together, performance seems to be better
19081898
// if they are on the same cache line (not measured though).
19091899

1910-
#if KMP_COMPILER_MSVC
1911-
#pragma warning(push)
1912-
// warning C4201: nonstandard extension used: nameless struct/union
1913-
#pragma warning(disable : 4201)
1914-
#endif
19151900
struct KMP_ALIGN(32) {
19161901
kmp_int32 parm1;
19171902
kmp_int32 parm2;
19181903
kmp_int32 parm3;
19191904
kmp_int32 parm4;
19201905
};
1921-
#if KMP_COMPILER_MSVC
1922-
#pragma warning(pop)
1923-
#endif
19241906

19251907
#if KMP_WEIGHTED_ITERATIONS_SUPPORTED
19261908
kmp_uint32 pchunks;
@@ -1954,20 +1936,12 @@ typedef struct KMP_ALIGN_CACHE dispatch_private_info64 {
19541936
// b) all parm1-4 are in the same cache line.
19551937
// Because of parm1-4 are used together, performance seems to be better
19561938
// if they are in the same line (not measured though).
1957-
#if KMP_COMPILER_MSVC
1958-
#pragma warning(push)
1959-
// warning C4201: nonstandard extension used: nameless struct/union
1960-
#pragma warning(disable : 4201)
1961-
#endif
19621939
struct KMP_ALIGN(32) {
19631940
kmp_int64 parm1;
19641941
kmp_int64 parm2;
19651942
kmp_int64 parm3;
19661943
kmp_int64 parm4;
19671944
};
1968-
#if KMP_COMPILER_MSVC
1969-
#pragma warning(pop)
1970-
#endif
19711945

19721946
#if KMP_WEIGHTED_ITERATIONS_SUPPORTED
19731947
kmp_uint64 pchunks;
@@ -2249,11 +2223,6 @@ union KMP_ALIGN_CACHE kmp_barrier_union {
22492223

22502224
typedef union kmp_barrier_union kmp_balign_t;
22512225

2252-
#if KMP_COMPILER_MSVC
2253-
#pragma warning(push)
2254-
// warning C4201: nonstandard extension used: nameless struct/union
2255-
#pragma warning(disable : 4201)
2256-
#endif
22572226
/* Team barrier needs only non-volatile arrived counter */
22582227
union KMP_ALIGN_CACHE kmp_barrier_team_union {
22592228
double b_align; /* use worst case alignment */
@@ -2270,9 +2239,6 @@ union KMP_ALIGN_CACHE kmp_barrier_team_union {
22702239
#endif
22712240
};
22722241
};
2273-
#if KMP_COMPILER_MSVC
2274-
#pragma warning(pop)
2275-
#endif
22762242

22772243
typedef union kmp_barrier_team_union kmp_balign_team_t;
22782244

openmp/runtime/src/kmp_affinity.cpp

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,8 @@ const char *__kmp_hw_get_catalog_string(kmp_hw_t type, bool plural) {
127127
return ((plural) ? KMP_I18N_STR(Threads) : KMP_I18N_STR(Thread));
128128
case KMP_HW_PROC_GROUP:
129129
return ((plural) ? KMP_I18N_STR(ProcGroups) : KMP_I18N_STR(ProcGroup));
130-
default:
131-
return KMP_I18N_STR(Unknown);
132130
}
131+
return KMP_I18N_STR(Unknown);
133132
}
134133

135134
const char *__kmp_hw_get_keyword(kmp_hw_t type, bool plural) {
@@ -158,9 +157,8 @@ const char *__kmp_hw_get_keyword(kmp_hw_t type, bool plural) {
158157
return ((plural) ? "threads" : "thread");
159158
case KMP_HW_PROC_GROUP:
160159
return ((plural) ? "proc_groups" : "proc_group");
161-
default:
162-
return ((plural) ? "unknowns" : "unknown");
163160
}
161+
return ((plural) ? "unknowns" : "unknown");
164162
}
165163

166164
const char *__kmp_hw_get_core_type_string(kmp_hw_core_type_t type) {
@@ -173,9 +171,8 @@ const char *__kmp_hw_get_core_type_string(kmp_hw_core_type_t type) {
173171
case KMP_HW_CORE_TYPE_CORE:
174172
return "Intel(R) Core(TM) processor";
175173
#endif
176-
default:
177-
return "unknown";
178174
}
175+
return "unknown";
179176
}
180177

181178
#if KMP_AFFINITY_SUPPORTED
@@ -1249,10 +1246,9 @@ bool kmp_topology_t::filter_hw_subset() {
12491246
#endif
12501247
case KMP_HW_CORE_TYPE_UNKNOWN:
12511248
return 0;
1252-
default:
1253-
KMP_ASSERT(0);
1254-
return 0;
12551249
}
1250+
KMP_ASSERT(0);
1251+
return 0;
12561252
}
12571253
};
12581254
struct core_eff_indexer {

openmp/runtime/src/kmp_atomic.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,14 +1029,6 @@ void __kmpc_atomic_cmplx4_rd(kmp_cmplx32 *out, ident_t *id_ref, int gtid,
10291029
kmp_cmplx32 __kmpc_atomic_cmplx4_rd(ident_t *id_ref, int gtid,
10301030
kmp_cmplx32 *loc);
10311031
#endif
1032-
1033-
#if KMP_COMPILER_MSVC
1034-
#pragma warning(push)
1035-
// warning C4190: '__kmpc_atomic_cmplx8_rd' has C-linkage specified, but returns
1036-
// UDT '__kmp_cmplx64_t' which is incompatible with C
1037-
#pragma warning(disable : 4190)
1038-
#endif
1039-
10401032
kmp_cmplx64 __kmpc_atomic_cmplx8_rd(ident_t *id_ref, int gtid,
10411033
kmp_cmplx64 *loc);
10421034
kmp_cmplx80 __kmpc_atomic_cmplx10_rd(ident_t *id_ref, int gtid,
@@ -1597,10 +1589,6 @@ kmp_cmplx128_a16_t __kmpc_atomic_cmplx16_a16_swp(ident_t *id_ref, int gtid,
15971589
#endif
15981590
#endif
15991591

1600-
#if KMP_COMPILER_MSVC
1601-
#pragma warning(pop)
1602-
#endif
1603-
16041592
// Capture routines for mixed types (RHS=float16)
16051593
#if KMP_HAVE_QUAD
16061594

openmp/runtime/src/kmp_barrier.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2405,10 +2405,9 @@ void __kmp_fork_barrier(int gtid, int tid) {
24052405
#endif /* USE_ITT_BUILD */
24062406
if (team)
24072407

2408-
#ifdef KMP_DEBUG
2409-
KA_TRACE(10, ("__kmp_fork_barrier: T#%d(%d:%d) has arrived\n", gtid,
2410-
(team != NULL) ? team->t.t_id : -1, tid));
2411-
#endif
2408+
KA_TRACE(10, ("__kmp_fork_barrier: T#%d(%d:%d) has arrived\n", gtid,
2409+
(team != NULL) ? team->t.t_id : -1, tid));
2410+
24122411
// th_team pointer only valid for primary thread here
24132412
if (KMP_MASTER_TID(tid)) {
24142413
#if USE_ITT_BUILD && USE_ITT_NOTIFY

openmp/runtime/src/kmp_dispatch.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,6 @@ template <typename T> struct dispatch_private_infoXX_template {
8181

8282
/* parm[1-4] are used in different ways by different scheduling algorithms */
8383

84-
#if KMP_COMPILER_MSVC
85-
#pragma warning(push)
86-
// warning C4201: nonstandard extension used: nameless struct/union
87-
#pragma warning(disable : 4201)
88-
#endif
8984
// KMP_ALIGN(32) ensures ( if the KMP_ALIGN macro is turned on )
9085
// a) parm3 is properly aligned and
9186
// b) all parm1-4 are in the same cache line.
@@ -97,9 +92,6 @@ template <typename T> struct dispatch_private_infoXX_template {
9792
T parm3;
9893
T parm4;
9994
};
100-
#if KMP_COMPILER_MSVC
101-
#pragma warning(pop)
102-
#endif
10395

10496
#if KMP_WEIGHTED_ITERATIONS_SUPPORTED
10597
UT pchunks; // total number of chunks for processes with p-core

openmp/runtime/src/kmp_io.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ static HANDLE __kmp_stderr = NULL;
5050
static int __kmp_console_exists = FALSE;
5151
static kmp_str_buf_t __kmp_console_buf;
5252

53-
#if 0
5453
static int is_console(void) {
5554
char buffer[128];
5655
DWORD rc = 0;
@@ -68,7 +67,6 @@ static int is_console(void) {
6867
}
6968
return rc > 0 || err == 0;
7069
}
71-
#endif
7270

7371
void __kmp_close_console(void) {
7472
/* wait until user presses return before closing window */
@@ -86,6 +84,7 @@ void __kmp_close_console(void) {
8684
static void __kmp_redirect_output(void) {
8785
__kmp_acquire_bootstrap_lock(&__kmp_console_lock);
8886

87+
(void)is_console;
8988
if (!__kmp_console_exists) {
9089
HANDLE ho;
9190
HANDLE he;

openmp/runtime/src/kmp_settings.cpp

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -873,10 +873,6 @@ static void __kmp_stg_print_wait_policy(kmp_str_buf_t *buffer, char const *name,
873873
case library_throughput: {
874874
value = "PASSIVE";
875875
} break;
876-
case library_none:
877-
case library_serial: {
878-
value = NULL;
879-
} break;
880876
}
881877
} else {
882878
switch (__kmp_library) {
@@ -889,9 +885,6 @@ static void __kmp_stg_print_wait_policy(kmp_str_buf_t *buffer, char const *name,
889885
case library_throughput: {
890886
value = "throughput";
891887
} break;
892-
case library_none: {
893-
value = NULL;
894-
} break;
895888
}
896889
}
897890
if (value != NULL) {
@@ -2010,15 +2003,16 @@ static void __kmp_stg_print_foreign_threads_threadprivate(kmp_str_buf_t *buffer,
20102003
static inline const char *
20112004
__kmp_hw_get_core_type_keyword(kmp_hw_core_type_t type) {
20122005
switch (type) {
2006+
case KMP_HW_CORE_TYPE_UNKNOWN:
2007+
return "unknown";
20132008
#if KMP_ARCH_X86 || KMP_ARCH_X86_64
20142009
case KMP_HW_CORE_TYPE_ATOM:
20152010
return "intel_atom";
20162011
case KMP_HW_CORE_TYPE_CORE:
20172012
return "intel_core";
20182013
#endif
2019-
default:
2020-
return "unknown";
20212014
}
2015+
return "unknown";
20222016
}
20232017

20242018
#if KMP_AFFINITY_SUPPORTED
@@ -4434,8 +4428,6 @@ static void __kmp_stg_print_omp_schedule(kmp_str_buf_t *buffer,
44344428
case kmp_sch_auto:
44354429
__kmp_str_buf_print(buffer, "%s,%d'\n", "auto", __kmp_chunk);
44364430
break;
4437-
default:
4438-
break;
44394431
}
44404432
} else {
44414433
switch (sched) {
@@ -4461,8 +4453,6 @@ static void __kmp_stg_print_omp_schedule(kmp_str_buf_t *buffer,
44614453
case kmp_sch_auto:
44624454
__kmp_str_buf_print(buffer, "%s'\n", "auto");
44634455
break;
4464-
default:
4465-
break;
44664456
}
44674457
}
44684458
} // __kmp_stg_print_omp_schedule

openmp/runtime/src/kmp_wait_release.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,13 +1038,15 @@ static inline void __kmp_null_resume_wrapper(kmp_info_t *thr) {
10381038
case flag_oncore:
10391039
__kmp_resume_oncore(gtid, RCAST(kmp_flag_oncore *, flag));
10401040
break;
1041+
#ifdef KMP_DEBUG
10411042
case flag_unset:
10421043
KF_TRACE(100, ("__kmp_null_resume_wrapper: flag type %d is unset\n", type));
10431044
break;
10441045
default:
10451046
KF_TRACE(100, ("__kmp_null_resume_wrapper: flag type %d does not match any "
10461047
"known flag type\n",
10471048
type));
1049+
#endif
10481050
}
10491051
}
10501052

openmp/runtime/src/z_Windows_NT_util.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
number of running threads in the system. */
2323

2424
#include <ntsecapi.h> // UNICODE_STRING
25-
#undef WIN32_NO_STATUS
2625
#include <ntstatus.h>
2726
#include <psapi.h>
2827
#ifdef _MSC_VER
@@ -1636,7 +1635,7 @@ int __kmp_get_load_balance(int max) {
16361635
// threads on all cores. So, we don't consider the running threads of this
16371636
// process.
16381637
if (pid != 0) {
1639-
for (ULONG i = 0; i < num; ++i) {
1638+
for (int i = 0; i < num; ++i) {
16401639
THREAD_STATE state = spi->Threads[i].State;
16411640
// Count threads that have Ready or Running state.
16421641
// !!! TODO: Why comment does not match the code???

0 commit comments

Comments
 (0)