Skip to content

Commit

Permalink
Add alignment to the TxN_t vectorized type (#792)
Browse files Browse the repository at this point in the history
The recent removal of the union-based type punning in #781 caused misaligned access in some cases. This PR returns the alignment to the data type.

Authors:
  - Artem M. Chirkin (https://github.com/achirkin)

Approvers:
  - Corey J. Nolet (https://github.com/cjnolet)
  - William Hicks (https://github.com/wphicks)

URL: #792
  • Loading branch information
achirkin authored Aug 25, 2022
1 parent ab9a695 commit 57df37d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cpp/include/raft/vectorized.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ struct TxN_t {
/** defines the number of 'math_t' types stored by this struct */
static const int Ratio = veclen_;

struct {
struct alignas(io_t) {
/** the vectorized data that is used for subsequent operations */
math_t data[Ratio];
} val;
Expand Down

0 comments on commit 57df37d

Please sign in to comment.