Parent issue: #1673
Goal
Decide on and apply a consistent file structure pattern across all examples in both cuda_core/examples/ and cuda_bindings/examples/.
Current state
- Only 4 of 11 cuda.core examples use an
if __name__ == "__main__" guard (show_device_properties.py, jit_lto_fractal.py, strided_memory_view_gpu.py, strided_memory_view_cpu.py).
- The other 7 run all code at module level with no function wrapping.
- Description blocks vary between single-line (
"This demo illustrates how to...") and multi-line numbered bullet lists.
- Some files include
## Usage: sections with pip/python commands, others don't.
Decisions needed
- Should all examples use
if __name__ == "__main__"?
- Should code be wrapped in a
main() function or similar?
- What format should the file-level description block follow?
- Should usage instructions be included in every file?
Files affected
All 25 example files listed in #1673.
Parent issue: #1673
Goal
Decide on and apply a consistent file structure pattern across all examples in both
cuda_core/examples/andcuda_bindings/examples/.Current state
if __name__ == "__main__"guard (show_device_properties.py,jit_lto_fractal.py,strided_memory_view_gpu.py,strided_memory_view_cpu.py)."This demo illustrates how to...") and multi-line numbered bullet lists.## Usage:sections with pip/python commands, others don't.Decisions needed
if __name__ == "__main__"?main()function or similar?Files affected
All 25 example files listed in #1673.