CoalPy - Compute Abstraction Layer for Python.
Project description
coalpy
Compute abstraction layer for python.
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.
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
- Install Python supported versions ** Preferably 3.11 ** Other versions include 3.10
- Ensure you have a version of visual studio with support for VC
- Ensure you are on the latest and greatest version of windows 10
Directories
- Source - everything inside here gets compiled by the build system.
- modules - Internal c++ implementation of coalpy.
- pymodules/gpu - The Python glue code, which translates the c++ coalpy module into public functions and types ready to be used in python.
- scripts - Python scripts that get packaged with the coalpy module.
- [libpng|libjpeg|zlib|imgui] - External libraries, which are compiled in source.
- tests - Internal graphics and system test suites for coalpy, does not test the Python layer, only the internal layer.
- Build - Build scripts for the tundra build system.
- External - External precompiled libraries used.
- Tools - Executables and tools used to assist in building. In this case the tundra build system is contained here.
- docs - Documentation folder. This documentation utilizes github pages, which can be seen here
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:
- libjpeg - JPEG library by @LuaDist
- libpng - PNG library by @glennrp
- zlib - compression library by @madler
- imgui - User interface library by @ocornut
- DirectXShaderCompiler - hlsl compiler by @microsoft
Special thanks to my amazing wife Katie: I love you.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file coalpy-0.55.tar.gz
.
File metadata
- Download URL: coalpy-0.55.tar.gz
- Upload date:
- Size: 31.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 03ce136d3da3d8c0edee9b83b16351bbf24ad0ffa5d015ad4e14d22134d4c67e |
|
MD5 | 777ed1883dce45eaac0df8c03cbd8871 |
|
BLAKE2b-256 | e8c2ebd9f7a69158c1887243c69cdf1e3967e9af2ff5d43cf0c58879f2c5a2db |
File details
Details for the file coalpy-0.55-py3-none-any.whl
.
File metadata
- Download URL: coalpy-0.55-py3-none-any.whl
- Upload date:
- Size: 31.2 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0856220351b80e86f3929aebed891b48bf75dade565e4e0aaf825b491cd46d58 |
|
MD5 | ea8f568471aa96e2fccf1960204e1db8 |
|
BLAKE2b-256 | 6143e29cd4a64cc309e70b3811187b7d833c7375e2b2e4ee36643ea5080b1224 |