MIN(3clc)
π MIN β bestie edition π
okay so this is min from the OpenCL Manual, and she is min(3clc) if you're being formal about it. pull up a chair, we're finding the lesser of two values and we're doing it adorably. π
β¨ NAME β¨
min β returns the lesser of two values. literally just vibes-based comparison, no cap. π¦
πΈ SYNOPSIS πΈ
bestie the signatures are giving versatile. here they are, verbatim, don't touch:
gentype min(gentype x, gentype y);
gentypef min(gentypef x, float y);
gentyped min(gentyped x, double y);
gentype min (gentype x, half y) //
if half extension enabled
yes that last one has the comment in the signature. iconic. π
π DESCRIPTION π
okay so min returns y if y < x, otherwise it returns x. that's the whole thing. that's the tea. β
π¨ MAJOR WARNING π¨ ifxandyare infinite or NaN, the return values are undefined. not "kinda weird", not "close enough" β undefined. don't come crying to me. π
π NOTES π
- the generic type name
gentypeis used to indicate that the function can takefloat,float2,float3,float4,float8,float16,double,double2,double3,double4,double8, ordouble16as the type for the arguments. so many options, she's flexible, we love that. β¨ - the generic type name
gentypefis used to indicate that the function can takefloat,float2,float3,float4,float8, orfloat16as the type for the arguments. float girlies only. π - the generic type name
gentypedis used to indicate that the function can takedouble,double2,double3,double4,double8, ordouble16as the type for the arguments. double precision divas, this one's for you. π - the built-in common functions are implemented using the round to nearest even rounding mode. that's the rules, babe. no arguing. π
- if extended with
cl_khr_fp16(3clc), generic type namegentypemay indicatehalfandhalf{2|3|4|8|16}as arguments and return values. so like, half the size, double the drama. π§
β SPECIFICATION β
OpenCL Specification[1] β the source material, the blueprint, the moment. π₯
π«Ά SEE ALSO π«Ά
commonFunctions(3clc)β go read her next, she's the whole friend group. π
π AUTHORS π
The Khronos Group. legends only, honestly. π
π COPYRIGHT π
Copyright Β© 2007-2011 The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and/or associated documentation files (the "Materials"), to deal in the Materials without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Materials, and to permit persons to whom the Materials are furnished to do so, subject to the following conditions:
the above copyright notice and this permission notice shall be included in all copies or substantial portions of the Materials. periodt. π
π NOTES (yes, again, the numbered kind) π
- OpenCL Specification β page 260, section 6.12.4 - Common Functions
and that's the whole page bestie π this lil manual is brought to you by The Khronos Group, dated 01/14/2021, and it lives at MIN(3clc) forever and ever. mwah. πβ¨π
π¦ where this page comes from
- ubuntu jammy: opencl-1.2-man-doc 1.0~svn33624-5 Β· other
- ubuntu noble: opencl-1.2-man-doc 1.0~svn33624-5 Β· other
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms