Usage:
conda create -n volcano_bench python=3.6 numba scipy tbb
conda activate volcano_bench
pip install pythran
pythran -O3 -fopenmp -march=native -DUSE_BOOST_SIMD shade_pythran.py
python driver_pythran.py
python driver_numba.py
Usage:
conda create -n volcano_bench python=3.6 numba scipy tbb
conda activate volcano_bench
pip install pythran
pythran -O3 -fopenmp -march=native -DUSE_BOOST_SIMD shade_pythran.py
python driver_pythran.py
python driver_numba.py
| // Compile with clang -S -emit-llvm -O1 main.cpp | |
| #include <cstdio> | |
| struct Apple { | |
| Apple() { | |
| puts("CTOR"); | |
| } | |
| ~Apple() { | |
| puts("DTOR"); | |
| } |
repo: https://github.com/jseppanen/azalea
Description:
Azalea is a reinterpretation of the AlphaZero game AI learning algorithm for the Hex board game.
| [ | |
| type(cc)( | |
| type(getattr(cc, next(iter(k for k in dir(cc) if k.startswith("__co")))))( | |
| *[ | |
| *lead, | |
| bytes(nums[:-1]), | |
| (None, "Hello World"), | |
| ("print",), | |
| (), | |
| "", |
This document describes the reasons for rewriting the gufunc support in numba, and it sets the goals for the rewrite.
Numba supports the creation of numpy ufunc and gufunc using the @vectorize and @guvectorize decorators, respectively. These decorators provided an easy way to create ufuncs and gufuncs without sacrificing execution performance (See Appendix 1). To use these decorators, users provide a the kernel function. For ufuncs, the kernel takes scalar arguments only. For gufuncs, the kernel takes Nd arrays.
| """ | |
| Demonstrate potential numba feature for casting an arbitrary pointer into | |
| a jitclass instance. | |
| """ | |
| from collections import OrderedDict | |
| import numpy as np | |
| from numba import njit, jitclass, types |
| from collections import namedtuple | |
| import numpy as np | |
| from numba import njit | |
| MyRec = namedtuple("MyRec", "indices,values") | |