LLVM

From YobiWiki
Revision as of 10:28, 20 May 2014 by <bdi>PhilippeTeuwen</bdi> (talk | contribs) (Created page with "==Numba== Numba is a NumPy aware dynamic compiler for Python. It creates LLVM bit-code from Python syntax and then creates a wrapper around that bitcode to call from Python. ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Numba

Numba is a NumPy aware dynamic compiler for Python. It creates LLVM bit-code from Python syntax and then creates a wrapper around that bitcode to call from Python.

pycc allows users to compile Numba functions into a shared library. The user writes the functions, exports them and the compiler will import the module, collect the exported functions and compile them to a shared library. Below is an example:

from numba import *
def mult(a, b):
    return a * b
export('mult f8(f8, f8)'))(mult)
export(['multf f4(f4, f4)', 'multi i4(i4, i4)'])(mult)
export('multc c16(c16, c16)'))(mult)