New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
exposed llvm lambdify opt_level in python api #300
Conversation
Would you mind adding a test for this flag please? It would go somewhere in https://github.com/symengine/symengine.py/blob/8909cff0f1087a6e743821b580531d5b02f04b74/symengine/tests/test_lambdify.py. |
To do this test properly, I'd have to check if the opt_level actually works, right? The only why I can think of right now would be to compair runtimes, but that doesn't seem clean to me. Do you have a better idea? Or do I just test if it doesn't throw errors? |
I would just test that the |
I currently have added |
Yes, let's make sure that passing |
So should |
Have it accept **kwargs? anf if backend=="llvm" then opt_level can be popped out of kwargs ( |
Yes, but if the backend is |
@isuruf you meant |
Yes, @bjodah's proposal sounds better to me though. |
How about this? |
That looks good, but perhaps the default should be higher than 0? (we should probably gather some benchmarks for LLVMDouble eventually) We can also check that it's given a valid value:
(or we make sure this check is done on the C++ side) |
Sure, I'll make it 3 again and write some tests.
I think the c++ side should do this check, maybe the range will change at some point. |
It currently seems like there is only a difference between |
Maybe the cost/benefit ratio depends on the type of expression? e.g. if there are many I don't remember what the story was for auto-vectorization for example. But it would be nice if such optimizations were possible (in the future), but that's off topic for this PR of course. But since I'm already digressing, this gets me thinking: I don't think LLVM comes with approximate transcendentals(?), intel's compiler has such a flag: EDIT: looks like Intel's libsvml can be used (but that's closed source), SLEEF was suggested as an open source vectorized math lib for llvm, but it doesn't look like the PR was merged. |
How do I actually run the tests? When I'm doing
While inside of this folder I also can't import symengine in ipython, it throws the same error. |
Nvm, the tests work when I'm in |
Are these tests sufficient? |
+1 from me. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That looks good, thanks!
As requested by me in symengine/symengine#1612. Do you think it look good?
@isuruf can you please merge isuruf/symengine@ac7b9bb as well?