Working with Anaconda, CuPy, and Numba for GPUs

Continuing with our hands-on experience, we now focus on our most important chapter, about using Python-only code, which essentially simplifies the GPU computing approach. We will revisit Anaconda and after a short reintroduction including Miniconda, we will begin our exploration by looking into it with a GPU computing perspective. In particular, CuPy and Numba will be covered to highlight the significance of Python-only syntax for GPU computing. We will carry out the same by seamlessly restructuring our earlier examples in a much simpler manner through CuPy and Numba.

Python programming enthusiasts will be encouraged to invoke NVIDIA GPUs within their program code with CuPy and CUDA-enabled Numba, while also not excluding AMD GPU users from experimenting with ROCm-enabled Numba. We start with gaining an understanding of how a CuPy program works by recalling our first conventional Python program and then comparing the same program structure with that of CuPy. Following this, we continue the chapter with computing via CUDA and ROCm-enabled Numba on Python.We focus on the applicability preference of CuPy and Numba over traditional NumPy, pertaining to the extremely similar, but more powerful, Python syntax.

The following topics will be covered in the chapter: