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

Uploaded Python 3

File details

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

File metadata

  • Download URL: slimcuda-0.7.4.tar.gz
  • Upload date:
  • Size: 32.9 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.4.tar.gz
Algorithm Hash digest
SHA256 1a5d571b019d3506f98343737f27bc9f4ffb786f0b4af545d278efbb99ce9c19
MD5 a38b427daffe52921acc874957b69373
BLAKE2b-256 c5ba6b6fa83ac940823d41fb6b2d7a8f23a9249f50bfec0150daa656c98b9367

See more details on using hashes here.

File details

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

File metadata

  • Download URL: slimcuda-0.7.4-py3-none-any.whl
  • Upload date:
  • Size: 32.3 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 9e35130ba0b7fa5ed2e54aeae035f52e0c7cff82b400561b1b99c7857b75fc3d
MD5 ae14b401fed1559db11d677042163058
BLAKE2b-256 4be4ccd06c9cfc54d130cd58cf72c5158e2aefa73bcb540e69c0bd43dc71efce

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