Different values for Eigen::VectorXd
(autocasted to np.ndarray
in Python) after at least two function calls
#427
Unanswered
MartinRJDagleish
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Why use nd-arrays for some arguments and Eigen arrays for others? For the serial version, you aren't specifying any contiguity constraints—have you considered that the arrays might not be dense in memory? For the parallel version, have you tested correctness of the parallelization outside of nanobind? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey,
I am currently trying to write a few tests and to speed-up a few Python functions. As I do not need a full convolution and I tend to cut away a large portion, I wanted to test, if I could use my OpenMP "knowledge" to write a fast parallel version that would instead do less computation and return the array with the correct size already.
This has multiple problems:
const
does not helpviews
do not change or help in this (tried that)Eigen::VectorXd
in both the serial and the parallel function version.I tried to check if different objects in memory were created, which "seemed" to happen (see
test_script.py
).My C++ code extracted:
test_script.py
:Plot for reference:
Order: par, ser, ref
Order: ser, par, ref
Order: ref, ser, par
Order: ref, ser, par, ser, par (more computation, make the results grow; although the previous should be overwritten)
Beta Was this translation helpful? Give feedback.
All reactions