#ifndef __DRESIDUALFINDER_H__ #define __DRESIDUALFINDER_H__ #include #include "GPUMagneticFieldStepper.cu" typedef struct{ float3 pos_center; float3 zdir; float L_over_2; }wire_t; typedef struct{ float dist_to_wire; float dist_along_wire; float dx_muls; int status; }residual_t; // Host routines void GPUInitResidualFinder(void); // Host callable device routines __global__ void GPU_FindClosestTrajectoryPoint(int N, int M, trajectory_t *trajectories, int *wire_hit_d, int *hit_index_d); __global__ void GPU_CalcResiduals(int N, int M, trajectory_t *trajectories, int *wire_hit_d, int *hit_index_d, float *hit_dist_d, float *hit_resi_d); __global__ void GPU_CalcChiSqPerNdof(int N, int M, float *hit_resi_d, float *sum_resi_d); // Device only routines __device__ float DistToWire(state_t *step, wire_t *wire); #endif // __DRESIDUALFINDER_H__