Skip to main content

GPU-accelerated backend for large-scale hologram generation and SLM wavefront synthesis.

Project description

SLiM-CUDA

SLiM-CUDA is a GPU-accelerated backend for large-scale hologram generation and wavefront synthesis, designed for high-performance spatial light modulator (SLM) workflows.

This PyPI distribution provides a public, compatibility-first build intended for correctness, reproducibility, and integration. Optimized GPU-specific kernels are available separately for collaborators.


Features

  • CUDA-accelerated weighted Gerchberg–Saxton (WGS)–style solvers
  • Designed for large multi-focus hologram synthesis
  • CuPy-based runtime integration
  • Drop-in upgrade path for optimized kernels (no API changes)

Installation

pip install slimcuda

This installs:

  • PTX kernels compiled for broad GPU compatibility
  • Corresponding CUDA source files for transparency and inspection
  • Python-side orchestration and utilities

Kernel Architecture & Performance Model

Public PyPI build (default)

The PyPI wheel ships with:

  • slimcuda_og.ptx
  • Corresponding CUDA source (.cu, .cuh) files

This build prioritizes:

  • Broad GPU compatibility
  • Reproducibility
  • Ease of installation

⚠️ Performance note

The PTX kernels are not performance-optimized for modern GPUs. They exist to ensure correctness and portability.

Optimized builds (collaborators)

Highly optimized, GPU-specific kernels are distributed as fatbin / cubin binaries and are not included in the public wheel.

If an optimized kernel is present locally, SLiM-CUDA will automatically detect and load it.

Benefits:

  • Substantially higher throughput
  • Reduced launch overhead
  • Architecture-specific tuning

If you are a collaborator or have a supported GPU and need optimized kernels, please contact the author.

Runtime Banner

When running with the public PTX kernels, SLiM-CUDA displays a short informational banner indicating that an optimized build exists.

This is informational only and can be disabled:

# Linux / macOS
export SLIMCUDA_BANNER=0

# Windows (PowerShell)
setx SLIMCUDA_BANNER 0

or programmatically via the loader API.

GPU Compatibility

  • Public PTX kernels: should run on most CUDA-capable GPUs
  • Optimized kernels: GPU- and build-specific

If you have an optimized kernel but encounter issues on your GPU, please contact the author for a tailored build.

License

  • Python code: MIT License
  • Public CUDA source (PTX / .cu): MIT License
  • Optimized CUDA binaries: distributed separately under collaborator-specific terms

Citation

If you use SLiM-CUDA in academic work, please cite the following:

Primary citation (recommended)

SLiM-CUDA was originally developed to support the methodology described in:

Z. Qu et al., Deep-learning-aided multi-focal hologram generation, Optics & Laser Technology, 2025. DOI: 10.1016/j.optlastec.2024.112056

@article{jwangSlimCuda,
  title   = {Deep-learning-aided multi-focal hologram generation},
  author  = {Qu, Z. and others},
  journal = {Optics & Laser Technology},
  year    = {2025},
  doi     = {10.1016/j.optlastec.2024.112056}
}

If your work builds upon or uses the algorithms and concepts enabled by SLiM-CUDA,
please cite this publication.

Software citation

If you prefer to cite the software directly (e.g. for tooling or infrastructure use), you may cite:

SLiM-CUDA: GPU-accelerated hologram generation backend.
https://pypi.org/project/slimcuda/

A formal software citation entry (BibTeX) will be provided in a future release.

Disclaimer

This software is intended for research and advanced technical use.

API stability is maintained, but internal kernel implementations may evolve.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

slimcuda-0.7.1.tar.gz (32.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

slimcuda-0.7.1-py3-none-any.whl (32.1 kB view details)

Uploaded Python 3

File details

Details for the file slimcuda-0.7.1.tar.gz.

File metadata

  • Download URL: slimcuda-0.7.1.tar.gz
  • Upload date:
  • Size: 32.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for slimcuda-0.7.1.tar.gz
Algorithm Hash digest
SHA256 9d60315b571c45e622ed208fac2ca7a408bd0c8a28dd32bb552c1d9e475c2bd1
MD5 bab5a25fe2aae7419fb8a0e5cbfe3324
BLAKE2b-256 7c813666de8f3994add794a56873e3ba7dd4d7bfa2be2d9b57d42cd6a2884325

See more details on using hashes here.

File details

Details for the file slimcuda-0.7.1-py3-none-any.whl.

File metadata

  • Download URL: slimcuda-0.7.1-py3-none-any.whl
  • Upload date:
  • Size: 32.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for slimcuda-0.7.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c7105b8834374b8ddf439a64f602d4465ccb1f6a5c84fb7ddbef8e0c1d6dcc99
MD5 a1953d78d92a8a7c0f9df483ea83b49f
BLAKE2b-256 9863c6b01f0e1aa0ccc99ae96ecc3c00d6a3a0e5817d2d10b25d07fc7a50e7e8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page