July 2016
Beginner to intermediate
462 pages
9h 14m
English
The Numba software performs just-in-time compiling using special function decorators. The compilation produces native machine code automatically. The generated code can run on CPUs and GPUs. The main use case for Numba is math-heavy code that uses NumPy arrays.
We can compile the code with the @numba.jit decorator with optional function signature (for instance, int32(int32)). The types correspond with similar NumPy types. Numba operates in the nopython and object modes. The nopython mode is faster but more restricted. We can also release the Global Interpreter Lock (GIL) with the nogil option. You can cache the compilation results by requesting a file cache with the cache argument.
The @vectorize decorator converts ...