Skip to content

Commit

Permalink
Merging r321964:
Browse files Browse the repository at this point in the history
------------------------------------------------------------------------
r321964 | hahnfeld | 2018-01-07 08:54:36 -0800 (Sun, 07 Jan 2018) | 7 lines

Correct types of pointers to doacross_num_done

This field is defined as kmp_int32, so we should use neither
pointers to kmp_int64 nor 64 bit atomic instructions.
(Found while testing on a Raspberry Pi, 32 bit ARM)

Differential Revision: https://reviews.llvm.org/D41656
------------------------------------------------------------------------

llvm-svn: 322560
  • Loading branch information
zmodem committed Jan 16, 2018
1 parent 756262d commit c94ab43
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions openmp/runtime/src/kmp_csupport.cpp
Expand Up @@ -4032,7 +4032,7 @@ void __kmpc_doacross_post(ident_t *loc, int gtid, long long *vec) {
}

void __kmpc_doacross_fini(ident_t *loc, int gtid) {
kmp_int64 num_done;
kmp_int32 num_done;
kmp_info_t *th = __kmp_threads[gtid];
kmp_team_t *team = th->th.th_team;
kmp_disp_t *pr_buf = th->th.th_dispatch;
Expand All @@ -4042,15 +4042,15 @@ void __kmpc_doacross_fini(ident_t *loc, int gtid) {
KA_TRACE(20, ("__kmpc_doacross_fini() exit: serialized team %p\n", team));
return; // nothing to do
}
num_done = KMP_TEST_THEN_INC64((kmp_int64 *)pr_buf->th_doacross_info[1]) + 1;
num_done = KMP_TEST_THEN_INC32((kmp_int32 *)pr_buf->th_doacross_info[1]) + 1;
if (num_done == th->th.th_team_nproc) {
// we are the last thread, need to free shared resources
int idx = pr_buf->th_doacross_buf_idx - 1;
dispatch_shared_info_t *sh_buf =
&team->t.t_disp_buffer[idx % __kmp_dispatch_num_buffers];
KMP_DEBUG_ASSERT(pr_buf->th_doacross_info[1] ==
(kmp_int64)&sh_buf->doacross_num_done);
KMP_DEBUG_ASSERT(num_done == (kmp_int64)sh_buf->doacross_num_done);
KMP_DEBUG_ASSERT(num_done == sh_buf->doacross_num_done);
KMP_DEBUG_ASSERT(idx == sh_buf->doacross_buf_idx);
__kmp_thread_free(th, CCAST(kmp_uint32 *, sh_buf->doacross_flags));
sh_buf->doacross_flags = NULL;
Expand Down

0 comments on commit c94ab43

Please sign in to comment.