而atomic_cmpxchg函数就是实现原子操作的工具之一。 在Linux内核中,原子操作函数通常以“atomic_”开头,而“cmpxchg”是compare and exchange的缩写,表示比较并交换。atomic_cmpxchg函数的作用是比较传入的两个值是否相等,如果相等,则将第三个参数的值赋给共享变量,否则不做任何操作。这个操作是原子的,不会被中断,因此...
int __attribute__((overloadable)) atomic_cmpxchg(volatile __global int *p, int cmp, int val); ^ /home/foreman/sources/stream/opencl/compiler/clc2/ocl-headers/build/lnx64a/B_rel/opencl12_builtins.h:4371:44: note: candidate function not viable: no known conversion from 'volatile __glo...
atomic_cmpxchg and 64-bit values Brent Casavant Re: atomic_cmpxchg and 64-bit values Andreas Schwab Re: atomic_cmpxchg and 64-bit values Christoph Lameter Re: atomic_cmpxchg and 64-bit values Brent Casavant Reply via email to The Mail Archive home linux-ia64 - all messages linux-ia64 -...
> > > Is there some particular reason we need the cast to int on the > > > return path for atomic_cmpxchg()? It looks to me as if this > > > macro would work equally well with an atomic_t or an atomic64_t. > > > > No, this is won't work, atomic_cmpxchg is strictly o...
That is exactly what we intended to do - 64-bit atomic_cmpxchg (as in the title). The pointer (the first argument) we fed to the atomic_cmpxchg is __global ulong *, but the *.cl built with errors. The error messages seem to try to convert ulong to 32-bit integers as the followi...
On Wed, 17 Jan 2007, Andreas Schwab wrote: > Brent Casavant <[EMAIL PROTECTED]> writes: > > > Is there some particular reason we need the cast to int on the > > return path for atomic_cmpxchg()? It looks to me as if this > > macro would work equally well with an atomic_t ...
int __attribute__((overloadable)) atomic_cmpxchg(volatile __global int *p, int cmp, int val); ^ /home/foreman/sources/stream/opencl/compiler/clc2/ocl-headers/build/lnx64a/B_rel/opencl12_builtins.h:4371:44: note: candidate function not viable: no known conversion from 'volatile __glo...
That is exactly what we intended to do - 64-bit atomic_cmpxchg (as in the title). The pointer (the first argument) we fed to the atomic_cmpxchg is __global ulong *, but the *.cl built with errors. The error messages seem to try to convert ulong to 32-bit integers as the followi...