Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

[ESIMD] Fix potential infinite loop in dword_atomic_cmpxchg.cpp. #1304

Merged
merged 1 commit into from
Oct 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion SYCL/ESIMD/lsc/atomic_smoke.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,12 @@ constexpr char MODE[] = "LSC";
#endif // USE_DWORD_ATOMICS

#ifndef USE_DWORD_ATOMICS
#if USE_FULL_BARRIER
uint32_t atomic_load(uint32_t *addr) {
auto v = atomic_update<LSCAtomicOp::load, uint32_t, 1>(addr, 0, 1);
return v[0];
}
#endif // USE_FULL_BARRIER
#endif // USE_DWORD_ATOMICS

template <class, int, template <class, int> class> class TestID;
Expand Down Expand Up @@ -240,7 +242,7 @@ bool test(queue q, const Config &cfg) {
// is not endless:
for (auto old_val =
atomic_update<op>(arr, offsets, new_val, exp_val, m);
any(old_val != exp_val, !m);
any(old_val < exp_val, !m);
old_val =
atomic_update<op>(arr, offsets, new_val, exp_val, m))
;
Expand Down