RSS blog page - 1/1 Blog C++ (3)

blog page - 1/1

Issues with installation from source on Windows


The installation may fail on Windows when the model is compiled from the source. I could not find a particular reason. It works when numpy is uninstalled before running pip install cpyquickhelper. Otherwise, this is the kind of error which appear:


cppyy: a new module for to C++ in python


I did not try but the approach seems interesting and less verbose than any others. cppyy uses cling to extend Python code with C++ code during the execution. The tutorial contains the following example:


Mixing pybind11 modules


My scenario was the following: expose a C++ class in one C++ module exported with pybind11, then create a function in a another C++ module returning a result of this class. The solution for that is described in the following issue Return type that is implemented in another library with another set of python bindings, which links to this part of the documentation Custom type casters. and implemented in this module somewhere in cbenchmark_dot.cpp.




I wanted to test some facts described in the following blog post: Why is it faster to process a sorted array than an unsorted array?. I ended it writing this notebook Measures branching in C++ from python which compares a couple of implementations of the same computation, a dot product.


Cython, Pythran, nuitka, numba


I discovered than Pythran was now a possible backend for Cython: Pythran as a Numpy backend. On one benchmark, it increases the speed by 2. I recommend the reading of the following article: Optimizing your code with NumPy, Cython, pythran and numba which instigates the performance brought by the four following tool and gives some hints on how to write efficient code with these tools:


Exploration with pybind11 and ExtensionArray


I tried the version of pybind11 to expose a dummy C++ object WeightedDouble, to implement a couple of operators and to see how it behaves into a dataframe.


Call C# from Python


A couple of questions must be answers to do that.


RSS blog page - 1/1 2018-08 (2) 2019-02 (1) 2019-03 (1) 2019-09 (1) 2021-01 (1)