[PATCH] D16638: [CUDA] Added device-side std::{malloc/free}

Justin Lebar via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 27 11:18:28 PST 2016


jlebar accepted this revision.
This revision is now accepted and ready to land.

================
Comment at: lib/Headers/__clang_cuda_cmath.h:222
@@ +221,3 @@
+__DEVICE__ void free(void *__ptr) { return ::free(__ptr); }
+__DEVICE__ void *malloc(size_t __size) { return ::malloc(__size); }
+
----------------
Not really math stuff; maybe they should live in the main header?

================
Comment at: lib/Headers/__clang_cuda_runtime_wrapper.h:172
@@ -171,1 +171,3 @@
 
+// We also need extern "C" decls for device-side allocator functions.
+extern "C" __device__ void free(void *__ptr);
----------------
Perhaps add a comment explaining where these are implemented?


http://reviews.llvm.org/D16638





More information about the cfe-commits mailing list