File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
hipamd/include/hip/amd_detail Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -164,6 +164,20 @@ T __hip_readfirstlane(T val) {
164164 } \
165165 } while (0 )
166166
167+ __device__ inline void __syncwarp () {
168+ __builtin_amdgcn_fence (__ATOMIC_RELEASE, " wavefront" );
169+ __builtin_amdgcn_wave_barrier ();
170+ __builtin_amdgcn_fence (__ATOMIC_ACQUIRE, " wavefront" );
171+ }
172+
173+ template <typename MaskT> __device__ inline void __syncwarp (MaskT mask) {
174+ static_assert (__hip_internal::is_integral<MaskT>::value && sizeof (MaskT) == 8 ,
175+ " The mask must be a 64-bit integer. "
176+ " Implicitly promoting a smaller integer is almost always an error." );
177+ __hip_check_mask (mask);
178+ return __syncwarp ();
179+ }
180+
167181// __all_sync, __any_sync, __ballot_sync
168182
169183template <typename MaskT>
You can’t perform that action at this time.
0 commit comments