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
派生數52
提交數15
已啟用問題?
問題數4
打開的問題數3
拉請求數8
打開的拉請求數2
關閉的拉請求數1
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?