Skip to content

Commit

Permalink
Renamed new endcap geometry class
Browse files Browse the repository at this point in the history
  • Loading branch information
ariostas committed Jul 8, 2024
1 parent d3e5999 commit f47212f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
14 changes: 7 additions & 7 deletions RecoTracker/LSTCore/interface/alpaka/EndcapGeometryBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

namespace SDL {

struct endcapGeom {
struct EndcapGeometryDev {
const unsigned int* geoMapDetId;
const float* geoMapPhi;

Expand All @@ -27,29 +27,29 @@ namespace SDL {
};

template <typename TDev>
struct endcapGeometryBuffer : endcapGeom {
struct EndcapGeometryBuffer : EndcapGeometryDev {
Buf<TDev, unsigned int> geoMapDetId_buf;
Buf<TDev, float> geoMapPhi_buf;

endcapGeometryBuffer(TDev const& dev, unsigned int nEndCapMap)
EndcapGeometryBuffer(TDev const& dev, unsigned int nEndCapMap)
: geoMapDetId_buf(allocBufWrapper<unsigned int>(dev, nEndCapMap)),
geoMapPhi_buf(allocBufWrapper<float>(dev, nEndCapMap)) {
setData(*this);
}

template <typename TQueue, typename TDevSrc>
inline void copyFromSrc(TQueue queue, const endcapGeometryBuffer<TDevSrc>& src) {
inline void copyFromSrc(TQueue queue, const EndcapGeometryBuffer<TDevSrc>& src) {
alpaka::memcpy(queue, geoMapDetId_buf, src.geoMapDetId_buf);
alpaka::memcpy(queue, geoMapPhi_buf, src.geoMapPhi_buf);
}

template <typename TQueue, typename TDevSrc>
endcapGeometryBuffer(TQueue queue, const endcapGeometryBuffer<TDevSrc>& src, unsigned int nEndCapMap)
: endcapGeometryBuffer(alpaka::getDev(queue), nEndCapMap) {
EndcapGeometryBuffer(TQueue queue, const EndcapGeometryBuffer<TDevSrc>& src, unsigned int nEndCapMap)
: EndcapGeometryBuffer(alpaka::getDev(queue), nEndCapMap) {
copyFromSrc(queue, src);
}

inline SDL::endcapGeom const* data() const { return this; }
inline SDL::EndcapGeometryDev const* data() const { return this; }
};

} // namespace SDL
Expand Down
6 changes: 3 additions & 3 deletions RecoTracker/LSTCore/interface/alpaka/LSTESData.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ namespace SDL {
unsigned int nPixels;
unsigned int nEndCapMap;
std::shared_ptr<const modulesBuffer<TDev>> modulesBuffers;
std::shared_ptr<const endcapGeometryBuffer<TDev>> endcapGeometryBuffers;
std::shared_ptr<const EndcapGeometryBuffer<TDev>> endcapGeometryBuffers;
std::shared_ptr<const pixelMap> pixelMapping;

LSTESData(uint16_t const& nModulesIn,
uint16_t const& nLowerModulesIn,
unsigned int const& nPixelsIn,
unsigned int const& nEndCapMapIn,
std::shared_ptr<const modulesBuffer<TDev>> const& modulesBuffersIn,
std::shared_ptr<const endcapGeometryBuffer<TDev>> const& endcapGeometryBuffersIn,
std::shared_ptr<const EndcapGeometryBuffer<TDev>> const& endcapGeometryBuffersIn,
std::shared_ptr<const pixelMap> const& pixelMappingIn)
: nModules(nModulesIn),
nLowerModules(nLowerModulesIn),
Expand All @@ -54,7 +54,7 @@ namespace cms::alpakatools {
alpaka::getDev(queue), srcData.nModules, srcData.nPixels);
deviceModulesBuffers->copyFromSrc(queue, *srcData.modulesBuffers);
auto deviceEndcapGeometryBuffers =
std::make_shared<SDL::endcapGeometryBuffer<alpaka::Dev<TQueue>>>(alpaka::getDev(queue), srcData.nEndCapMap);
std::make_shared<SDL::EndcapGeometryBuffer<alpaka::Dev<TQueue>>>(alpaka::getDev(queue), srcData.nEndCapMap);
deviceEndcapGeometryBuffers->copyFromSrc(queue, *srcData.endcapGeometryBuffers);

return SDL::LSTESData<alpaka::Dev<TQueue>>(srcData.nModules,
Expand Down
2 changes: 1 addition & 1 deletion RecoTracker/LSTCore/src/alpaka/Event.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ namespace SDL {
const unsigned int nEndCapMap_;
const std::shared_ptr<const modulesBuffer<Dev>> modulesBuffers_;
const std::shared_ptr<const pixelMap> pixelMapping_;
const std::shared_ptr<const endcapGeometryBuffer<Dev>> endcapGeometryBuffers_;
const std::shared_ptr<const EndcapGeometryBuffer<Dev>> endcapGeometryBuffers_;

public:
// Constructor used for CMSSW integration. Uses an external queue.
Expand Down
2 changes: 1 addition & 1 deletion RecoTracker/LSTCore/src/alpaka/LSTESData.dev.cc
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ std::unique_ptr<SDL::LSTESData<SDL::DevHost>> SDL::loadAndFillESHost() {
::loadMapsHost(*pLStoLayer, endcapGeometry, tiltedGeometry, moduleConnectionMap);

auto endcapGeometryBuffers =
std::make_shared<SDL::endcapGeometryBuffer<SDL::DevHost>>(cms::alpakatools::host(), endcapGeometry->nEndCapMap);
std::make_shared<SDL::EndcapGeometryBuffer<SDL::DevHost>>(cms::alpakatools::host(), endcapGeometry->nEndCapMap);
alpaka::QueueCpuBlocking queue(cms::alpakatools::host());
alpaka::memcpy(
queue, endcapGeometryBuffers->geoMapDetId_buf, endcapGeometry->geoMapDetId_buf, endcapGeometry->nEndCapMap);
Expand Down

0 comments on commit f47212f

Please sign in to comment.