From 19a60eb008f096248ac325fbbbb6c36af511284e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20And=C3=A9n?= Date: Tue, 15 Oct 2024 22:30:00 +0200 Subject: [PATCH] cuda: fix error handling for setup_binsize We don't want to set `ier` to the CUDA error since it will be passed on to the user. --- include/cufinufft/impl.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/cufinufft/impl.h b/include/cufinufft/impl.h index c4dd67824..a603b1801 100644 --- a/include/cufinufft/impl.h +++ b/include/cufinufft/impl.h @@ -178,7 +178,8 @@ int cufinufft_makeplan_impl(int type, int dim, int *nmodes, int iflag, int ntran } cufinufft_setup_binsize(type, d_plan->spopts.nspread, dim, &d_plan->opts); - if (ier = cudaGetLastError(), ier != cudaSuccess) { + if (cudaGetLastError() != cudaSuccess) { + ier = FINUFFT_ERR_CUDA_FAILURE; goto finalize; } if (d_plan->opts.debug) {