From 57df37de52d9cc41d8d08aba0d4308b7675d159c Mon Sep 17 00:00:00 2001 From: "Artem M. Chirkin" <9253178+achirkin@users.noreply.github.com> Date: Thu, 25 Aug 2022 18:16:08 +0200 Subject: [PATCH] Add alignment to the TxN_t vectorized type (#792) The recent removal of the union-based type punning in https://github.com/rapidsai/raft/pull/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: https://github.com/rapidsai/raft/pull/792 --- cpp/include/raft/vectorized.cuh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/include/raft/vectorized.cuh b/cpp/include/raft/vectorized.cuh index b2e4940dc8..6f22d740ca 100644 --- a/cpp/include/raft/vectorized.cuh +++ b/cpp/include/raft/vectorized.cuh @@ -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;