Type-safe wrappers around the atomic operators found in GPU runtime APIs. More...
Functions | |
__device__ int | sp::atomicAdd (__device int *addr, int val) |
Atomically add val to the value stored at AS memory location addr , returning the original value. More... | |
__device__ unsigned int | sp::atomicAdd (__device unsigned int *addr, unsigned int val) |
Atomically add val to the value stored at AS memory location addr , returning the original value. More... | |
__device__ unsigned long long | sp::atomicAdd (__device unsigned long long *addr, unsigned long long val) |
Atomically add val to the value stored at AS memory location addr , returning the original value. More... | |
__device__ float | sp::atomicAdd (__device float *addr, float val) |
Atomically add val to the value stored at AS memory location addr , returning the original value. More... | |
__device__ double | sp::atomicAdd (__device double *addr, double val) |
Atomically add val to the value stored at AS memory location addr , returning the original value. More... | |
__device__ int | sp::atomicSub (__device int *addr, int val) |
Atomically subtract val from the value stored at AS memory location addr , returning the original value. More... | |
__device__ unsigned int | sp::atomicSub (__device unsigned int *addr, unsigned int val) |
Atomically subtract val from the value stored at AS memory location addr , returning the original value. More... | |
__device__ unsigned long long | sp::atomicSub (__device unsigned long long *addr, unsigned long long val) |
Atomically subtract val from the value stored at AS memory location addr , returning the original value. More... | |
__device__ float | sp::atomicSub (__device float *addr, float val) |
Atomically subtract val from the value stored at AS memory location addr , returning the original value. More... | |
__device__ double | sp::atomicSub (__device double *addr, double val) |
Atomically subtract val from the value stored at AS memory location addr , returning the original value. More... | |
__device__ int | sp::atomicExch (__device int *addr, int val) |
Atomically write val to addr and return the value that was stored there before calling this function. More... | |
__device__ unsigned int | sp::atomicExch (__device unsigned int *addr, unsigned int val) |
Atomically write val to addr and return the value that was stored there before calling this function. More... | |
__device__ unsigned long long | sp::atomicExch (__device unsigned long long *addr, unsigned long long val) |
Atomically write val to addr and return the value that was stored there before calling this function. More... | |
__device__ float | sp::atomicExch (__device float *addr, float val) |
Atomically write val to addr and return the value that was stored there before calling this function. More... | |
__device__ int | sp::atomicMin (__device int *addr, int val) |
Atomically write the min of *addr and val to addr , returning the original value of *addr . More... | |
__device__ int | sp::atomicMax (__device int *addr, int val) |
Atomically write the max of *addr and val to addr , returning the original value of *addr . More... | |
__device__ unsigned int | sp::atomicMin (__device unsigned int *addr, unsigned int val) |
Atomically write the min of *addr and val to addr , returning the original value of *addr . More... | |
__device__ unsigned int | sp::atomicMax (__device unsigned int *addr, unsigned int val) |
Atomically write the max of *addr and val to addr , returning the original value of *addr . More... | |
__device__ unsigned long long | sp::atomicMin (__device unsigned long long *addr, unsigned long long val) |
Atomically write the min of *addr and val to addr , returning the original value of *addr . More... | |
__device__ unsigned long long | sp::atomicMax (__device unsigned long long *addr, unsigned long long val) |
Atomically write the max of *addr and val to addr , returning the original value of *addr . More... | |
__device__ int | sp::atomicCAS (__device int *addr, int cmp, int val) |
__device__ unsigned int | sp::atomicCAS (__device unsigned int *addr, unsigned int cmp, unsigned int val) |
__device__ unsigned long long | sp::atomicCAS (__device unsigned long long *addr, unsigned long long cmp, unsigned long long val) |
__device__ int | sp::atomicAnd (__device int *addr, int val) |
Atomically compute *addr = *addr & val and return the original value of *addr . More... | |
__device__ int | sp::atomicOr (__device int *addr, int val) |
Atomically compute *addr = *addr | val and return the original value of *addr . More... | |
__device__ int | sp::atomicXor (__device int *addr, int val) |
Atomically compute *addr = *addr ^ val and return the original value of *addr . More... | |
__device__ unsigned int | sp::atomicAnd (__device unsigned int *addr, unsigned int val) |
Atomically compute *addr = *addr & val and return the original value of *addr . More... | |
__device__ unsigned int | sp::atomicOr (__device unsigned int *addr, unsigned int val) |
Atomically compute *addr = *addr | val and return the original value of *addr . More... | |
__device__ unsigned int | sp::atomicXor (__device unsigned int *addr, unsigned int val) |
Atomically compute *addr = *addr ^ val and return the original value of *addr . More... | |
__device__ unsigned long long | sp::atomicAnd (__device unsigned long long *addr, unsigned long long val) |
Atomically compute *addr = *addr & val and return the original value of *addr . More... | |
__device__ unsigned long long | sp::atomicOr (__device unsigned long long *addr, unsigned long long val) |
Atomically compute *addr = *addr | val and return the original value of *addr . More... | |
__device__ unsigned long long | sp::atomicXor (__device unsigned long long *addr, unsigned long long val) |
Atomically compute *addr = *addr ^ val and return the original value of *addr . More... | |
__device__ unsigned int | sp::atomicInc (__device unsigned int *addr, unsigned int val) |
__device__ unsigned int | sp::atomicDec (__device unsigned int *addr, unsigned int val) |
Type-safe wrappers around the atomic operators found in GPU runtime APIs.
The purpose of these wrappers is to add support for speclib address space qualifiers such as __device
or __shared
. This gives you additional type-safety when using atomics, since it is now impossible to accidentally pass a stack address, or incur a huge performance overhead by causing a generic atomic instruction to be used ( on many targets, these compile to conditional logic to select between address-space-specific atomic hardware instructions).
__device__ double sp::atomicAdd | ( | __device double * | addr, |
double | val | ||
) |
Atomically add val
to the value stored at AS memory location addr
, returning the original value.
__device__ float sp::atomicAdd | ( | __device float * | addr, |
float | val | ||
) |
Atomically add val
to the value stored at AS memory location addr
, returning the original value.
__device__ int sp::atomicAdd | ( | __device int * | addr, |
int | val | ||
) |
Atomically add val
to the value stored at AS memory location addr
, returning the original value.
__device__ unsigned int sp::atomicAdd | ( | __device unsigned int * | addr, |
unsigned int | val | ||
) |
Atomically add val
to the value stored at AS memory location addr
, returning the original value.
__device__ unsigned long long sp::atomicAdd | ( | __device unsigned long long * | addr, |
unsigned long long | val | ||
) |
Atomically add val
to the value stored at AS memory location addr
, returning the original value.
__device__ int sp::atomicAnd | ( | __device int * | addr, |
int | val | ||
) |
Atomically compute *addr = *addr & val
and return the original value of *addr
.
__device__ unsigned int sp::atomicAnd | ( | __device unsigned int * | addr, |
unsigned int | val | ||
) |
Atomically compute *addr = *addr & val
and return the original value of *addr
.
__device__ unsigned long long sp::atomicAnd | ( | __device unsigned long long * | addr, |
unsigned long long | val | ||
) |
Atomically compute *addr = *addr & val
and return the original value of *addr
.
__device__ float sp::atomicExch | ( | __device float * | addr, |
float | val | ||
) |
Atomically write val
to addr
and return the value that was stored there before calling this function.
__device__ int sp::atomicExch | ( | __device int * | addr, |
int | val | ||
) |
Atomically write val
to addr
and return the value that was stored there before calling this function.
__device__ unsigned int sp::atomicExch | ( | __device unsigned int * | addr, |
unsigned int | val | ||
) |
Atomically write val
to addr
and return the value that was stored there before calling this function.
__device__ unsigned long long sp::atomicExch | ( | __device unsigned long long * | addr, |
unsigned long long | val | ||
) |
Atomically write val
to addr
and return the value that was stored there before calling this function.
__device__ int sp::atomicMax | ( | __device int * | addr, |
int | val | ||
) |
Atomically write the max of *addr
and val
to addr
, returning the original value of *addr
.
__device__ unsigned int sp::atomicMax | ( | __device unsigned int * | addr, |
unsigned int | val | ||
) |
Atomically write the max of *addr
and val
to addr
, returning the original value of *addr
.
__device__ unsigned long long sp::atomicMax | ( | __device unsigned long long * | addr, |
unsigned long long | val | ||
) |
Atomically write the max of *addr
and val
to addr
, returning the original value of *addr
.
__device__ int sp::atomicMin | ( | __device int * | addr, |
int | val | ||
) |
Atomically write the min of *addr
and val
to addr
, returning the original value of *addr
.
__device__ unsigned int sp::atomicMin | ( | __device unsigned int * | addr, |
unsigned int | val | ||
) |
Atomically write the min of *addr
and val
to addr
, returning the original value of *addr
.
__device__ unsigned long long sp::atomicMin | ( | __device unsigned long long * | addr, |
unsigned long long | val | ||
) |
Atomically write the min of *addr
and val
to addr
, returning the original value of *addr
.
__device__ int sp::atomicOr | ( | __device int * | addr, |
int | val | ||
) |
Atomically compute *addr = *addr | val
and return the original value of *addr
.
__device__ unsigned int sp::atomicOr | ( | __device unsigned int * | addr, |
unsigned int | val | ||
) |
Atomically compute *addr = *addr | val
and return the original value of *addr
.
__device__ unsigned long long sp::atomicOr | ( | __device unsigned long long * | addr, |
unsigned long long | val | ||
) |
Atomically compute *addr = *addr | val
and return the original value of *addr
.
__device__ double sp::atomicSub | ( | __device double * | addr, |
double | val | ||
) |
Atomically subtract val
from the value stored at AS memory location addr
, returning the original value.
__device__ float sp::atomicSub | ( | __device float * | addr, |
float | val | ||
) |
Atomically subtract val
from the value stored at AS memory location addr
, returning the original value.
__device__ int sp::atomicSub | ( | __device int * | addr, |
int | val | ||
) |
Atomically subtract val
from the value stored at AS memory location addr
, returning the original value.
__device__ unsigned int sp::atomicSub | ( | __device unsigned int * | addr, |
unsigned int | val | ||
) |
Atomically subtract val
from the value stored at AS memory location addr
, returning the original value.
__device__ unsigned long long sp::atomicSub | ( | __device unsigned long long * | addr, |
unsigned long long | val | ||
) |
Atomically subtract val
from the value stored at AS memory location addr
, returning the original value.
__device__ int sp::atomicXor | ( | __device int * | addr, |
int | val | ||
) |
Atomically compute *addr = *addr ^ val
and return the original value of *addr
.
__device__ unsigned int sp::atomicXor | ( | __device unsigned int * | addr, |
unsigned int | val | ||
) |
Atomically compute *addr = *addr ^ val
and return the original value of *addr
.
__device__ unsigned long long sp::atomicXor | ( | __device unsigned long long * | addr, |
unsigned long long | val | ||
) |
Atomically compute *addr = *addr ^ val
and return the original value of *addr
.