--- layout: stdlib-reference --- # WavePrefixMax ## Description WavePrefixMax - Exclusive prefix maximum (equivalent to GLSL subgroupExclusiveMax) Returns the maximum of all values from lanes with a lower index. Lane 0 gets the identity value (type min), lane i gets max(val[0], ..., val[i-1]). ## Signature
T WavePrefixMax<T>(T expr)
where T : __BuiltinArithmeticType;
vector<T, N> WavePrefixMax<T, int N>(vector<T, N> expr)
where T : __BuiltinArithmeticType;
matrix<T, N, M> WavePrefixMax<T, int N, int M>(matrix<T, N, M> expr)
where T : __BuiltinArithmeticType;
## Generic Parameters
#### T: [\_\_BuiltinArithmeticType](../interfaces/0_builtinarithmetictype-029j/index.html)
#### N : int
#### M : int
## Parameters
#### expr : [T](waveprefixmax-04a.html#typeparam-T)
#### expr : [vector](../types/vector/index.html)\<[T](../types/vector/index.html#typeparam-T), [N](../types/vector/index.html#decl-N)\>
#### expr : [matrix](../types/matrix/index.html)\<[T](../types/matrix/t-0.html), [N](../types/matrix/index.html#decl-N), [M](../types/matrix/index.html#decl-M)\>
## Availability and Requirements
Defined for the following targets:
#### glsl
Available in all stages.
#### cuda
Available in all stages.
#### spirv
Available in all stages.
Requires capability: `spvGroupNonUniformArithmetic`.