perf(detray): Align transform3 struct to 16 bytes - #6027
Conversation
Performance summaryHere is a summary of the performance effects of this PR: GraphicalTabular
Important All metrics in this report are given as reciprocal throughput, not as wallclock runtime. Note This is an automated message produced upon the explicit request of a human being. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Public API surface diffNo change to the public API surface. ✅ |
niermann999
left a comment
There was a problem hiding this comment.
I also have been playing around with alignment of these during the vectorization studies and never saw much of a difference...
The transform3 struct is exactly 128 bytes (although it can go down to 48 without issue), but is aligned to 4 byte boundaries. This means that any loads into the struct must assume non-alignment. Aligning the struct to 16 bytes allows the compiler to issue 128 bit loads if it wants, which should improve latency and throughput.
574ba42 to
7a6e7b6
Compare
Invalidated by push of 7a6e7b6
Performance summaryHere is a summary of the performance effects of this PR: GraphicalTabular
Important All metrics in this report are given as reciprocal throughput, not as wallclock runtime. Note This is an automated message produced upon the explicit request of a human being. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| /// @param m is the matrix | ||
| /// @param col is the column index | ||
| DETRAY_HOST_DEVICE | ||
| static constexpr array_type<4> column(const matrix44 &m, index_t col) { |
There was a problem hiding this comment.
I think it would be better to implement this as specialized block getter? That could benefit more code than just the transform3
There was a problem hiding this comment.
See e.g. acts-project/algebra-plugins#140
Also, could this go into a dedicated PR?





The transform3 struct is exactly 128 bytes (although it can go down to 48 without issue), but is aligned to 4 byte boundaries. This means that any loads into the struct must assume non-alignment. Aligning the struct to 16 bytes allows the compiler to issue 128 bit loads if it wants, which should improve latency and throughput.