MAD_HI(3clc)

๐Ÿ“ฆ
version 1.0~svn33624 ยท 3 versions
, in ubuntu jammy, ubuntu noble

๐Ÿ’– MAD_HI โ€” the OpenCL manual, but make it make sense ๐Ÿ’–

okay bestie, we're in the OpenCL Manual and this is page MAD_HI(3clc). yes it's a CLC thing. yes it's giving integer-math-girlie. let's go ๐ŸŽ€


โœจ NAME โœจ

mad_hi โ€” literally just returns mul_hi(a, b) + c. that's the whole personality. that's the vibe. ๐Ÿฆ‹


โœจ SYNOPSIS โœจ

gentype mad_hi(gentype a, gentype b, gentype c);

โœจ DESCRIPTION โœจ

so mad_hi returns mul_hi(3clc)(a, b) + c. no cap. it does the high-multiply thing and then adds c on top. iconic behaviour honestly ๐Ÿ’…


โœจ NOTES โœจ

okay so here's the tea, and it matters, so pay attention ๐Ÿซถ

  • built-in integer functions take scalar or vector arguments. the vector versions of the integer functions operate component-wise. and the description? it's per component. so like, think of each lane doing its own little thing โœจ
  • we use the generic type name gentype to say "hey this function can take any of these as the type for the arguments": char, char{2|3|4|8|16}, uchar, uchar{2|3|4|8|16}, short, short{2|3|4|8|16}, ushort, ushort{2|3|4|8|16}, int, int{2|3|4|8|16}, uint, uint{2|3|4|8|16}, long, long{2|3|4|8|16}, ulong, or ulong{2|3|4|8|16}. yes all of them. all the flavors ๐Ÿ“
  • we also use the generic type name ugentype to refer to the unsigned versions of gentype. for example, if gentype is char4, then ugentype is uchar4. easy math, bestie ๐Ÿงฎ
  • and we use the generic type name sgentype to indicate that the function can take a scalar data type, i.e. char, uchar, short, ushort, int, uint, long, or ulong as the type for the arguments. for built-in integer functions that take gentype and sgentype arguments, the gentype argument must be a vector or scalar version of the sgentype argument. for example, if sgentype is uchar, gentype must be uchar or uchar{2|3|4|8|16}. for vector versions, sgentype is implicitly widened to gentype as described in section 6.3.a of the OpenCL specification. that's the rule, no skipping it ๐Ÿ™ˆ
  • for any specific use of a function, the actual type has to be the same for all arguments and the return type unless otherwise specified. so don't be mixing, it's not that kind of party ๐Ÿ’€

โœจ SPECIFICATION โœจ

OpenCL Specification[1] ๐Ÿ‘‘


โœจ SEE ALSO โœจ


โœจ AUTHORS โœจ

The Khronos Group ๐Ÿซถ


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 condition that this copyright notice and permission notice shall be included in all copies or substantial portions of the Materials.

yes that whole paragraph is verbatim and it has to stay verbatim, it's a license, we do not freestyle those ๐Ÿ’–

โœจ NOTES (the footnote kind) โœจ

  1. OpenCL Specification โ€” page 256, section 6.12.3 - Integer Functions ๐Ÿ“–

and that's the whole page, bestie!! this lil gem comes to you from The Khronos Group, dated 01/14/2021, and it lives at MAD_HI(3clc). go forth and multiply-high-and-add responsibly ๐ŸŒˆโœจ๐Ÿ’œ

๐Ÿ“ฆ where this page comes from