Skip to content

Commit

Permalink
Integrate the comments from the upstream PRs (#442)
Browse files Browse the repository at this point in the history
Clean up the Patatrack code base following the comments received during the integration into the upstream release.

Currently tracks the changes introduced due to
   - cms-sw#29109: Patatrack integration - trivial changes (1/N)
   - cms-sw#29110: Patatrack integration - common tools (2/N)

List of changes:
 * Remove unused files
 * Fix compilation warnings
 * Fix AtomicPairCounter unit test
 * Rename the cudaCompat namespace to cms::cudacompat
 * Remove extra semicolon
 * Move SimpleVector and VecArray to the cms::cuda namespace
 * Add missing dependency
 * Move HistoContainer, AtomicPairCounter, prefixScan and radixSort to the cms::cuda namespace
 * Remove rule exception for HeterogeneousCore
 * Fix code rule violations:
    - replace using namespace cms::cuda in test/OneToManyAssoc_t.h .
    - add an exception for cudaCompat.h:
      cudaCompat relies on defining equivalent symbols to the CUDA
      intrinsics in the cms::cudacompat namespace, and pulling them in the
      global namespace when compiling device code without CUDA.
* Protect the headers to compile only with a CUDA compiler
  • Loading branch information
fwyzard committed Oct 20, 2020
1 parent f27e99e commit 62cbc21
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
Expand Up @@ -48,7 +48,7 @@ namespace gpuVertexFinder {
assert(pdata);
assert(zt);

using Hist = HistoContainer<uint8_t, 256, 16000, 8, uint16_t>;
using Hist = cms::cuda::HistoContainer<uint8_t, 256, 16000, 8, uint16_t>;
__shared__ Hist hist;
__shared__ typename Hist::Counter hws[32];
for (auto j = threadIdx.x; j < Hist::totbins(); j += blockDim.x) {
Expand Down Expand Up @@ -101,7 +101,7 @@ namespace gpuVertexFinder {
nn[i]++;
};

forEachInBins(hist, izt[i], 1, loop);
cms::cuda::forEachInBins(hist, izt[i], 1, loop);
}

__syncthreads();
Expand All @@ -122,7 +122,7 @@ namespace gpuVertexFinder {
mdist = dist;
iv[i] = j; // assign to cluster (better be unique??)
};
forEachInBins(hist, izt[i], 1, loop);
cms::cuda::forEachInBins(hist, izt[i], 1, loop);
}

__syncthreads();
Expand Down Expand Up @@ -171,7 +171,7 @@ namespace gpuVertexFinder {
mdist = dist;
minJ = j;
};
forEachInBins(hist, izt[i], 1, loop);
cms::cuda::forEachInBins(hist, izt[i], 1, loop);
// should belong to the same cluster...
assert(iv[i] == iv[minJ]);
assert(nn[i] <= nn[iv[i]]);
Expand Down
Expand Up @@ -44,7 +44,7 @@ namespace gpuVertexFinder {
assert(pdata);
assert(zt);

using Hist = HistoContainer<uint8_t, 256, 16000, 8, uint16_t>;
using Hist = cms::cuda::HistoContainer<uint8_t, 256, 16000, 8, uint16_t>;
__shared__ Hist hist;
__shared__ typename Hist::Counter hws[32];
for (auto j = threadIdx.x; j < Hist::totbins(); j += blockDim.x) {
Expand Down Expand Up @@ -96,7 +96,7 @@ namespace gpuVertexFinder {
nn[i]++;
};

forEachInBins(hist, izt[i], 1, loop);
cms::cuda::forEachInBins(hist, izt[i], 1, loop);
}

__syncthreads();
Expand All @@ -118,7 +118,7 @@ namespace gpuVertexFinder {
mz = zt[j];
iv[i] = j; // assign to cluster (better be unique??)
};
forEachInBins(hist, izt[i], 1, loop);
cms::cuda::forEachInBins(hist, izt[i], 1, loop);
}

__syncthreads();
Expand Down Expand Up @@ -172,7 +172,7 @@ namespace gpuVertexFinder {
}
assert(iv[i] == iv[j]);
};
forEachInBins(hist, izt[i], 1, loop);
cms::cuda::forEachInBins(hist, izt[i], 1, loop);
}
__syncthreads();
#endif
Expand All @@ -194,7 +194,7 @@ namespace gpuVertexFinder {
mdist = dist;
iv[i] = iv[j]; // assign to cluster (better be unique??)
};
forEachInBins(hist, izt[i], 1, loop);
cms::cuda::forEachInBins(hist, izt[i], 1, loop);
}

__shared__ unsigned int foundClusters;
Expand Down
Expand Up @@ -44,7 +44,7 @@ namespace gpuVertexFinder {
assert(pdata);
assert(zt);

using Hist = HistoContainer<uint8_t, 256, 16000, 8, uint16_t>;
using Hist = cms::cuda::HistoContainer<uint8_t, 256, 16000, 8, uint16_t>;
__shared__ Hist hist;
__shared__ typename Hist::Counter hws[32];
for (auto j = threadIdx.x; j < Hist::totbins(); j += blockDim.x) {
Expand Down Expand Up @@ -97,7 +97,7 @@ namespace gpuVertexFinder {
nn[i]++;
};

forEachInBins(hist, izt[i], 1, loop);
cms::cuda::forEachInBins(hist, izt[i], 1, loop);
}

__shared__ int nloops;
Expand Down Expand Up @@ -165,7 +165,7 @@ namespace gpuVertexFinder {
mdist = dist;
iv[i] = iv[j]; // assign to cluster (better be unique??)
};
forEachInBins(hist, izt[i], 1, loop);
cms::cuda::forEachInBins(hist, izt[i], 1, loop);
}

__shared__ unsigned int foundClusters;
Expand Down
Expand Up @@ -109,7 +109,7 @@ namespace gpuVertexFinder {
loadTracks<<<numberOfBlocks, blockSize, 0, stream>>>(tksoa, soa, ws_d.get(), ptMin);
cudaCheck(cudaGetLastError());
#else
cudaCompat::resetGrid();
cms::cudacompat::resetGrid();
init(soa, ws_d.get());
loadTracks(tksoa, soa, ws_d.get(), ptMin);
#endif
Expand Down

0 comments on commit 62cbc21

Please sign in to comment.