mirror of
https://github.com/microsoft/mscclpp.git
synced 2026-05-12 01:10:22 +00:00
Fix relaxedWait() (#594)
This commit is contained in:
@@ -77,7 +77,7 @@ struct MemoryDevice2DeviceSemaphoreDeviceHandle {
|
||||
/// Relaxed wait; no memory completion guarantee. Use it only for synchronizing execution, not data.
|
||||
MSCCLPP_DEVICE_INLINE void relaxedWait([[maybe_unused]] int64_t maxSpinCount = 100000000) {
|
||||
auto expected = incExpectedInbound();
|
||||
POLL_MAYBE_JAILBREAK((loadInbound() < expected), maxSpinCount);
|
||||
POLL_MAYBE_JAILBREAK((loadInboundRelaxed() < expected), maxSpinCount);
|
||||
}
|
||||
|
||||
/// Signal remote device, ensures prior memory ops complete.
|
||||
@@ -115,6 +115,12 @@ struct MemoryDevice2DeviceSemaphoreDeviceHandle {
|
||||
return atomicLoad<uint64_t, scopeSystem>(inboundToken, memoryOrderAcquire);
|
||||
}
|
||||
|
||||
/// Thread-safe read of inbound value without memory completion guarantee.
|
||||
/// @return The inbound value.
|
||||
MSCCLPP_DEVICE_INLINE uint64_t loadInboundRelaxed() {
|
||||
return atomicLoad<uint64_t, scopeSystem>(inboundToken, memoryOrderRelaxed);
|
||||
}
|
||||
|
||||
/// Thread-safe read of outbound value.
|
||||
/// @return The outbound value.
|
||||
MSCCLPP_DEVICE_INLINE uint64_t loadOutbound() {
|
||||
|
||||
Reference in New Issue
Block a user