1#ifndef STAN_MATH_OPENCL_KERNELS_DEVICE_ATOMIC_ADD_DOUBLE_HPP
2#define STAN_MATH_OPENCL_KERNELS_DEVICE_ATOMIC_ADD_DOUBLE_HPP
10namespace opencl_kernels {
12static constexpr const char *atomic_add_double_device_function
14 "#ifndef STAN_MATH_OPENCL_KERNELS_DEVICE_FUNCTIONS_ATOMIC_ADD_DOUBLE\n"
15 "#define STAN_MATH_OPENCL_KERNELS_DEVICE_FUNCTIONS_ATOMIC_ADD_DOUBLE\n"
16 "#pragma OPENCL EXTENSION cl_khr_int64_base_atomics: enable\n" STRINGIFY(
38 new_val.f = old_val.f + delta;
39 }
while (atom_cmpxchg((
volatile __global ulong *)val, old_val.i,
63 new_val.f = old_val.f + delta;
64 }
while (atom_cmpxchg((
volatile __local ulong *)val, old_val.i,
void atomic_add_double(__global double *val, double delta)
Atomically add to a double value.
void local_atomic_add_double(__local double *val, double delta)
Atomically add to a local double value.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...