Home

Awesome

coalpy

Compute abstraction layer for python.

License: MIT Build Status

CoalPy is a free low friction python (3.10, 3.11) native module for Windows and Linux. Coalpy's main goal is to make modern DirectX12 or Vulkan GPU compute software easy to write and deploy.

seascape_example

Python module

Get started with API documentation here: coalpy.gpu documentation

To install, just run the pip command:

pip install coalpy

To check that coalpy is installed properly run the seascape example:

python -m coalpy.examples.seascape

And presto!

About Contributing

The following section specifies guidelines for contributing to the coalpy project.

Building requirements

Directories

Compiling in Windows

To compile in Windows, use the build.bat script file:

build.bat debug

for release mode

build.bat release

To generate a solution for visual studio, use the gensln.bat script:

gensln.bat

To run the internal c++ tests, run the coalpy_tests.exe program generated:

t2-output\win64-msvc-debug-default\coalpy_tests.exe

For information about the test suites commands, such as filters / repeating tests etc use the -h flag.

Compiling in Linux (Ubuntu 20.x LTS+)

Before compiling into linux, the necessary dependencies must be installed. For ubuntu apt package manager, you can run the script:

sudo ./linux-deps.sh

Then proceed to install vulkan lunar SDK as assigned below.

Vulkan Lunar SDK

Follow this by installing vulkan lunar SDK: vulkan lunar SDK

Compiling for Linux

To compile for Linux, use the build.sh script file:

./build.sh debug

for release mode

./build.sh release

Creating Python package

cd into the t2-output\win64-msvc-[debug|release]-default\coalpy_pip directory. Run the command:

python -m build

Ensure you have the latest version of the build module. To configure metadata of the pip package modify things inside the Source/pipfiles folder.

Updating documentation

All documentation of the coalpy Python API is self contained inside the Source/pymodules/gpu folder. Inside we fill doc strings inside types and functions exported to Python. To generate the documentation, cd into the t2-output/win64-msvc-[release|debug|production]-default folder, and run the commands:

python -m pydoc -w coalpy
python -m pydoc -w coalpy.gpu

This will generate coalpy.html and coalpy.gpu.html which can be copied into the docs directory.

Credits

Coalpy utilizes a few great open source libraries. Links with the authors and source provided here:

Special thanks to my amazing wife Katie: I love you.