[Openmp-commits] [openmp] r321964 - Correct types of pointers to doacross_num_done
Hans Wennborg via Openmp-commits
openmp-commits at lists.llvm.org
Tue Jan 16 07:19:48 PST 2018
Merged to 6.0 in r322560.
On Sun, Jan 7, 2018 at 5:54 PM, Jonas Hahnfeld via Openmp-commits
<openmp-commits at lists.llvm.org> wrote:
> Author: hahnfeld
> Date: Sun Jan 7 08:54:36 2018
> New Revision: 321964
>
> URL: http://llvm.org/viewvc/llvm-project?rev=321964&view=rev
> Log:
> 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
>
> Modified:
> openmp/trunk/runtime/src/kmp_csupport.cpp
>
> Modified: openmp/trunk/runtime/src/kmp_csupport.cpp
> URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_csupport.cpp?rev=321964&r1=321963&r2=321964&view=diff
> ==============================================================================
> --- openmp/trunk/runtime/src/kmp_csupport.cpp (original)
> +++ openmp/trunk/runtime/src/kmp_csupport.cpp Sun Jan 7 08:54:36 2018
> @@ -4032,7 +4032,7 @@ void __kmpc_doacross_post(ident_t *loc,
> }
>
> 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;
> @@ -4042,7 +4042,7 @@ void __kmpc_doacross_fini(ident_t *loc,
> 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;
> @@ -4050,7 +4050,7 @@ void __kmpc_doacross_fini(ident_t *loc,
> &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;
>
>
> _______________________________________________
> Openmp-commits mailing list
> Openmp-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-commits
More information about the Openmp-commits
mailing list