You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is the point here to avoid the memcpy() for CPU backends? If that is the case, I think single instances of this pattern could be acceptable, but for wider use we should develop some abstraction (we have certainly discussed about it with @fwyzard, and I might have started to prototype something some time ago).
// TODO: since nHits is not used anywhere else it gives of an unused variable warning. Check!
// auto nHits = helper::nHits(tracks_view, idx);
// ALPAKA_ASSERT_OFFLOAD(nHits >= 3);
Is there something that still needs to be checked, or can this code be removed? If you want to keep the assertion, the nHits declaration could be annotated with [[maybe_unused]].
It would be great if this #ifdef could be avoided with e.g. requires_single_thread_per_block_v<TAcc>, or std::is_same_v<alpaka::Dev<TAcc>, alpaka_common::DevHost>, depending which servers to purpose better. I understand this case requires a bit more effort than one if constexpr.
I'd suggest to move this function to the same file and namespace where PixelVertexWSSoALayout is defined. I don't think it needs to be inside ALPAKA_ACCELERATOR_NAMESPACE.
This issue keeps track of the comment addressed for the PRs:
08 January 2024
Pixel Alpaka Migration: Vertexing [V] cms-sw/cmssw#41287 (comment) by @makortel
cmssw/RecoVertex/BeamSpotProducer/plugins/alpaka/BeamSpotDeviceProducer.cc
Line 36 in ff839e4
Is the point here to avoid the
memcpy()
for CPU backends? If that is the case, I think single instances of this pattern could be acceptable, but for wider use we should develop some abstraction (we have certainly discussed about it with @fwyzard, and I might have started to prototype something some time ago).Pixel Alpaka Migration: Vertexing [V] cms-sw/cmssw#41287 (comment) by @makortel
cmssw/RecoTracker/PixelVertexFinding/test/alpaka/VertexFinder_t.dev.cc
Line 1 in ff839e4
Does something here verify the results?
Pixel Alpaka Migration: Vertexing [V] cms-sw/cmssw#41287 (comment) by @makortel
cmssw/RecoTracker/PixelVertexFinding/test/alpaka/VertexFinder_t.dev.cc
Line 109 in ff839e4
Pixel Alpaka Migration: Vertexing [V] cms-sw/cmssw#41287 (comment) by @makortel
cmssw/RecoTracker/PixelVertexFinding/test/alpaka/VertexFinder_t.dev.cc
Line 84 in ff839e4
Pixel Alpaka Migration: Vertexing [V] cms-sw/cmssw#41287 (comment) by @makortel
cmssw/RecoTracker/PixelVertexFinding/plugins/alpaka/vertexFinder.h
Line 24 in ff839e4
Pixel Alpaka Migration: Vertexing [V] cms-sw/cmssw#41287 (comment) by @makortel
cmssw/RecoTracker/PixelVertexFinding/plugins/alpaka/vertexFinder.dev.cc
Line 116 in ff839e4
Pixel Alpaka Migration: Vertexing [V] cms-sw/cmssw#41287 (comment) by @makortel
cmssw/RecoTracker/PixelVertexFinding/plugins/alpaka/vertexFinder.dev.cc
Line 100 in ff839e4
Pixel Alpaka Migration: Vertexing [V] cms-sw/cmssw#41287 (comment) by @makortel
cmssw/RecoTracker/PixelVertexFinding/plugins/alpaka/vertexFinder.dev.cc
Line 74 in ff839e4
Does the FIXME need to be addressed?
Pixel Alpaka Migration: Vertexing [V] cms-sw/cmssw#41287 (comment) by @makortel
cmssw/RecoTracker/PixelVertexFinding/plugins/alpaka/vertexFinder.dev.cc
Lines 43 to 45 in ff839e4
Is there something that still needs to be checked, or can this code be removed? If you want to keep the assertion, the
nHits
declaration could be annotated with[[maybe_unused]]
.Pixel Alpaka Migration: Vertexing [V] cms-sw/cmssw#41287 (comment) by @makortel
cmssw/RecoTracker/PixelVertexFinding/plugins/alpaka/vertexFinder.dev.cc
Line 30 in ff839e4
Pixel Alpaka Migration: Vertexing [V] cms-sw/cmssw#41287 (comment) by @makortel
cmssw/RecoTracker/PixelVertexFinding/plugins/alpaka/splitVertices.h
Line 160 in ff839e4
Pixel Alpaka Migration: Vertexing [V] cms-sw/cmssw#41287 (comment) by @makortel
cmssw/RecoTracker/PixelVertexFinding/plugins/alpaka/splitVertices.h
Line 45 in ff839e4
It would be great if this
#ifdef
could be avoided with e.g.requires_single_thread_per_block_v<TAcc>
, orstd::is_same_v<alpaka::Dev<TAcc>, alpaka_common::DevHost>
, depending which servers to purpose better. I understand this case requires a bit more effort than oneif constexpr
.Pixel Alpaka Migration: Vertexing [V] cms-sw/cmssw#41287 (comment) by @makortel
cmssw/RecoTracker/PixelVertexFinding/plugins/alpaka/sortByPt2.h
Line 74 in ff839e4
Is the delegation useful wrt. just implementing the functionality here?
Pixel Alpaka Migration: Vertexing [V] cms-sw/cmssw#41287 (comment) by @makortel
cmssw/RecoTracker/PixelVertexFinding/plugins/alpaka/sortByPt2.h
Line 70 in ff839e4
Pixel Alpaka Migration: Vertexing [V] cms-sw/cmssw#41287 (comment) by @makortel
cmssw/RecoTracker/PixelVertexFinding/plugins/alpaka/sortByPt2.h
Lines 59 to 67 in ff839e4
How about
?
Or which code path would be used for a host parallel backend (e.g. TBB)?
Pixel Alpaka Migration: Vertexing [V] cms-sw/cmssw#41287 (comment) by @makortel
cmssw/RecoTracker/PixelVertexFinding/plugins/alpaka/fitVertices.h
Line 108 in ff839e4
Pixel Alpaka Migration: Vertexing [V] cms-sw/cmssw#41287 (comment) by @makortel
cmssw/RecoTracker/PixelVertexFinding/plugins/alpaka/fitVertices.h
Line 52 in ff839e4
Could be now
if (verbose && cms::alpakatools::once_per_block(acc))
Pixel Alpaka Migration: Vertexing [V] cms-sw/cmssw#41287 (comment) by @makortel
cmssw/RecoTracker/PixelVertexFinding/plugins/alpaka/clusterTracksIterative.h
Line 219 in ff839e4
Could be now
if (verbose && cms::alpakatools::once_per_block(acc))
Pixel Alpaka Migration: Vertexing [V] cms-sw/cmssw#41287 (comment) by @makortel
cmssw/RecoTracker/PixelVertexFinding/plugins/alpaka/clusterTracksIterative.h
Line 65 in ff839e4
Could be now
if (verbose && cms::alpakatools::once_per_block(acc))
Pixel Alpaka Migration: Vertexing [V] cms-sw/cmssw#41287 (comment) by @makortel
cmssw/RecoTracker/PixelVertexFinding/plugins/alpaka/clusterTracksIterative.h
Line 33 in ff839e4
Could be now
if (verbose && cms::alpakatools::once_per_block(acc))
Pixel Alpaka Migration: Vertexing [V] cms-sw/cmssw#41287 (comment) by @makortel
cmssw/RecoTracker/PixelVertexFinding/plugins/alpaka/clusterTracksIterative.h
Line 20 in ff839e4
Pixel Alpaka Migration: Vertexing [V] cms-sw/cmssw#41287 (comment) by @makortel
cmssw/RecoTracker/PixelVertexFinding/plugins/alpaka/clusterTracksByDensity.h
Line 228 in ff839e4
Pixel Alpaka Migration: Vertexing [V] cms-sw/cmssw#41287 (comment) by @makortel
cmssw/RecoTracker/PixelVertexFinding/plugins/alpaka/clusterTracksDBSCAN.h
Line 32 in ff839e4
Could be now
if (verbose && cms::alpakatools::once_per_block(acc))
Pixel Alpaka Migration: Vertexing [V] cms-sw/cmssw#41287 (comment) by @makortel
cmssw/RecoTracker/PixelVertexFinding/plugins/alpaka/clusterTracksDBSCAN.h
Line 19 in ff839e4
Pixel Alpaka Migration: Vertexing [V] cms-sw/cmssw#41287 (comment) by @makortel
cmssw/RecoTracker/PixelVertexFinding/plugins/alpaka/clusterTracksByDensity.h
Line 37 in ff839e4
Could be now
if (verbose && cms::alpakatools::once_per_block(acc))
Although given that
verbose
is constexpr, perhapswould be better to make sure the conditional code is not emitted when
verbose == false
.Pixel Alpaka Migration: Vertexing [V] cms-sw/cmssw#41287 (comment) by @makortel
cmssw/RecoTracker/PixelVertexFinding/plugins/alpaka/PixelVertexWorkSpaceUtilitiesAlpaka.h
Line 14 in ff839e4
I'd suggest to move this function to the same file and namespace where
PixelVertexWSSoALayout
is defined. I don't think it needs to be insideALPAKA_ACCELERATOR_NAMESPACE
.Pixel Alpaka Migration: Vertexing [V] cms-sw/cmssw#41287 (comment) by @makortel
cmssw/RecoTracker/PixelVertexFinding/plugins/alpaka/PixelVertexProducerAlpaka.cc
Line 47 in ff839e4
I think the comment would make much sense.
Pixel Alpaka Migration: Vertexing [V] cms-sw/cmssw#41287 (comment) by @makortel
cmssw/RecoTracker/PixelVertexFinding/plugins/alpaka/PixelVertexProducerAlpaka.cc
Lines 76 to 77 in ff839e4
These could be part of the member initializer list.
Pixel Alpaka Migration: Vertexing [V] cms-sw/cmssw#41287 (comment) by @makortel
cmssw/RecoTracker/PixelVertexFinding/plugins/alpaka/PixelVertexProducerAlpaka.cc
Lines 5 to 7 in ff839e4
Pixel Alpaka Migration: Vertexing [V] cms-sw/cmssw#41287 (comment) by @makortel
cmssw/RecoTracker/PixelVertexFinding/plugins/alpaka/PixelVertexProducerAlpaka.cc
Line 10 in ff839e4
Pixel Alpaka Migration: Vertexing [V] cms-sw/cmssw#41287 (comment) by @makortel
cmssw/RecoTracker/PixelVertexFinding/plugins/PixelVertexProducerFromSoAAlpaka.cc
Lines 9 to 10 in ff839e4
Pixel Alpaka Migration: Vertexing [V] cms-sw/cmssw#41287 (comment) by @makortel
cmssw/RecoTracker/PixelVertexFinding/plugins/PixelVertexWorkSpaceSoAHostAlpaka.h
Line 10 in ff839e4
How about just using the
PortableHostCollection<PixelVertexWSSoALayout<>>
directly?Pixel Alpaka Migration: Vertexing [V] cms-sw/cmssw#41287 (comment) by @makortel
cmssw/RecoTracker/PixelVertexFinding/plugins/PixelVertexWorkSpaceLayout.h
Lines 19 to 20 in ff839e4
Repeating "Workspace" in the namespace and class names feels redundant.
Also, I think it would be better to define the layout and these type aliases in the same namespace.
Pixel Alpaka Migration: Vertexing [V] cms-sw/cmssw#41287 (comment) by @makortel
cmssw/RecoTracker/PixelVertexFinding/plugins/PixelVertexWorkSpaceLayout.h
Line 1 in ff839e4
Given this file is included in other places than
plugins
, move it tointerface
.Pixel Alpaka Migration: Vertexing [V] cms-sw/cmssw#41287 (comment) by @makortel
cmssw/RecoTracker/PixelVertexFinding/plugins/PixelVertexProducerFromSoAAlpaka.cc
Line 1 in ff839e4
Can the
Alpaka
postfix be dropped after the CUDA modules have been removed?Pixel Alpaka Migration: Vertexing [V] cms-sw/cmssw#41287 (comment) by @makortel
cmssw/RecoTracker/PixelVertexFinding/plugins/PixelVertexProducerFromSoAAlpaka.cc
Line 24 in ff839e4
Where is this macro defined if it needs to be undefined here?
Pixel Alpaka Migration: Vertexing [V] cms-sw/cmssw#41287 (comment) by @makortel
cmssw/RecoTracker/PixelVertexFinding/plugins/BuildFile.xml
Line 12 in ff839e4
This dependence seems specific to
RecoPixelVertexingPixelVertexFindingPluginsPortable
, so move it there.On the other hand, dependence to
DataFormats/Vertex
seems to be missing (if the separate package is kept).Pixel Alpaka Migration: Vertexing [V] cms-sw/cmssw#41287 (comment) by @makortel
cmssw/RecoTracker/PixelVertexFinding/plugins/BuildFile.xml
Line 11 in ff839e4
Pixel Alpaka Migration: Vertexing [V] cms-sw/cmssw#41287 (comment) by @makortel
cmssw/RecoTracker/PixelVertexFinding/plugins/BuildFile.xml
Lines 22 to 23 in ff839e4
Move these two to be specific to
RecoPixelVertexingPixelVertexFindingPluginsPortable
Pixel Alpaka Migration: Vertexing [V] cms-sw/cmssw#41287 (comment) by @makortel
cmssw/RecoTracker/PixelVertexFinding/plugins/BuildFile.xml
Lines 14 to 15 in ff839e4
Move these two to be spcific to
RecoPixelVertexingPixelVertexFindingPlugins
Pixel Alpaka Migration: Vertexing [V] cms-sw/cmssw#41287 (comment) by @makortel
cmssw/DataFormats/Vertex/test/alpaka/ZVertexSoA_test.dev.cc
Line 59 in ff839e4
Can this line be uncommented?
Pixel Alpaka Migration: Vertexing [V] cms-sw/cmssw#41287 (comment) by @makortel
cmssw/DataFormats/Vertex/test/alpaka/ZVertexSoA_test.dev.cc
Line 21 in ff839e4
Is it intentional to fill the entries beyong
nvFinal()
?Pixel Alpaka Migration: Vertexing [V] cms-sw/cmssw#41287 (comment) by @makortel
cmssw/DataFormats/Vertex/src/classes_def.xml
Lines 4 to 14 in ff839e4
How about using the
SET_PORTABLEHOSTCOLLECTION_READ_RULES()
macro?Pixel Alpaka Migration: Vertexing [V] cms-sw/cmssw#41287 (comment) by @makortel
cmssw/DataFormats/Vertex/interface/alpaka/ZVertexSoACollection.h
Line 1 in ff839e4
This file defined
ZVertexCollection
type alias, soZVertexCollection
would seem more consistent file name.Pixel Alpaka Migration: Vertexing [V] cms-sw/cmssw#41287 (comment) by @makortel
cmssw/DataFormats/Vertex/interface/alpaka/ZVertexUtilities.h
Line 15 in ff839e4
I'd suggest to move this function to the file and namespace where
ZVertexSoAHeterogeneousLayout<>
is defined.Pixel Alpaka Migration: Vertexing [V] cms-sw/cmssw#41287 (comment) by @makortel
cmssw/DataFormats/Vertex/interface/alpaka/ZVertexUtilities.h
Lines 11 to 13 in ff839e4
These type aliases are already available in
zVertex
namespace.Pixel Alpaka Migration: Vertexing [V] cms-sw/cmssw#41287 (comment) by @makortel
cmssw/DataFormats/Vertex/interface/alpaka/ZVertexSoACollection.h
Lines 17 to 21 in ff839e4
How about
std::conditional_v
? (although ifPortableCollection
would be used directly, these would not be needed)Pixel Alpaka Migration: Vertexing [V] cms-sw/cmssw#41287 (comment) by @makortel
cmssw/DataFormats/Vertex/interface/ZVertexSoADevice.h
Lines 12 to 13 in ff839e4
Pixel Alpaka Migration: Vertexing [V] cms-sw/cmssw#41287 (comment) by @makortel
cmssw/DataFormats/Vertex/interface/ZVertexLayout.h
Lines 19 to 21 in ff839e4
The zvertex in both the namespace and the class names feels redundant.
Also, I think it would be better to define the
ZVertexSoAHeterogeneousLayout
and these type aliases in the same namespace.Pixel Alpaka Migration: Vertexing [V] cms-sw/cmssw#41287 (comment) by @makortel
cmssw/DataFormats/Vertex/interface/ZVertexSoADevice.h
Line 16 in ff839e4
I'd suggest to move to use the
PortableDeviceCollection<zVertex::ZVertexSoALayout>
directly. Or is the size being in the type somehow important?Same for the host collection.
Pixel Alpaka Migration: Vertexing [V] cms-sw/cmssw#41287 (comment) by @makortel
cmssw/DataFormats/Vertex/interface/ZVertexLayout.h
Line 7 in ff839e4
Is the
Heterogeneous
needed in the name?Should the layout be defined in a namespace, e.g.
reco
?Pixel Alpaka Migration: Vertexing [V] cms-sw/cmssw#41287 (comment) by @makortel
cmssw/DataFormats/Vertex/interface/ZVertexLayout.h
Line 4 in ff839e4
Pixel Alpaka Migration: Vertexing [V] cms-sw/cmssw#41287 (comment) by @makortel
cmssw/DataFormats/Vertex/README.md
Line 1 in ff839e4
All CUDA-isms should in the README should be converted to Alpaka.
Pixel Alpaka Migration: Vertexing [V] cms-sw/cmssw#41287 (comment) by @makortel
cmssw/DataFormats/Vertex/BuildFile.xml
Line 1 in ff839e4
Also here I'd ask if a new package is really needed, or if the existing
DataFormats/VertexReco
could be used.If a separate package is kept, how about
VertexSoA
to be more consistent with the other (possibly) new packages with*SoA
name?The text was updated successfully, but these errors were encountered: