File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -105,18 +105,27 @@ __ockl_grid_is_valid(void)
105
105
void
106
106
__ockl_grid_sync (void )
107
107
{
108
- __builtin_amdgcn_fence (__ATOMIC_SEQ_CST , "agent " );
108
+ __builtin_amdgcn_fence (__ATOMIC_RELEASE , "workgroup " );
109
109
__builtin_amdgcn_s_barrier ();
110
+
110
111
if (choose_one_workgroup_workitem ()) {
112
+ __builtin_amdgcn_fence (__ATOMIC_ACQUIRE , "workgroup" );
113
+ __builtin_amdgcn_fence (__ATOMIC_RELEASE , "agent" );
114
+
111
115
if (AVOID_GWS ()) {
112
116
__global struct mg_info * mi = (__global struct mg_info * )get_mg_info_arg ();
113
117
single_grid_sync (& mi -> sgs , mi -> num_wg );
114
118
} else {
115
119
uint nwm1 = (uint )__ockl_get_num_groups (0 ) * (uint )__ockl_get_num_groups (1 ) * (uint )__ockl_get_num_groups (2 ) - 1 ;
116
120
__ockl_gws_barrier (nwm1 , 0 );
117
121
}
122
+
123
+ __builtin_amdgcn_fence (__ATOMIC_ACQUIRE , "agent" );
124
+ __builtin_amdgcn_fence (__ATOMIC_RELEASE , "workgroup" );
118
125
}
126
+
119
127
__builtin_amdgcn_s_barrier ();
128
+ __builtin_amdgcn_fence (__ATOMIC_ACQUIRE , "workgroup" );
120
129
}
121
130
122
131
__attribute__((const )) uint
You can’t perform that action at this time.
0 commit comments