• Slang Standard Library Reference
    • Interfaces
    • Types
    • Attributes
    • Global Declarations
      • Atomic functions
        • InterlockedAdd
        • InterlockedAnd
        • InterlockedCompareExchange
        • InterlockedCompareExchangeFloatBitwise
        • InterlockedCompareStore
        • InterlockedCompareStoreFloatBitwise
        • InterlockedExchange
        • InterlockedMax
        • InterlockedMin
        • InterlockedOr
        • InterlockedXor
      • Memory and control barriers
      • Bit operation functions
      • Conversion functions
      • Derivative functions
      • Vertex Interpolation Functions
      • Math functions
      • Mesh shading
      • Ray-tracing
      • Tessellation functions
      • Wave and quad functions
      • CheckAccessFullyMapped
      • D3DCOLORtoUBYTE4
      • GetAttributeAtVertex
      • GetRenderTargetSampleCount
      • GetRenderTargetSamplePosition
      • IsHelperLane
      • NonUniformResourceIndex
      • QuadAll
      • QuadAny
      • ReorderThread
      • WaveClusteredRotate
      • WaveMultiBitAnd
      • WaveMultiBitOr
      • WaveMultiBitXor
      • WaveMultiMax
      • WaveMultiMin
      • WaveMultiPrefixBitAnd
      • WaveMultiPrefixBitOr
      • WaveMultiPrefixBitXor
      • WaveMultiPrefixExclusiveBitAnd
      • WaveMultiPrefixExclusiveBitOr
      • WaveMultiPrefixExclusiveBitXor
      • WaveMultiPrefixExclusiveMax
      • WaveMultiPrefixExclusiveMin
      • WaveMultiPrefixExclusiveProduct
      • WaveMultiPrefixExclusiveSum
      • WaveMultiPrefixInclusiveBitAnd
      • WaveMultiPrefixInclusiveBitOr
      • WaveMultiPrefixInclusiveBitXor
      • WaveMultiPrefixInclusiveMax
      • WaveMultiPrefixInclusiveMin
      • WaveMultiPrefixInclusiveProduct
      • WaveMultiPrefixInclusiveSum
      • WaveMultiPrefixProduct
      • WaveMultiPrefixSum
      • WaveMultiProduct
      • WaveMultiSum
      • WaveRotate
      • WorkgroupSize
      • abort
      • all
      • any
      • bitfieldExtract
      • bitfieldInsert
      • clip
      • clock2x32ARB
      • clockARB
      • concat
      • coopVecLoad
      • coopVecLoadGroupshared
      • coopVecMatMul
      • coopVecMatMulAdd
      • coopVecMatMulAddPacked
      • coopVecMatMulPacked
      • coopVecOuterProductAccumulate
      • coopVecReduceSumAccumulate
      • createDynamicObject
      • cudaBlockDim
      • cudaBlockIdx
      • cudaThreadIdx
      • debugBreak
      • defaultGetDescriptorFromHandle
      • detach
      • diffPair
      • getDescriptorFromHandle
      • getRealtimeClock
      • getRealtimeClockLow
      • getStringHash
      • isDifferentialNull
      • loadAligned
      • makeArrayFromElement
      • makeTuple
      • nextafter
      • nonuniform
      • operator*
      • packHalf2x16
      • packInt4x8
      • packInt4x8Clamp
      • packSnorm2x16
      • packSnorm4x8
      • packUint4x8
      • packUint4x8Clamp
      • packUnorm2x16
      • packUnorm4x8
      • pack_clamp_s8
      • pack_clamp_u8
      • pack_s8
      • pack_u8
      • printf
      • select
      • static_assert
      • storeAligned
      • syncTorchCudaStream
      • unmodified
      • unpackHalf2x16ToFloat
      • unpackHalf2x16ToHalf
      • unpackInt4x8ToInt16
      • unpackInt4x8ToInt32
      • unpackSnorm2x16ToFloat
      • unpackSnorm2x16ToHalf
      • unpackSnorm4x8ToFloat
      • unpackSnorm4x8ToHalf
      • unpackUint4x8ToUint16
      • unpackUint4x8ToUint32
      • unpackUnorm2x16ToFloat
      • unpackUnorm2x16ToHalf
      • unpackUnorm4x8ToFloat
      • unpackUnorm4x8ToHalf
      • unpack_s8s16
      • unpack_s8s32
      • unpack_u8u16
      • unpack_u8u32
      • unused
      • updateDiff
      • updatePair
      • updatePrimal
      • workgroupUniformLoad

InterlockedCompareStoreFloatBitwise

Description

Perform an atomic compare and store operation on dest.

Signature

void InterlockedCompareStoreFloatBitwise<T>(
    T dest,
    T compare_value,
    T value)
    where T : IAtomicable;

Generic Parameters

T: IAtomicable

The type of the value to perform the atomic operation on.

Parameters

dest : T

The value to perform the atomic operation on.

compare_value : T

The value to compare dest with.

value : T

The value to store into dest if the compare result is equal.

Remarks

When targeting HLSL, a call to this function will translate to a call to InterlockedCompareStoreFloatBitwise, which means the comparison is done as a bitwise comparison.

On SPIR-V (Vulkan), this function maps to OpAtomicCompareExchange.

On Metal and WGSL, this function is not available.

On CUDA, this function maps to atomicCAS.