The current version support building VE kernels inside the Python program. It is simple to use for simple things:
py
from veo import *
b=VeBuild()
b.set_c_source("_test", r"""
double mysum(double *a, int n)
{
int i; double sum;
for (i = 0; i < n; i++)
sum += a[i];
return sum;
}
""")
veo_name = b.build_so()
p = VeoProc(0)
lib = p.load_library(os.getcwd() + "/" + veo_name)
lib.mysum.args_type("double *", "int")
lib.mysum.ret_type("double")
Rather new is also the implicit function search. Instead of
python
f = lib.find_function("myfunc")
f.args_type("char *", "int")
req = f(ctxt, "abc", 15)
now you can do:
python
lib.myfunc.args_type("char *", "int")
req = lib.myfunc(ctxt, "abc", 15)
OnStack() now works with any variables that support the buffer protocol, so now numpy arrays can be passed on stack (IN, INOUT, OUT) to fortran VE function.
This release can also be installed from PYPI:
sh
pip install --upgrade py-veo