ImageAnalysisGPU: Minor fixes

This commit is contained in:
2025-10-04 14:21:55 +02:00
parent 5fc68b62f4
commit 4daeecdd92

View File

@@ -303,7 +303,7 @@ void GPUImageAnalysis::RunSpotFinder(const SpotFindingSettings &settings) {
// data_in is CUDA registered memory
// Run COLSPOT (GPU version)
spot_parameters spot_params;
spot_parameters spot_params{};
spot_params.strong_pixel_threshold2 = settings.signal_to_noise_threshold * settings.signal_to_noise_threshold;
spot_params.nbx = NBX;
spot_params.nby = NBX;
@@ -375,7 +375,7 @@ void GPUImageAnalysis::GetSpotFinderResults(const DiffractionExperiment &experim
}
void GPUImageAnalysis::RegisterBuffer() {
cudaHostRegister(host_in, xpixels * ypixels * sizeof(uint16_t), cudaHostRegisterDefault);
cudaHostRegister(host_in, xpixels * ypixels * sizeof(int32_t), cudaHostRegisterDefault);
}
void GPUImageAnalysis::UnregisterBuffer() {
@@ -386,5 +386,5 @@ void GPUImageAnalysis::LoadDataToGPU() {
if (host_in == nullptr)
throw JFJochException(JFJochExceptionCategory::SpotFinderError, "Host/GPU buffer not defined");
cuda_err(cudaMemcpy(gpu_in, host_in, xpixels * ypixels * sizeof(int16_t), cudaMemcpyHostToDevice));
cuda_err(cudaMemcpy(gpu_in, host_in, xpixels * ypixels * sizeof(int32_t), cudaMemcpyHostToDevice));
}