Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix number of floats per hit #321

Merged
merged 1 commit into from
Apr 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ void PixelTrackReconstructionGPU::run(TracksWithTTRHs& tracks,
// We use 3 floats for GlobalPosition and 6 floats for GlobalError (that's what is used by the Riemann fit).
// Assume a safe maximum of 3K seeds: it will dynamically grow, if needed.
int total_seeds = 0;
hits_and_covariances.reserve(sizeof(float)*3000*(points_in_seed*12));
hits_and_covariances.reserve(sizeof(float)*3000*(points_in_seed*9));
for (auto const & regionHitSets : hitSets) {
const TrackingRegion& region = regionHitSets.region();
for (auto const & tuplet : regionHitSets) {
Expand Down Expand Up @@ -112,7 +112,7 @@ void PixelTrackReconstructionGPU::run(TracksWithTTRHs& tracks,
sizeof(float)*hits_and_covariances.size(), cudaMemcpyDefault));

// LAUNCH THE KERNEL FIT
launchKernelFit(hits_and_covariancesGPU, 12*4*total_seeds, 4,
launchKernelFit(hits_and_covariancesGPU, 9*4*total_seeds, 4,
bField, helix_fit_resultsGPU);
// CUDA MEMCOPY DEVICE2HOST OF HELIX_FIT
cudaCheck(cudaDeviceSynchronize());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ KernelFastFitAllHits(float *hits_and_covariances,
// Loop for hits_in_fit times:
// first 3 are the points
// the rest is the covariance matrix, 3x3
int start = (blockIdx.x * blockDim.x + threadIdx.x) * hits_in_fit * 12;
int start = (blockIdx.x * blockDim.x + threadIdx.x) * hits_in_fit * 9;
int helix_start = (blockIdx.x * blockDim.x + threadIdx.x);
if (start >= cumulative_size) {
return;
Expand Down Expand Up @@ -67,7 +67,7 @@ KernelCircleFitAllHits(float *hits_and_covariances, int hits_in_fit,
// Loop for hits_in_fit times:
// first 3 are the points
// the rest is the covariance matrix, 3x3
int start = (blockIdx.x * blockDim.x + threadIdx.x) * hits_in_fit * 12;
int start = (blockIdx.x * blockDim.x + threadIdx.x) * hits_in_fit * 9;
int helix_start = (blockIdx.x * blockDim.x + threadIdx.x);
if (start >= cumulative_size) {
return;
Expand Down Expand Up @@ -115,7 +115,7 @@ KernelLineFitAllHits(float *hits_and_covariances, int hits_in_fit,
// Loop for hits_in_fit times:
// first 3 are the points
// the rest is the covariance matrix, 3x3
int start = (blockIdx.x * blockDim.x + threadIdx.x) * hits_in_fit * 12;
int start = (blockIdx.x * blockDim.x + threadIdx.x) * hits_in_fit * 9;
int helix_start = (blockIdx.x * blockDim.x + threadIdx.x);
if (start >= cumulative_size) {
return;
Expand Down Expand Up @@ -162,8 +162,8 @@ void PixelTrackReconstructionGPU::launchKernelFit(
float B, Rfit::helix_fit *results)
{
const dim3 threads_per_block(32, 1);
int num_blocks = cumulative_size / (hits_in_fit * 12) / threads_per_block.x + 1;
auto numberOfSeeds = cumulative_size / (hits_in_fit * 12);
int num_blocks = cumulative_size / (hits_in_fit * 9) / threads_per_block.x + 1;
auto numberOfSeeds = cumulative_size / (hits_in_fit * 9);

Rfit::Matrix3xNd<4> *hitsGPU;
cudaCheck(cudaMalloc(&hitsGPU, 48 * numberOfSeeds * sizeof(Rfit::Matrix3xNd<4>)));
Expand Down