Skip to main content

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

Project description

SLiM-CUDA

PyPI Downloads

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.5.tar.gz (33.0 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.5-py3-none-any.whl (32.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: slimcuda-0.7.5.tar.gz
  • Upload date:
  • Size: 33.0 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.5.tar.gz
Algorithm Hash digest
SHA256 32a34b10f6f7030178acb0c78b664ee51266b8ffe3d31392746a5cc1c70b0424
MD5 10de2c21d0ca26369c8db859e26846c5
BLAKE2b-256 6612f57a810bb5573db07c0da01c7d8983ea5285516c93e9a144bea1bfd850e4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: slimcuda-0.7.5-py3-none-any.whl
  • Upload date:
  • Size: 32.4 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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 e50c6252b173e2bb5cfa1e6d1b16939d48f925f4aeb37d869c879e330026f70f
MD5 e8f11d465a94502c5de455b1e745d479
BLAKE2b-256 5dc9d53adee0c7a992bfd5ac89c21bcfe5b9002f2e4e776f0044f1d9e61291a7

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