[Openmp-commits] [openmp] [OpenMP] Align up the size when calling aligned_alloc (PR #65525)

Joseph Huber via Openmp-commits openmp-commits at lists.llvm.org
Wed Sep 6 13:11:55 PDT 2023


================
@@ -21,7 +21,10 @@
 #define KMP_ALIGNED_ALLOCATE(size, alignment) _mm_malloc(size, alignment)
 #define KMP_ALIGNED_FREE(ptr) _mm_free(ptr)
 #elif KMP_HAVE_ALIGNED_ALLOC
-#define KMP_ALIGNED_ALLOCATE(size, alignment) aligned_alloc(alignment, size)
+#define KMP_ALGIN_UP(val, alignment)                                           \
+  (((val) + (alignment)-1) / (alignment) * (alignment))
----------------
jhuber6 wrote:

Is this formatted correctly?

https://github.com/llvm/llvm-project/pull/65525


More information about the Openmp-commits mailing list