slimcuda 0.7.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- slimcuda-0.7.0/PKG-INFO +140 -0
- slimcuda-0.7.0/README.md +124 -0
- slimcuda-0.7.0/pyproject.toml +36 -0
- slimcuda-0.7.0/setup.cfg +4 -0
- slimcuda-0.7.0/slimcuda/__init__.py +6 -0
- slimcuda-0.7.0/slimcuda/build/slimcuda_og.ptx +3163 -0
- slimcuda-0.7.0/slimcuda/cuda_gl_map.py +155 -0
- slimcuda-0.7.0/slimcuda/slimcuda.py +123 -0
- slimcuda-0.7.0/slimcuda/slimcuda_base.py +510 -0
- slimcuda-0.7.0/slimcuda/slimcuda_toolkit.py +75 -0
- slimcuda-0.7.0/slimcuda/src/slimcuda_og.cu +267 -0
- slimcuda-0.7.0/slimcuda/src/slimcuda_params.cu +3 -0
- slimcuda-0.7.0/slimcuda/src/slimcuda_params.cuh +20 -0
- slimcuda-0.7.0/slimcuda.egg-info/PKG-INFO +140 -0
- slimcuda-0.7.0/slimcuda.egg-info/SOURCES.txt +16 -0
- slimcuda-0.7.0/slimcuda.egg-info/dependency_links.txt +1 -0
- slimcuda-0.7.0/slimcuda.egg-info/requires.txt +7 -0
- slimcuda-0.7.0/slimcuda.egg-info/top_level.txt +1 -0
slimcuda-0.7.0/PKG-INFO
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: slimcuda
|
|
3
|
+
Version: 0.7.0
|
|
4
|
+
Summary: GPU-accelerated backend for large-scale hologram generation and SLM wavefront synthesis.
|
|
5
|
+
Author-email: jwangXTS <junlei.wang@me.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Requires-Python: >=3.10
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
Requires-Dist: numpy>=2.2
|
|
10
|
+
Requires-Dist: cupy-cuda12x<14.0,>=13.0
|
|
11
|
+
Requires-Dist: PyOpengl
|
|
12
|
+
Requires-Dist: opencv-python
|
|
13
|
+
Requires-Dist: cuda-python<13.0,>=12.4
|
|
14
|
+
Requires-Dist: glfw
|
|
15
|
+
Requires-Dist: matplotlib
|
|
16
|
+
|
|
17
|
+
# SLiM-CUDA
|
|
18
|
+
|
|
19
|
+
**SLiM-CUDA** is a GPU-accelerated backend for large-scale hologram generation and wavefront synthesis, designed for high-performance spatial light modulator (SLM) workflows.
|
|
20
|
+
|
|
21
|
+
This PyPI distribution provides a **public, compatibility-first build** intended for correctness, reproducibility, and integration. Optimized GPU-specific kernels are available separately for collaborators.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Features
|
|
26
|
+
|
|
27
|
+
- CUDA-accelerated weighted Gerchberg–Saxton (WGS)–style solvers
|
|
28
|
+
- Designed for large multi-focus hologram synthesis
|
|
29
|
+
- CuPy-based runtime integration
|
|
30
|
+
- Drop-in upgrade path for optimized kernels (no API changes)
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Installation
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
pip install slimcuda
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
This installs:
|
|
41
|
+
- PTX kernels compiled for broad GPU compatibility
|
|
42
|
+
- Corresponding CUDA source files for transparency and inspection
|
|
43
|
+
- Python-side orchestration and utilities
|
|
44
|
+
|
|
45
|
+
## Kernel Architecture & Performance Model
|
|
46
|
+
### Public PyPI build (default)
|
|
47
|
+
|
|
48
|
+
The PyPI wheel ships with:
|
|
49
|
+
- slimcuda_og.ptx
|
|
50
|
+
- Corresponding CUDA source (.cu, .cuh) files
|
|
51
|
+
|
|
52
|
+
This build prioritizes:
|
|
53
|
+
- Broad GPU compatibility
|
|
54
|
+
- Reproducibility
|
|
55
|
+
- Ease of installation
|
|
56
|
+
|
|
57
|
+
**⚠️ Performance note**
|
|
58
|
+
|
|
59
|
+
The PTX kernels are not **performance-optimized** for modern GPUs. They exist to ensure correctness and portability.
|
|
60
|
+
|
|
61
|
+
### Optimized builds (collaborators)
|
|
62
|
+
|
|
63
|
+
Highly optimized, GPU-specific kernels are distributed as **fatbin / cubin** binaries and are **not included** in the public wheel.
|
|
64
|
+
|
|
65
|
+
If an optimized kernel is present locally, SLiM-CUDA will automatically detect and load it.
|
|
66
|
+
|
|
67
|
+
Benefits:
|
|
68
|
+
- Substantially higher throughput
|
|
69
|
+
- Reduced launch overhead
|
|
70
|
+
- Architecture-specific tuning
|
|
71
|
+
|
|
72
|
+
If you are a collaborator or have a supported GPU and need optimized kernels, please contact the author.
|
|
73
|
+
|
|
74
|
+
## Runtime Banner
|
|
75
|
+
|
|
76
|
+
When running with the public PTX kernels, SLiM-CUDA displays a short informational banner indicating that an optimized build exists.
|
|
77
|
+
|
|
78
|
+
This is **informational only** and can be disabled:
|
|
79
|
+
```bash
|
|
80
|
+
# Linux / macOS
|
|
81
|
+
export SLIMCUDA_BANNER=0
|
|
82
|
+
|
|
83
|
+
# Windows (PowerShell)
|
|
84
|
+
setx SLIMCUDA_BANNER 0
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
or programmatically via the loader API.
|
|
88
|
+
|
|
89
|
+
## GPU Compatibility
|
|
90
|
+
|
|
91
|
+
- Public PTX kernels: should run on most CUDA-capable GPUs
|
|
92
|
+
- Optimized kernels: GPU- and build-specific
|
|
93
|
+
|
|
94
|
+
If you have an optimized kernel but encounter issues on your GPU, please contact the author for a tailored build.
|
|
95
|
+
|
|
96
|
+
## License
|
|
97
|
+
|
|
98
|
+
- **Python code**: MIT License
|
|
99
|
+
- **Public CUDA source (PTX / .cu)**: MIT License
|
|
100
|
+
- **Optimized CUDA binaries**: distributed separately under collaborator-specific terms
|
|
101
|
+
|
|
102
|
+
## Citation
|
|
103
|
+
|
|
104
|
+
If you use **SLiM-CUDA** in academic work, please cite the following:
|
|
105
|
+
|
|
106
|
+
### Primary citation (recommended)
|
|
107
|
+
SLiM-CUDA was originally developed to support the methodology described in:
|
|
108
|
+
|
|
109
|
+
> **Z. Qu et al.**,
|
|
110
|
+
> *Deep-learning-aided multi-focal hologram generation*,
|
|
111
|
+
> **Optics & Laser Technology**, 2025.
|
|
112
|
+
> DOI: 10.1016/j.optlastec.2024.112056
|
|
113
|
+
|
|
114
|
+
```bibtex
|
|
115
|
+
@article{jwangSlimCuda,
|
|
116
|
+
title = {Deep-learning-aided multi-focal hologram generation},
|
|
117
|
+
author = {Qu, Z. and others},
|
|
118
|
+
journal = {Optics & Laser Technology},
|
|
119
|
+
year = {2025},
|
|
120
|
+
doi = {10.1016/j.optlastec.2024.112056}
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
If your work builds upon or uses the algorithms and concepts enabled by SLiM-CUDA,
|
|
125
|
+
**please cite this publication**.
|
|
126
|
+
|
|
127
|
+
### Software citation
|
|
128
|
+
If you prefer to cite the software directly (e.g. for tooling or infrastructure use), you may cite:
|
|
129
|
+
|
|
130
|
+
> SLiM-CUDA: GPU-accelerated hologram generation backend.
|
|
131
|
+
> https://pypi.org/project/slimcuda/
|
|
132
|
+
|
|
133
|
+
A formal software citation entry (BibTeX) will be provided in a future release.
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
## Disclaimer
|
|
137
|
+
|
|
138
|
+
This software is intended for research and advanced technical use.
|
|
139
|
+
|
|
140
|
+
API stability is maintained, but internal kernel implementations may evolve.
|
slimcuda-0.7.0/README.md
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# SLiM-CUDA
|
|
2
|
+
|
|
3
|
+
**SLiM-CUDA** is a GPU-accelerated backend for large-scale hologram generation and wavefront synthesis, designed for high-performance spatial light modulator (SLM) workflows.
|
|
4
|
+
|
|
5
|
+
This PyPI distribution provides a **public, compatibility-first build** intended for correctness, reproducibility, and integration. Optimized GPU-specific kernels are available separately for collaborators.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
- CUDA-accelerated weighted Gerchberg–Saxton (WGS)–style solvers
|
|
12
|
+
- Designed for large multi-focus hologram synthesis
|
|
13
|
+
- CuPy-based runtime integration
|
|
14
|
+
- Drop-in upgrade path for optimized kernels (no API changes)
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
pip install slimcuda
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
This installs:
|
|
25
|
+
- PTX kernels compiled for broad GPU compatibility
|
|
26
|
+
- Corresponding CUDA source files for transparency and inspection
|
|
27
|
+
- Python-side orchestration and utilities
|
|
28
|
+
|
|
29
|
+
## Kernel Architecture & Performance Model
|
|
30
|
+
### Public PyPI build (default)
|
|
31
|
+
|
|
32
|
+
The PyPI wheel ships with:
|
|
33
|
+
- slimcuda_og.ptx
|
|
34
|
+
- Corresponding CUDA source (.cu, .cuh) files
|
|
35
|
+
|
|
36
|
+
This build prioritizes:
|
|
37
|
+
- Broad GPU compatibility
|
|
38
|
+
- Reproducibility
|
|
39
|
+
- Ease of installation
|
|
40
|
+
|
|
41
|
+
**⚠️ Performance note**
|
|
42
|
+
|
|
43
|
+
The PTX kernels are not **performance-optimized** for modern GPUs. They exist to ensure correctness and portability.
|
|
44
|
+
|
|
45
|
+
### Optimized builds (collaborators)
|
|
46
|
+
|
|
47
|
+
Highly optimized, GPU-specific kernels are distributed as **fatbin / cubin** binaries and are **not included** in the public wheel.
|
|
48
|
+
|
|
49
|
+
If an optimized kernel is present locally, SLiM-CUDA will automatically detect and load it.
|
|
50
|
+
|
|
51
|
+
Benefits:
|
|
52
|
+
- Substantially higher throughput
|
|
53
|
+
- Reduced launch overhead
|
|
54
|
+
- Architecture-specific tuning
|
|
55
|
+
|
|
56
|
+
If you are a collaborator or have a supported GPU and need optimized kernels, please contact the author.
|
|
57
|
+
|
|
58
|
+
## Runtime Banner
|
|
59
|
+
|
|
60
|
+
When running with the public PTX kernels, SLiM-CUDA displays a short informational banner indicating that an optimized build exists.
|
|
61
|
+
|
|
62
|
+
This is **informational only** and can be disabled:
|
|
63
|
+
```bash
|
|
64
|
+
# Linux / macOS
|
|
65
|
+
export SLIMCUDA_BANNER=0
|
|
66
|
+
|
|
67
|
+
# Windows (PowerShell)
|
|
68
|
+
setx SLIMCUDA_BANNER 0
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
or programmatically via the loader API.
|
|
72
|
+
|
|
73
|
+
## GPU Compatibility
|
|
74
|
+
|
|
75
|
+
- Public PTX kernels: should run on most CUDA-capable GPUs
|
|
76
|
+
- Optimized kernels: GPU- and build-specific
|
|
77
|
+
|
|
78
|
+
If you have an optimized kernel but encounter issues on your GPU, please contact the author for a tailored build.
|
|
79
|
+
|
|
80
|
+
## License
|
|
81
|
+
|
|
82
|
+
- **Python code**: MIT License
|
|
83
|
+
- **Public CUDA source (PTX / .cu)**: MIT License
|
|
84
|
+
- **Optimized CUDA binaries**: distributed separately under collaborator-specific terms
|
|
85
|
+
|
|
86
|
+
## Citation
|
|
87
|
+
|
|
88
|
+
If you use **SLiM-CUDA** in academic work, please cite the following:
|
|
89
|
+
|
|
90
|
+
### Primary citation (recommended)
|
|
91
|
+
SLiM-CUDA was originally developed to support the methodology described in:
|
|
92
|
+
|
|
93
|
+
> **Z. Qu et al.**,
|
|
94
|
+
> *Deep-learning-aided multi-focal hologram generation*,
|
|
95
|
+
> **Optics & Laser Technology**, 2025.
|
|
96
|
+
> DOI: 10.1016/j.optlastec.2024.112056
|
|
97
|
+
|
|
98
|
+
```bibtex
|
|
99
|
+
@article{jwangSlimCuda,
|
|
100
|
+
title = {Deep-learning-aided multi-focal hologram generation},
|
|
101
|
+
author = {Qu, Z. and others},
|
|
102
|
+
journal = {Optics & Laser Technology},
|
|
103
|
+
year = {2025},
|
|
104
|
+
doi = {10.1016/j.optlastec.2024.112056}
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
If your work builds upon or uses the algorithms and concepts enabled by SLiM-CUDA,
|
|
109
|
+
**please cite this publication**.
|
|
110
|
+
|
|
111
|
+
### Software citation
|
|
112
|
+
If you prefer to cite the software directly (e.g. for tooling or infrastructure use), you may cite:
|
|
113
|
+
|
|
114
|
+
> SLiM-CUDA: GPU-accelerated hologram generation backend.
|
|
115
|
+
> https://pypi.org/project/slimcuda/
|
|
116
|
+
|
|
117
|
+
A formal software citation entry (BibTeX) will be provided in a future release.
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
## Disclaimer
|
|
121
|
+
|
|
122
|
+
This software is intended for research and advanced technical use.
|
|
123
|
+
|
|
124
|
+
API stability is maintained, but internal kernel implementations may evolve.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=64", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "slimcuda"
|
|
7
|
+
version = "0.7.0"
|
|
8
|
+
description = "GPU-accelerated backend for large-scale hologram generation and SLM wavefront synthesis."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
authors = [
|
|
12
|
+
{ name = "jwangXTS", email = "junlei.wang@me.com" }
|
|
13
|
+
]
|
|
14
|
+
license = { text = "MIT" }
|
|
15
|
+
dependencies = [
|
|
16
|
+
"numpy>=2.2",
|
|
17
|
+
"cupy-cuda12x>=13.0,<14.0", # adjust to your CUDA version, e.g. cupy-cuda12x or cupy-cuda11x
|
|
18
|
+
"PyOpengl",
|
|
19
|
+
"opencv-python",
|
|
20
|
+
"cuda-python>=12.4,<13.0",
|
|
21
|
+
"glfw",
|
|
22
|
+
"matplotlib",
|
|
23
|
+
]
|
|
24
|
+
|
|
25
|
+
[tool.setuptools]
|
|
26
|
+
packages = ["slimcuda"]
|
|
27
|
+
include-package-data = true
|
|
28
|
+
|
|
29
|
+
[tool.setuptools.package-data]
|
|
30
|
+
# Include only the compiled binaries we care about
|
|
31
|
+
"slimcuda" = [
|
|
32
|
+
"build/*.ptx",
|
|
33
|
+
# "build/*.fatbin",
|
|
34
|
+
"src/*.cu",
|
|
35
|
+
"src/*.cuh",
|
|
36
|
+
]
|
slimcuda-0.7.0/setup.cfg
ADDED