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.0.tar.gz (32.3 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.0-py3-none-any.whl (32.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: slimcuda-0.7.0.tar.gz
  • Upload date:
  • Size: 32.3 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.0.tar.gz
Algorithm Hash digest
SHA256 720fd7e9cc6d15c5187c0d0ae3b5d2f67e8529c805b1c8f47667190f545fc33d
MD5 8c951cfb5c10746f593d79c5011af5b4
BLAKE2b-256 69154049acc7c4421266e41dc407d6a7c0ebb60947c90345ea9b4ce7b49086ea

See more details on using hashes here.

File details

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

File metadata

  • Download URL: slimcuda-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 32.0 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1af63f4a8f49f41d68e0f08416720b69678b42d10145458e46b0722b6c98a5fa
MD5 cdf9b0109e2e7a0ea3ba29f0310de246
BLAKE2b-256 c637c5a5d53798461a798b8d2325f4f33d05b32f3026052b4bdba5843d361e9c

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