[PATCH] D43602: [CUDA] Added missing functions.

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 22 10:43:17 PST 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rC325814: [CUDA] Added missing functions. (authored by tra, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D43602?vs=135348&id=135466#toc

Repository:
  rC Clang

https://reviews.llvm.org/D43602

Files:
  lib/Headers/__clang_cuda_device_functions.h


Index: lib/Headers/__clang_cuda_device_functions.h
===================================================================
--- lib/Headers/__clang_cuda_device_functions.h
+++ lib/Headers/__clang_cuda_device_functions.h
@@ -687,6 +687,10 @@
 __DEVICE__ float __ull2float_rz(unsigned long long __a) {
   return __nv_ull2float_rz(__a);
 }
+__DEVICE__ unsigned long long __ullAtomicAdd(unsigned long long *__p,
+                                             unsigned long long __v) {
+  return __nvvm_atom_add_gen_ll((long long *)__p, __v);
+}
 __DEVICE__ unsigned long long __ullAtomicAdd_block(unsigned long long *__p,
                                                    unsigned long long __v) {
   return __nvvm_atom_cta_add_gen_ll((long long *)__p, __v);
@@ -707,6 +711,11 @@
                                                     unsigned long long __v) {
   return __nvvm_atom_sys_and_gen_ll((long long *)__p, __v);
 }
+__DEVICE__ unsigned long long __ullAtomicCAS(unsigned long long *__p,
+                                             unsigned long long __cmp,
+                                             unsigned long long __v) {
+  return __nvvm_atom_cas_gen_ll((long long *)__p, __cmp, __v);
+}
 __DEVICE__ unsigned long long __ullAtomicCAS_block(unsigned long long *__p,
                                                    unsigned long long __cmp,
                                                    unsigned long long __v) {
@@ -717,6 +726,10 @@
                                                     unsigned long long __v) {
   return __nvvm_atom_sys_cas_gen_ll((long long *)__p, __cmp, __v);
 }
+__DEVICE__ unsigned long long __ullAtomicExch(unsigned long long *__p,
+                                              unsigned long long __v) {
+  return __nvvm_atom_xchg_gen_ll((long long *)__p, __v);
+}
 __DEVICE__ unsigned long long __ullAtomicExch_block(unsigned long long *__p,
                                                     unsigned long long __v) {
   return __nvvm_atom_cta_xchg_gen_ll((long long *)__p, __v);
@@ -1123,10 +1136,16 @@
 __DEVICE__ float j1f(float __a) { return __nv_j1f(__a); }
 __DEVICE__ double jn(int __n, double __a) { return __nv_jn(__n, __a); }
 __DEVICE__ float jnf(int __n, float __a) { return __nv_jnf(__n, __a); }
+#if defined(__LP64__)
+__DEVICE__ long labs(long __a) { return llabs(__a); };
+#else
+__DEVICE__ long labs(long __a) { return __nv_abs(__a); };
+#endif
 __DEVICE__ double ldexp(double __a, int __b) { return __nv_ldexp(__a, __b); }
 __DEVICE__ float ldexpf(float __a, int __b) { return __nv_ldexpf(__a, __b); }
 __DEVICE__ double lgamma(double __a) { return __nv_lgamma(__a); }
 __DEVICE__ float lgammaf(float __a) { return __nv_lgammaf(__a); }
+__DEVICE__ long long llabs(long long __a) { return __nv_llabs(__a); }
 __DEVICE__ long long llmax(long long __a, long long __b) {
   return __nv_llmax(__a, __b);
 }
@@ -1267,6 +1286,9 @@
   return scalbnf(__a, (int)__b);
 }
 __DEVICE__ double sin(double __a) { return __nv_sin(__a); }
+__DEVICE__ void sincos(double __a, double *__sptr, double *__cptr) {
+  return __nv_sincos(__a, __sptr, __cptr);
+}
 __DEVICE__ void sincosf(float __a, float *__sptr, float *__cptr) {
   return __FAST_OR_SLOW(__nv_fast_sincosf, __nv_sincosf)(__a, __sptr, __cptr);
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43602.135466.patch
Type: text/x-patch
Size: 3254 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180222/2ffaefd2/attachment-0001.bin>


More information about the cfe-commits mailing list