14 #include "../Utilities/Arrays.hpp"
18 #include <CL/sycl.hpp>
25 #include "vecmem/containers/data/vector_view.hpp"
26 #include "vecmem/containers/device_vector.hpp"
28 namespace Acts::Sycl::detail {
31 template <SpacePo
intType OtherSPType>
34 static_assert((OtherSPType == SpacePointType::Bottom) ||
35 (OtherSPType == SpacePointType::Top),
36 "Class must be instantiated with either "
37 "Acts::Sycl::detail::SpacePointType::Bottom or "
38 "Acts::Sycl::detail::SpacePointType::Top");
43 vecmem::data::vector_view<const DeviceSpacePoint> middleSPs,
44 vecmem::data::vector_view<const DeviceSpacePoint> otherSPs,
45 vecmem::data::vector_view<uint32_t> middleIndexLUT,
46 vecmem::data::vector_view<uint32_t> otherIndexLUT, uint32_t nEdges,
47 vecmem::data::vector_view<detail::DeviceLinEqCircle> resultArray)
58 const auto idx = item.get_global_linear_id();
68 const uint32_t middleIndex = middleIndexLUT[
idx];
72 const uint32_t otherIndex = otherIndexLUT[
idx];
79 const vecmem::device_vector<const DeviceSpacePoint> middleSPs(
m_middleSPs);
81 const vecmem::device_vector<const DeviceSpacePoint> otherSPs(
m_otherSPs);
86 const float cosPhiM = middleSP.
x / middleSP.
r;
87 const float sinPhiM = middleSP.
y / middleSP.
r;
89 const float deltaX = otherSP.
x - middleSP.
x;
90 const float deltaY = otherSP.
y - middleSP.
y;
91 const float deltaZ = otherSP.
z - middleSP.
z;
93 const float x = deltaX * cosPhiM + deltaY * sinPhiM;
94 const float y = deltaY * cosPhiM - deltaX * sinPhiM;
95 const float iDeltaR2 = 1.f / (deltaX * deltaX + deltaY * deltaY);
99 result.
iDeltaR = cl::sycl::sqrt(iDeltaR2);
101 if constexpr (OtherSPType == SpacePointType::Bottom) {
105 result.
u = x * iDeltaR2;
106 result.
v = y * iDeltaR2;
113 vecmem::device_vector<detail::DeviceLinEqCircle> resultArray(
m_resultArray);
114 resultArray[
idx] = result;
122 vecmem::data::vector_view<const DeviceSpacePoint>
m_otherSPs;