blob: 58370d3067c3f6f545e15886edbdb585e9a81d26 (
plain)
1
2
3
4
5
6
7
8
9
|
_CLC_OVERLOAD _CLC_DEF GENTYPE clamp(GENTYPE x, GENTYPE y, GENTYPE z) {
return (x > z ? z : (x < y ? y : x));
}
#ifndef SCALAR
_CLC_OVERLOAD _CLC_DEF GENTYPE clamp(GENTYPE x, SCALAR_GENTYPE y, SCALAR_GENTYPE z) {
return (x > (GENTYPE)z ? (GENTYPE)z : (x < (GENTYPE)y ? (GENTYPE)y : x));
}
#endif
|