ATOM_AND(3clc)

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

πŸ’– ATOM_AND πŸ’–

okay bestie, welcome to the OpenCL Manual ✨ this is the page for atom_and, and it's literally about 64-bit atom_and functions. buckle up πŸŽ€

🌸 NAME 🌸

atom_and β€” 64-bit atom_and functions.

here's the whole squad, exactly as they are, no edits, periodt:

long atom_and(volatile global(3clc) long *p, long val);

long atom_and(volatile global(3clc) long *p, long val);

ulong atom_and(volatile local(3clc) ulong *p, ulong val);

ulong atom_and(volatile local(3clc) ulong *p, ulong val);

✨ DESCRIPTION ✨

so the vibe is: you read the 64-bit value hanging out at the location pointed to by p β€” we call that one old 🫢 β€” then you compute (old & val) and store that result right back at the location pointed to by p. and what does the function hand back to you? old. that's it. that's the whole thing. πŸ’…

heads up bestie: if your app wants to use this extension, you need to drop this into your OpenCL program source: #pragma OPENCL EXTENSION cl_khr_int64_extended_atomics : enable

this function happens in one atomic transaction. no cap. but here's the fine print, and it matters: these transactions are atomic for the device executing these atomic functions. if atomic operations to the same memory location are being performed by kernels executing on multiple devices, there is no guarantee of atomicity. so like, don't be messy about it πŸ™ˆ

also β€” and this is kind of iconic β€” atomic operations on 64-bit integers and 32-bit integers (and float) are also atomic with regard to each other. slay 🌈


πŸ¦‹ 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.


πŸ“ NOTES πŸ“

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

okay that's the whole page, we ate and left no crumbs πŸ’…βœ¨ this masterpiece was brought to you by The Khronos Group, dated 01/14/2021, and the manual is literally named ATOM_AND(3clc) β€” iykyk πŸ§šπŸ’–

πŸ“¦ where this page comes from