ROUND(3clc)
π NAME π
okay bestie, meet round β the rounding function. that's it, that's the whole vibe. she rounds. π
gentype round(gentype x);
β¨ DESCRIPTION β¨
so what does she actually do? she gives you back the integral value nearest to x, and when a case lands exactly halfway, she rounds away from zero β no matter what the current rounding direction is. she does not care about your rounding direction. she has her own opinions. periodt. π
π NOTES π
- the vector versions of the math functions operate component-wise, and the description is per-component. so like, each lane does its own lil thing. π¦
- the built-in math functions are not affected by the prevailing rounding mode in the calling environment β they always return the same value as they would if they were called with the round to nearest even rounding mode. no cap.
- built-in math functions take scalar or vector arguments. for any specific use of these functions, the actual type has to be the same for all arguments and the return type, unless otherwise specified. consistency, queen. π
- the generic type name
gentypemeans the function can takefloat,float2,float3,float4,float8,float16,double,double2,double3,double4,double8, ordouble16as the type for the arguments. - if extended with
cl_khr_fp16(3clc), the generic type namegentypemay indicatehalfandhalf{2|3|4|8|16}as arguments and return values. β¨ - the generic type name
gentypefmeans the function can takefloat,float2,float3,float4,float8, orfloat16as the type for the arguments. - the generic type name
gentypedmeans the function can takedouble,double2,double3,double4,double8, ordouble16as the type for the arguments.
π SPECIFICATION π
OpenCL Specification[1]
π«Ά SEE ALSO π«Ά
π AUTHORS π
The Khronos Group
πΈ 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 condition: the above copyright notice and this permission notice shall be included in all copies or substantial portions of the Materials.
β NOTES β
- OpenCL Specification β page 244, section 6.12.2 - Math Functions
okay that's the whole page, you ate that π
and a lil sign-off from the footer, bc she deserves her flowers: this one's brought to you by The Khronos Group, dated 01/14/2021, and it lives in ROUND(3clc) in the OpenCL Manual. iykyk. bye bestie, go round some numbers πβ¨
π¦ 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