📜  cuda 原子交换 - C++ 代码示例

📅  最后修改于: 2022-03-11 14:44:46.435000             🧑  作者: Mango

代码示例1
int atomicCAS(int* address, int compare, int val);
//reads the 16-bit, 32-bit or 64-bit word old located at the address 
//address in global or shared memory, computes 
//(old == compare ? val : old) , and stores the result back to memory 
//at the same address. These three operations are performed in one 
//atomic transaction. The function returns old (Compare And Swap).