numpile

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

Github stars Tracking Chart

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

Main metrics

Overview
Name With Ownersdiehl/numpile
Primary LanguageJupyter Notebook
Program languagePython (Language Count: 2)
Platform
License:MIT License
所有者活动
Created At2015-01-22 13:44:56
Pushed At2022-01-02 21:55:16
Last Commit At2019-11-08 17:39:21
Release Count0
用户参与
Stargazers Count409
Watchers Count15
Fork Count52
Commits Count15
Has Issues Enabled
Issues Count4
Issue Open Count3
Pull Requests Count8
Pull Requests Open Count2
Pull Requests Close Count1
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private