项目
在 GitHub 查看
sdiehl/numpile
关于
A tiny 1000 line LLVM-based numeric specializer for scientific Python code.
科学与工程实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 0
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文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
探索相关项目
加载中…