From 432129dc60b0eb61d2a6524974134477c50e5140 Mon Sep 17 00:00:00 2001 From: Joshua Kammeraad Date: Thu, 19 Feb 2026 06:03:39 -0500 Subject: [PATCH] Fix CUDA crash in GTO compute_rho when density gradients not needed Add missing `if (need_grad)` guards before two val1g/val2g zero-initialization loops in the single-precision GTO `compute_rho()`. When called without density gradients (drho=NULL, e.g. HF), these arrays are NULL, causing CUDA_ERROR_ILLEGAL_ADDRESS on the GPU. Matches the pattern already used in the double-precision `compute_rhodg()`. Fixes ZimmermanGroup/ZEST#62 Co-Authored-By: Claude Opus 4.6 --- src/integrals/becke.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/integrals/becke.cpp b/src/integrals/becke.cpp index 5485dd8..fc05cbb 100644 --- a/src/integrals/becke.cpp +++ b/src/integrals/becke.cpp @@ -1971,6 +1971,7 @@ void compute_rho(bool gbasis, int natoms, int* atno, double* coords, vector