PyNeblina and neblina-core
Neblina is a programming language that abstracts the underlying GPU to the user through OpenCL. The reader can find more information here.
However, maintaining a complete programming language demands too much work, so we decided to extract its math functions to create a library and then wrap this library, exposing it to Python.
The strategy was to use the same function names used for Neblina but through an import. It is also necessary to have Gtest (Google’s C++ unit test framework) and OpenCL installed on the system (either for a GPU or for your CPU).
To use the library, the reader needs to clone two GitHub repositories:
- https://github.com/paulomotta/neblina-core
- https://github.com/paulomotta/pyneblina
The ideal configuration is to have both folders at the same level (this is going to be necessary for the Python setup/install)
Before continuing, it is necessary to have the google test framework installed on your system, for Ubuntu you will need the following command:
apt-get install libgtest-dev
Once cloned, move inside the neblina-core folder and execute:
cmake .
make
sudo make install
./neblina-core_test
These commands will generate the Makefile, compile the library and execute the unit tests.
After that, you can move to the pyneblina folder and run:
sudo python3 setup.py install
This command will compile the Python extension and create a shared library to be used. It will be installed on your system.
To run the Python tests, you may execute:
python3 test.py