From ec00f4c55bd8962cc22037c8a66db0deee37317a Mon Sep 17 00:00:00 2001 From: Toby Davis Date: Sat, 28 Oct 2023 14:55:11 +0100 Subject: [PATCH] Fix python performance issue --- .../bindings/generators/arrayGenerator.py | 25 ++++++++++--------- .../include/librapid/array/arrayContainer.hpp | 7 ------ 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/librapid/bindings/generators/arrayGenerator.py b/librapid/bindings/generators/arrayGenerator.py index bb4dc367..11c7f89b 100644 --- a/librapid/bindings/generators/arrayGenerator.py +++ b/librapid/bindings/generators/arrayGenerator.py @@ -52,18 +52,18 @@ def generateFunctionsForArray(config): ] ), - # # Move constructor - # function.Function( - # name="__init__", - # args=[ - # argument.Argument( - # name="other", - # type=generateCppArrayType(config), - # move=True - # ) - # ] - # ) - ], + # Move constructor + function.Function( + name="__init__", + args=[ + argument.Argument( + name="other", + type=generateCppArrayType(config), + move=True + ) + ] + ) + ] # Static fromData (n dimensions) for n in range(1, 9): @@ -89,6 +89,7 @@ def generateFunctionsForArray(config): """ ) ) + methods += [ # Shape function.Function( diff --git a/librapid/include/librapid/array/arrayContainer.hpp b/librapid/include/librapid/array/arrayContainer.hpp index cd0c9cdb..36580446 100644 --- a/librapid/include/librapid/array/arrayContainer.hpp +++ b/librapid/include/librapid/array/arrayContainer.hpp @@ -779,10 +779,6 @@ namespace librapid { auto ptr = LIBRAPID_ASSUME_ALIGNED(m_storage.begin()); #if defined(LIBRAPID_NATIVE_ARCH) - LIBRAPID_ASSERT( - reinterpret_cast(ptr) % typetraits::TypeInfo::packetWidth == 0, - "ArrayContainer::packet called on unaligned storage"); - return xsimd::load_aligned(ptr + index); #else return xsimd::load_unaligned(ptr + index); @@ -801,9 +797,6 @@ namespace librapid { auto ptr = LIBRAPID_ASSUME_ALIGNED(m_storage.begin()); #if defined(LIBRAPID_NATIVE_ARCH) - LIBRAPID_ASSERT( - reinterpret_cast(ptr) % typetraits::TypeInfo::packetWidth == 0, - "ArrayContainer::packet called on unaligned storage"); value.store_aligned(ptr + index); #else value.store_unaligned(ptr + index);