Maximum Arithmetic

Select the larger of two operands.

Vendor-Neutral Definition

d = (a > b) ? a : b, evaluated per the operand's type (integer or IEEE-754 float).
⚠️ Cross-vendor mappings describe semantic relationships and are not guaranteed one-to-one compiler translations.
equivalent with restrictions Both select the larger of two operands; PTX's max is one family covering float/signed/unsigned via a type modifier, where AMDGPU exposes a differently-named instruction per type.
Property NVIDIA PTX AMDGPU
Instruction max v_max_f32, v_max_i32, v_max_u32
ISA Layer Virtual Native
Data Types f32, f64, s16, s32, s64, u16, u32, u64 f32, i32, u32
Version / Target Introduced PTX ISA 1.0 gfx1100, gfx1100, gfx1100

Important Differences

  • PTX's max is ONE family spanning f32/f64/s16/s32/s64/u16/u32/u64; AMDGPU requires selecting the correctly-typed instruction (v_max_f32 vs v_max_i32 vs v_max_u32, etc.) rather than one generic mnemonic.
  • NaN-handling for the floating-point form is hardware-generation-specific on both vendors and not verified to match bit-for-bit here.

Source Evidence

Verification method: documentation