If torch is installed but cupy is not installed, then is_cuda_array(img) will trigger true in line 482 of src/parallelproj/backend.py but then it will fail since cp is not imported. This pull request fixes a few of these bugs and forces run on CPU if CuPy is not installed. @gschramm maybe a warning message should be added as well suggesting people install CuPy if they want GPU support?
not 100% what we want. If sth is a cuda_array (cupy array or pytorch cuda tensor), we wan to make sure the we use the "pure-GPU" mode - meaning that cupy needs to be installed. If sth is a torch CUDA tensor, but cupy is not there, it should not work / in the best cast through an exception
If
torch
is installed butcupy
is not installed, thenis_cuda_array(img)
will trigger true in line 482 ofsrc/parallelproj/backend.py
but then it will fail sincecp
is not imported. This pull request fixes a few of these bugs and forces run on CPU if CuPy is not installed. @gschramm maybe a warning message should be added as well suggesting people install CuPy if they want GPU support?