Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sdiehl/numpile
A tiny 1000 line LLVM-based numeric specializer for scientific Python code.
https://github.com/sdiehl/numpile
compiler ipython-notebook jit llvm-tutorial numba python specializer tutorial
Last synced: 25 days ago
JSON representation
A tiny 1000 line LLVM-based numeric specializer for scientific Python code.
- Host: GitHub
- URL: https://github.com/sdiehl/numpile
- Owner: sdiehl
- License: mit
- Created: 2015-01-22T13:44:56.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2022-01-02T21:55:16.000Z (almost 3 years ago)
- Last Synced: 2024-09-28T23:23:31.111Z (about 1 month ago)
- Topics: compiler, ipython-notebook, jit, llvm-tutorial, numba, python, specializer, tutorial
- Language: Jupyter Notebook
- Homepage: http://dev.stephendiehl.com/numpile/
- Size: 64.5 KB
- Stars: 403
- Watchers: 16
- Forks: 52
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Numpile
-------A tiny 1000 line LLVM-based numeric specializer for scientific Python code.
You really shouldn't use this for anything serious, it's just to demonstrate how
you might build one of these things from scratch. There's a lot of untapped
potential and low hanging fruit around *selective embedded JIT specialization*
for array expression languages in the SciPython space.Installing
----------Numpile requires ``numpy`` and ``llvmlite`` (the latter includes needed
LLVM libraries). You can either try to install them using your OS package
manager, or alternatively, using ``pip``:```bash
$ pip install llvmlite
$ pip install numpy
```Usage
-----```python
import numpy as np
from numpile import autojit@autojit
def dot(a, b):
c = 0
n = a.shape[0]
for i in range(n):
c += a[i] * b[i]
return ca = np.arange(100, 200, dtype='int32')
b = np.arange(300, 400, dtype='int32')
result = dot(a, b)
print(result)
```License
-------Released under the MIT License.
Copyright (c) 2015, Stephen Diehl