Skip to content

Commit

Permalink
Fix python performance issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Pencilcaseman committed Oct 28, 2023
1 parent 78b0e5a commit ec00f4c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 19 deletions.
25 changes: 13 additions & 12 deletions librapid/bindings/generators/arrayGenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -89,6 +89,7 @@ def generateFunctionsForArray(config):
"""
)
)

methods += [
# Shape
function.Function(
Expand Down
7 changes: 0 additions & 7 deletions librapid/include/librapid/array/arrayContainer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -779,10 +779,6 @@ namespace librapid {
auto ptr = LIBRAPID_ASSUME_ALIGNED(m_storage.begin());

#if defined(LIBRAPID_NATIVE_ARCH)
LIBRAPID_ASSERT(
reinterpret_cast<uintptr_t>(ptr) % typetraits::TypeInfo<Scalar>::packetWidth == 0,
"ArrayContainer::packet called on unaligned storage");

return xsimd::load_aligned(ptr + index);
#else
return xsimd::load_unaligned(ptr + index);
Expand All @@ -801,9 +797,6 @@ namespace librapid {
auto ptr = LIBRAPID_ASSUME_ALIGNED(m_storage.begin());

#if defined(LIBRAPID_NATIVE_ARCH)
LIBRAPID_ASSERT(
reinterpret_cast<uintptr_t>(ptr) % typetraits::TypeInfo<Scalar>::packetWidth == 0,
"ArrayContainer::packet called on unaligned storage");
value.store_aligned(ptr + index);
#else
value.store_unaligned(ptr + index);
Expand Down

0 comments on commit ec00f4c

Please sign in to comment.