We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3b5e181 commit f3cc1cbCopy full SHA for f3cc1cb
include/eigenpy/eigen-allocator.hpp
@@ -9,6 +9,8 @@
9
#include "eigenpy/map.hpp"
10
#include "eigenpy/scalar-conversion.hpp"
11
12
+#include <boost/align/is_aligned.hpp>
13
+
14
namespace eigenpy
15
{
16
@@ -228,6 +230,12 @@ namespace eigenpy
228
230
need_to_allocate |= false;
229
231
else
232
need_to_allocate |= true;
233
+ if(Options != Eigen::Unaligned) // we need to check whether the memory is correctly aligned and composed of a continuous segment
234
+ {
235
+ void * data_ptr = PyArray_DATA(pyArray);
236
+ if(!PyArray_ISONESEGMENT(pyArray) || !boost::alignment::is_aligned(data_ptr,Options))
237
+ need_to_allocate |= true;
238
+ }
239
240
void * raw_ptr = storage->storage.bytes;
241
if(need_to_allocate)
0 commit comments