2022 Volume 7 Pages 169-173
The computation of holographic reconstruction in digital holography has been accelerated by graphics processing units (GPUs). CUDA is an extension of the C/C++ language for GPU programming and is widely used for its performance and accessibility. However, CUDA is difficult to implement for beginners due to its memory management, hardware execution unit declarations, and kernel definitions. In this study, we used CuPy, a GPU computation library for Python, to reimplement the holographic reconstruction algorithm in Python and to compare it with the CUDA implementation. The Python implementation was only 70 lines, less than a third of the CUDA implementation. In addition, holographic reconstruction on a GPU in Python was approximately 20 times faster than a CPU implemented in C++, but approximately 2.5 times slower than the execution on the GPU implemented in CUDA. Our results demonstrate the usefulness of Python with CuPy for implementing and executing image measurement processes on GPUs.