--- layout: stdlib-reference --- # InterlockedMax ## Description Perform an atomic max operation on dest. ## Signature
void InterlockedMax<T>( T dest, T value) where T : IArithmeticAtomicable; void InterlockedMax<T>( T dest, T value, out T original_value) where T : IArithmeticAtomicable; void InterlockedMax( uint dest, int value);## Generic Parameters #### T: [IArithmeticAtomicable](../interfaces/iarithmeticatomicable-01b/index.html) The type of the value to perform the atomic operation on. ## Parameters #### dest : [T](interlockedmax-0b.html#typeparam-T) The value to perform the atomic operation on. #### value : [T](interlockedmax-0b.html#typeparam-T) The operand to the atomic operation. #### original\_value : [T](interlockedmax-0b.html#typeparam-T) The value of dest before the operation. #### dest : uint The value to perform the atomic operation on. #### value : int The operand to the atomic operation. ## Remarks When targeting HLSL, it is invalid to call this function with T being a floating-point type, since HLSL does not allow atomic operations on floating point types. For InterlockedAdd, consider using RWByteAddressBuffer.InterlockedAddF32 or RWByteAddressBuffer.InterlockedAddF16 instead when NVAPI is available. On SPIR-V (Vulkan), all integer and floating point types are supported. On Metal and WGSL, all floating-point types are not supported. ## Availability and Requirements Defined for the following targets: #### hlsl Available in all stages. #### glsl Available in all stages. #### cuda Available in all stages. #### metal Available in all stages. #### spirv Available in all stages.