Skip to content

Commit 9ba54ca

Browse files
authored
[OFFLOAD] Interop fixes for Windows (#162652)
On Windows, for a reason I don't fully understand boolean bits get extra padding (even when asking for packed structures) in the structures that messes the offsets between the compiler and the runtime. Also, "weak" works differently on Windows than Linux (i.e., the "local" routine has preference) which causes it to crash as we don't really have an alternate implementation of __kmpc_omp_wait_deps. Given this, it doesn't make sense to mark it as "weak" for Linux either.
1 parent f5885de commit 9ba54ca

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

offload/include/OpenMP/InteropAPI.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ typedef enum kmp_interop_type_t {
2525
} kmp_interop_type_t;
2626

2727
struct interop_attrs_t {
28-
bool inorder : 1;
29-
int reserved : 31;
28+
uint32_t inorder : 1;
29+
uint32_t reserved : 31;
3030

3131
/// Check if the supported attributes are compatible with the current
3232
/// attributes. Only if an attribute is supported can the value be true,
@@ -44,15 +44,15 @@ struct interop_spec_t {
4444
};
4545

4646
struct interop_flags_t {
47-
bool implicit : 1; // dispatch (true) or interop (false)
48-
bool nowait : 1; // has nowait flag
49-
int reserved : 30;
47+
uint32_t implicit : 1; // dispatch (true) or interop (false)
48+
uint32_t nowait : 1; // has nowait flag
49+
uint32_t reserved : 30;
5050
};
5151

5252
struct interop_ctx_t {
5353
uint32_t version; // version of the interface (current is 0)
5454
interop_flags_t flags;
55-
int gtid;
55+
int32_t gtid;
5656
};
5757

5858
struct dep_pack_t {

offload/libomptarget/OpenMP/InteropAPI.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ extern "C" {
2222

2323
void __kmpc_omp_wait_deps(ident_t *loc_ref, int32_t gtid, int32_t ndeps,
2424
kmp_depend_info_t *dep_list, int32_t ndeps_noalias,
25-
kmp_depend_info_t *noalias_dep_list)
26-
__attribute__((weak));
25+
kmp_depend_info_t *noalias_dep_list);
2726

2827
} // extern "C"
2928

0 commit comments

Comments
 (0)