Unverified Commit 94fe470c authored by Jayaram Bobba's avatar Jayaram Bobba Committed by GitHub

Merge branch 'master' into pruthvi/max_pooling

parents cbec3ad8 67c97f6a
......@@ -56,7 +56,16 @@ runtime::cpu::CPUTensorView::CPUTensorView(const ngraph::element::Type& element_
throw ngraph_error("Error allocating CPU Tensor View memory");
}
buffer = static_cast<char*>(ptr);
// GCC major versions below 5 do not implement C++11 std::align
#if !defined(__GNUC__) || __GNUC__ >= 5
std::align(BufferAlignment, buffer_size, ptr, allocation_size);
#else
ptr = static_cast<char*>(ptr) + (BufferAlignment - 1);
ptr = reinterpret_cast<void*>(reinterpret_cast<uintptr_t>(ptr) &
~(uintptr_t(BufferAlignment - 1)));
#endif
aligned_buffer = static_cast<char*>(ptr);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment