From aa50e60f3c1c674bbe03febf59a0644f076bb486 Mon Sep 17 00:00:00 2001 From: leonarski_f Date: Sun, 7 Jun 2026 14:00:33 +0200 Subject: [PATCH] AzIntEngineGPU: Check CUDA errors in constructor cudaGetDeviceProperties and the two host-to-device cudaMemcpy calls in the constructor were not error-checked, unlike the calls in Run(). Wrap them in cuda_err() so failures throw instead of passing silently. Co-Authored-By: Claude Opus 4.8 --- image_analysis/azint/AzIntEngineGPU.cu | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/image_analysis/azint/AzIntEngineGPU.cu b/image_analysis/azint/AzIntEngineGPU.cu index 132f9761..dfd59e32 100644 --- a/image_analysis/azint/AzIntEngineGPU.cu +++ b/image_analysis/azint/AzIntEngineGPU.cu @@ -101,17 +101,17 @@ AzIntEngineGPU::AzIntEngineGPU(const AzimuthalIntegrationMapping &integration, s cpu_count_reg(azint_count) { cudaDeviceProp prop{}; - cudaGetDeviceProperties(&prop, 0); + cuda_err(cudaGetDeviceProperties(&prop, 0)); threads = 128; blocks = 4 * prop.multiProcessorCount; shared_size = prop.sharedMemPerBlock; shared_needed = azint_bins * (2 * sizeof(float) + sizeof(uint32_t)); - cudaMemcpy(gpu_azint_correction, integration.Corrections().data(), sizeof(float) * npixel, - cudaMemcpyHostToDevice); - cudaMemcpy(gpu_pixel_to_bin, integration.GetPixelToBin().data(), sizeof(uint16_t) * npixel, - cudaMemcpyHostToDevice); + cuda_err(cudaMemcpy(gpu_azint_correction, integration.Corrections().data(), sizeof(float) * npixel, + cudaMemcpyHostToDevice)); + cuda_err(cudaMemcpy(gpu_pixel_to_bin, integration.GetPixelToBin().data(), sizeof(uint16_t) * npixel, + cudaMemcpyHostToDevice)); } void AzIntEngineGPU::Run(const ImagePreprocessorBuffer &image, AzimuthalIntegrationProfile &profile) {