Script.atomic.shared_exch¶
- Script.atomic.shared_exch(dst, values, *, sem='relaxed', scope='cta', output=None)[source]¶
Element-wise
old = dst[i]; dst[i] = values[i]atomically (exchange).Unlike the arithmetic ops,
exchhas nored.*counterpart in PTX, sooutputis effectively always bound. Callers that don’t need the old value should prefer a plain store.See
shared_add()for the full parameter description.Notes
Thread group: Can be executed by any sized thread group.
Hardware: Requires compute capability 7.0+ (sm_70).
PTX:
atom.{sem}.{scope}.shared.exch.s32.
- Parameters:
dst (SharedTensor)
values (RegisterTensor)
sem (str)
scope (str)
output (RegisterTensor | None)
- Return type:
RegisterTensor | None