diff --git a/image_analysis/bragg_prediction/BraggPredictionRotGPU.cu b/image_analysis/bragg_prediction/BraggPredictionRotGPU.cu index 46968ddf..5a0ed52e 100644 --- a/image_analysis/bragg_prediction/BraggPredictionRotGPU.cu +++ b/image_analysis/bragg_prediction/BraggPredictionRotGPU.cu @@ -286,7 +286,8 @@ int BraggPredictionRotGPU::Calc(const DiffractionExperiment &experiment, cudaMemcpyAsync(dK, &hK, sizeof(KernelConstsRot), cudaMemcpyHostToDevice, stream); cudaMemsetAsync(d_count, 0, sizeof(int), stream); - const int range = 2 * settings.max_hkl; + // Inclusive on both ends, matching the kernel's own range and the CPU loop (-max_hkl .. +max_hkl). + const int range = 2 * settings.max_hkl + 1; dim3 block(8, 8, 8); dim3 grid((range + block.x - 1) / block.x, (range + block.y - 1) / block.y,