Re: [PATCH] libgomp: Fix default value of GOMP_SPINCOUNT [PR 109062]

2023-03-08 Thread Jakub Jelinek via Gcc-patches
On Wed, Mar 08, 2023 at 04:54:20PM +0800, Hongyu Wang wrote: > > Seems for many ICVs the default values are done through > > gomp_default_icv_values, but that doesn't cover wait_policy. > > For other vars, the defaults are provided through just initializers of > > those vars on the var definitions,

Re: [PATCH] libgomp: Fix default value of GOMP_SPINCOUNT [PR 109062]

2023-03-08 Thread Hongyu Wang via Gcc-patches
> Seems for many ICVs the default values are done through > gomp_default_icv_values, but that doesn't cover wait_policy. > For other vars, the defaults are provided through just initializers of > those vars on the var definitions, e.g.: > char *gomp_affinity_format_var = "level %L thread %i affinit

Re: [PATCH] libgomp: Fix default value of GOMP_SPINCOUNT [PR 109062]

2023-03-08 Thread Jakub Jelinek via Gcc-patches
On Wed, Mar 08, 2023 at 04:21:46PM +0800, Hongyu Wang wrote: > Hongyu Wang 于2023年3月8日周三 16:07写道: > > > > > I think the right spot to fix this would be instead in initialize_icvs, > > > change the > > > icvs->wait_policy = 0; > > > in there to > > > icvs->wait_policy = -1; > > > That way it wil

Re: [PATCH] libgomp: Fix default value of GOMP_SPINCOUNT [PR 109062]

2023-03-08 Thread Hongyu Wang via Gcc-patches
Hongyu Wang 于2023年3月8日周三 16:07写道: > > > I think the right spot to fix this would be instead in initialize_icvs, > > change the > > icvs->wait_policy = 0; > > in there to > > icvs->wait_policy = -1; > > That way it will be the default for all the devices, not just the > > initial one. > > It do

Re: [PATCH] libgomp: Fix default value of GOMP_SPINCOUNT [PR 109062]

2023-03-08 Thread Hongyu Wang via Gcc-patches
> I think the right spot to fix this would be instead in initialize_icvs, > change the > icvs->wait_policy = 0; > in there to > icvs->wait_policy = -1; > That way it will be the default for all the devices, not just the > initial one. It doesn't work, for the code that determines value of wait

Re: [PATCH] libgomp: Fix default value of GOMP_SPINCOUNT [PR 109062]

2023-03-07 Thread Jakub Jelinek via Gcc-patches
On Wed, Mar 08, 2023 at 02:31:38PM +0800, Hongyu Wang wrote: > Hi, > > When OMP_WAIT_POLICY is not specified, current implementation will cause > icv flag GOMP_ICV_WAIT_POLICY unset, so global variable wait_policy > will remain its uninitialized value. Set it to -1 when the flag is not > specified

[PATCH] libgomp: Fix default value of GOMP_SPINCOUNT [PR 109062]

2023-03-07 Thread Hongyu Wang via Gcc-patches
Hi, When OMP_WAIT_POLICY is not specified, current implementation will cause icv flag GOMP_ICV_WAIT_POLICY unset, so global variable wait_policy will remain its uninitialized value. Set it to -1 when the flag is not specified to keep GOMP_SPINCOUNT behavior consistent with its description. Bootst