REMQUO(3clc)

πŸ“¦
version 1.0~svn33624 Β· 3 versions
, in ubuntu jammy, ubuntu noble

✨ REMQUO(3clc) ✨

okay bestie, welcome to remquo from the OpenCL Manual πŸ’– this one's a floating point remainder and quotient function, and yes it's giving "two jobs, one icon" energy πŸ‘‘


🌸 NAME 🌸

remquo β€” floating point remainder and quotient function. that's the whole vibe. πŸŽ€

here's the full cast of characters, like literally every single prototype, no skips, no cap:

floatn remquo(floatn x, floatn y, __global intn *quo);

floatn remquo(floatn x, floatn y, __local intn *quo);

floatn remquo(floatn x, floatn y, __private intn *quo);

float remquo(float x, float y, __global int *quo);

float remquo(float x, float y, __local int *quo);

float remquo(float x, float y, __private int *quo);

doublen remquo(doublen x, doublen y, __global intn *quo);

doublen remquo(doublen x, doublen y, __local intn *quo);

doublen remquo(doublen x, doublen y, __private intn *quo);

double remquo(double x, double y, __global int *quo);

double remquo(double x, double y, __local int *quo);

double remquo(double x, double y, __private int *quo);

halfn remquo(halfn x, halfn y, __global intn *quo);

halfn remquo(halfn x, halfn y, __local intn *quo);

halfn remquo(halfn x, halfn y, __private intn *quo);

half remquo(half x, half y, __global int *quo);

half remquo(half x, half y, __local int *quo);

half remquo(half x, half y, __private int *quo);

look at that list. eighteen whole prototypes. she ate and left no crumbs πŸ’…


πŸ’« DESCRIPTION πŸ’«

so remquo computes the value r such that r = x - n*y, where k is the integer nearest the exact value of x/y. yes bestie, the manpage really does say k there, and we are respecting the text exactly πŸ™ˆ

if there are two integers closest to x/y, then k shall be the even one. cute, right? ties go to the even one, very fair, very demure ✨

if r is zero, it gets the same sign as x. and just so you know β€” this is literally the same value that gets returned by the remainder(3clc) function. same energy, different function name 🫢

BUT WAIT there's more, because remquo is a multi-talented main character πŸ‘‘ it also calculates the lower seven bits of the integral quotient x/y, and gives that value the same sign as x/y. then it stores this signed value in the object pointed to by quo. slay πŸ’…


πŸ¦‹ NOTES πŸ¦‹

  • the vector versions of the math functions operate component-wise. the description is per-component, so like, imagine it happening in every lane simultaneously. parallel queen ✨
  • the built-in math functions are not affected by the prevailing rounding mode in the calling environment, and they always return the same value as they would if called with the round to nearest even rounding mode. consistent, unbothered, moisturized 🌸
  • the 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. no mixing, bestie, that's the rule πŸŽ€
  • the generic type name gentype is used to indicate that the function can take float, float2, float3, float4, float8, float16, double, double2, double3, double4, double8, or double16 as the type for the arguments.
  • if extended with cl_khr_fp16(3clc), the generic type name gentype may indicate half and half{2|3|4|8|16} as arguments and return values. yes, half gets to come too, inclusivity icon πŸ’œ
  • the generic type name gentypef is used to indicate that the function can take float, float2, float3, float4, float8, or float16 as the type for the arguments.
  • the generic type name gentyped is used to indicate that the function can take double, double2, double3, double4, double8, or double16 as the type for the arguments.

🌈 SPECIFICATION 🌈

OpenCL Specification[1] ⭐


🧚 SEE ALSO 🧚

go read that one next bestie, it's the whole friend group 🫢


πŸ‘‘ 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.

ngl the license text stays exactly as-is, because legal text is the one thing we do NOT remix πŸ’€

πŸ“ NOTES πŸ“

  1. OpenCL Specification β€” page 244, section 6.12.2 - Math Functions

and that's the whole page, bestie!! πŸ’… this was The Khronos Group, dated 01/14/2021, and the page is literally called REMQUO(3clc) β€” you're so welcome, go forth and compute remainders and quotients responsibly πŸŒΈβœ¨πŸ¦‹πŸ’–

πŸ“¦ where this page comes from