OPERATORS(3clc)

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

🌸 OPERATORS β€” a page from the OpenCL Manual (section 3clc, bestie) 🌸

okay so welcome to the operator page, bestie πŸ’– this is where OpenCL keeps all its little math-and-logic symbols, and yes it is giving "cheat sheet" energy and yes i am obsessed.

✨ NAME ✨

Operators β€” the operators used in OpenCL. πŸŽ€


πŸ’… DESCRIPTION πŸ’…

so here's the tea: these are all the operators that show up in OpenCL. if you wanna know how to actually use them (the usage, the rules, the whole vibe), the page says to please go check the OpenCL specification[1]. that's the receipts, bestie, i don't make the rules. 🫢

here's the full lineup, no skips, no cuts:

  • + β€” add βž•
  • - β€” subtract βž–
  • * β€” multiply βœ–οΈ
  • / β€” divide βž—
  • % β€” remainder
  • + β€” unary plus
  • - β€” unary minus
  • ++ β€” post- and pre-increment ⬆️
  • -- β€” post- and pre-decrement ⬇️
  • > β€” relational greater-than
  • < β€” relational less-than
  • >= β€” relational greater-than or equal-to
  • <= β€” relational less-than or equal-to
  • == β€” equal
  • != β€” not equal
  • & β€” bitwise and
  • | β€” bitwise or
  • ^ β€” bitwise not
  • ~ β€” bitwise not
  • && β€” logical and
  • || β€” logical or
  • ^^ β€” logical exclusive or
  • ! β€” logical unary not
  • ?: β€” ternary selection
  • >> β€” right shift
  • << β€” left shift
  • sizeof β€” size of
  • , β€” comma
  • * β€” dereference
  • & β€” address-of
  • = β€” assignment

(yes, "bitwise not" really does show up twice, for ^ and for ~ β€” that's literally how the page lists them, i'm just the messenger πŸ’€)


⚠️ NOTE ⚠️

bestie, listen: except for the sizeof operator, the half data type cannot be used with any of the operators described in this section. not a single one. that's the rule, no cap. 🚫

πŸ“œ SPECIFICATION πŸ“œ

OpenCL Specification[1]


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


πŸ¦‹ NOTES πŸ¦‹

  1. OpenCL specification β€” page 215, section 6.3 - Operators

and that's the whole page, periodt. ✨ this one's from The Khronos Group, dated 01/14/2021, and it lives at OPERATORS(3clc) in the OpenCL Manual. go forth and shift some bits, main character πŸ’–πŸŒˆ

πŸ“¦ where this page comes from