aboutsummaryrefslogtreecommitdiff
path: root/src/core/cpu/buffer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/cpu/buffer.cpp')
-rw-r--r--src/core/cpu/buffer.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/cpu/buffer.cpp b/src/core/cpu/buffer.cpp
index 9125872..00d9279 100644
--- a/src/core/cpu/buffer.cpp
+++ b/src/core/cpu/buffer.cpp
@@ -89,6 +89,7 @@ void *CPUBuffer::nativeGlobalPointer() const
bool CPUBuffer::allocate()
{
size_t buf_size = p_buffer->size();
+ int retval;
if (buf_size == 0)
// Something went wrong...
@@ -97,9 +98,8 @@ bool CPUBuffer::allocate()
if (!p_data)
{
// We don't use a host ptr, we need to allocate a buffer
- p_data = std::malloc(buf_size);
-
- if (!p_data)
+ retval = posix_memalign(&p_data, 128, buf_size); // align for type double16 size.
+ if (retval)
return false;
p_data_malloced = true;