numpile

A tiny 1000 line LLVM-based numeric specializer for scientific Python code.

Github星跟踪图

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:

$ pip install llvmlite
$ pip install numpy

Usage

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 c


a = 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

主要指标

概览
名称与所有者sdiehl/numpile
主编程语言Jupyter Notebook
编程语言Python (语言数: 2)
平台
许可证MIT License
所有者活动
创建于2015-01-22 13:44:56
推送于2022-01-02 21:55:16
最后一次提交2019-11-08 17:39:21
发布数0
用户参与
星数409
关注者数15
派生数50
提交数15
已启用问题?
问题数4
打开的问题数3
拉请求数8
打开的拉请求数2
关闭的拉请求数1
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?