Skip to content
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

Auto-generation of basic ufuncs with numba #3

Open
sklam opened this issue Mar 5, 2018 · 5 comments
Open

Auto-generation of basic ufuncs with numba #3

sklam opened this issue Mar 5, 2018 · 5 comments

Comments

@sklam
Copy link

sklam commented Mar 5, 2018

@skrah

Here're the scripts to generate a .o file with basic ufuncs supported by numba:
https://gist.github.com/sklam/977dd295324db10868542567f526ecf6

Usage:

  • python ufunc_gen.py to create umath.o.
  • run cc -shared -o umath.so umath.o.
  • test with python check_ufunc_gen.py.

See top of file comments for details like ABI and symbol mangling.

@skrah
Copy link
Member

skrah commented Mar 6, 2018

@sklam This is fantastic, thanks!

@skrah
Copy link
Member

skrah commented Mar 16, 2018

The non-strided loops work nicely here. As I understood, strided loops in the last dimension are not yet supported in Numba. How difficult would it be to add that?

For example, these tests would also pass:

https://github.com/plures/gumath/blob/master/python/test_gumath.py#L89

@sklam
Copy link
Author

sklam commented Mar 22, 2018

I thought the numba generated kernel doesn't care about the striding. It should always read the strides from the argument. Let me check.

@sklam
Copy link
Author

sklam commented Mar 22, 2018

You're right. It should be easy to fix.

@sklam
Copy link
Author

sklam commented Mar 22, 2018

I have updated the gist with a new script. There was a mistake in using the wrong stride.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants