File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 30
30
#ifndef SIMDALLOC_H_
31
31
#define SIMDALLOC_H_
32
32
33
+ #include " defs.H"
34
+
33
35
#include < cstddef>
34
36
#include < utility>
35
37
@@ -53,6 +55,8 @@ namespace simd {
53
55
* @param alignment alignment of the memory block in bytes
54
56
* @param size size of the memory block in bytes
55
57
* @return pointer to the allocated memory block
58
+ *
59
+ * @sa aligned_malloc(size_t)
56
60
*/
57
61
inline void *aligned_malloc (size_t alignment, size_t size)
58
62
{
@@ -65,6 +69,25 @@ inline void *aligned_malloc(size_t alignment, size_t size)
65
69
#endif
66
70
}
67
71
72
+ /* *
73
+ * @ingroup group_aligned_alloc
74
+ * @brief Aligned memory allocation aligned to `NATIVE_SIMD_WIDTH`.
75
+ *
76
+ * This function allocates a block of memory of size bytes, aligned to
77
+ * `NATIVE_SIMD_WIDTH`.
78
+ *
79
+ * The allocated memory must be freed with aligned_free().
80
+ *
81
+ * @param size size of the memory block in bytes
82
+ * @return pointer to the allocated memory block
83
+ *
84
+ * @sa aligned_malloc(size_t, size_t)
85
+ */
86
+ inline void *aligned_malloc (size_t size)
87
+ {
88
+ return aligned_malloc (NATIVE_SIMD_WIDTH, size);
89
+ }
90
+
68
91
/* *
69
92
* @ingroup group_aligned_alloc
70
93
* @brief Aligned memory deallocation.
You can’t perform that action at this time.
0 commit comments