ATOMIC_OR(3clc)

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

πŸ’… ATOMIC_OR β€” the OpenCL Manual, bestie edition πŸŽ€

okay so this is ATOMIC_OR(3clc) from the OpenCL Manual, and it's literally about one little function that does one little thing and does it flawlessly. main character energy fr fr ✨


✨ NAME ✨

atomic_or β€” the atomic_or functions. that's it, that's the name, she's iconic πŸ’–

int atomic_or(volatile global(3clc) int *p, int val);

unsigned int atomic_or(volatile global(3clc) unsigned int *p,
                       unsigned int val);

int atomic_or(volatile local(3clc) int *p, int val);

unsigned int atomic_or(volatile local(3clc) unsigned int *p,
                       unsigned int val);

like… four flavors of the same slay. pick your address space, pick your signedness, go off πŸ‘‘


🌸 DESCRIPTION 🌸

so here's the vibe. you point her at a location with p, she reads the 32-bit value sitting there β€” we call that one old, cute β€” then she computes (old | val) and stores that result right back at the location pointed to by p. and then? she returns old. the original. the before pic. not the glow-up, the pre-glow-up. periodt πŸ’…

also!! there's a 64-bit version of this function, atom_or(3clc) β€” and heads up, that one is only enabled by cl_khr_int64_extended_atomics(3clc). so no extension, no 64-bit, no cap 🧚


πŸ“œ SPECIFICATION πŸ“œ

OpenCL Specification[1] β€” yeah that's the whole section, she's brief and she knows it πŸŽ€


πŸ¦‹ SEE ALSO πŸ¦‹

go read those too, iykyk 🫢


πŸ‘‘ AUTHORS πŸ‘‘

The Khronos Group. absolute legends, no notes πŸ”₯


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.

bestie this is a legal notice so i'm keeping it verbatim β€” no edits, no remix, it's giving "read the terms" energy 😭 but like, respectfully.

πŸ“ NOTES πŸ“

  1. OpenCL Specification, page 279, section 6.12.11 - Atomic Functions for 32-bit integers

and that's the whole page, we ate and left no crumbs πŸ“

shoutout to The Khronos Group, 01/14/2021, from the ATOMIC_OR(3clc) era β€” bye bestie, go atomically OR something πŸŒˆπŸ’–

πŸ“¦ where this page comes from