Skip to content

Commit 1bf79e1

Browse files
committed
Merge remote-tracking branch 'origin/cusini/mixed-reactions' into cusini/mixed-reactions
2 parents 71bde44 + bd47423 commit 1bf79e1

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/common/CArrayWrapper.hpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -68,28 +68,28 @@ struct CArrayWrapper< T, DIM0 >
6868
* @param dim The index (must be in range [0, DIM0)).
6969
* @return Reference to the element at the specified index.
7070
*/
71-
HPCREACT_HOST_DEVICE constexpr inline T & operator()( int const dim ) { return data[dim]; }
71+
constexpr HPCREACT_HOST_DEVICE inline T & operator()( int const dim ) { return data[dim]; }
7272

7373
/**
7474
* @brief Read-only access to an element by index (const overload).
7575
* @param dim The index (must be in range [0, DIM0)).
7676
* @return Const reference to the element at the specified index.
7777
*/
78-
HPCREACT_HOST_DEVICE constexpr inline T const & operator()( int const dim ) const { return data[dim]; }
78+
constexpr HPCREACT_HOST_DEVICE inline T const & operator()( int const dim ) const { return data[dim]; }
7979

8080
/**
8181
* @brief Subscript operator for read/write access.
8282
* @param dim The index (must be in range [0, DIM0)).
8383
* @return Reference to the element at the specified index.
8484
*/
85-
HPCREACT_HOST_DEVICE constexpr inline T & operator[]( int const dim ) { return data[dim]; }
85+
constexpr HPCREACT_HOST_DEVICE inline T & operator[]( int const dim ) { return data[dim]; }
8686

8787
/**
8888
* @brief Subscript operator for read-only access (const overload).
8989
* @param dim The index (must be in range [0, DIM0)).
9090
* @return Const reference to the element at the specified index.
9191
*/
92-
HPCREACT_HOST_DEVICE constexpr inline T const & operator[]( int const dim ) const { return data[dim]; }
92+
constexpr HPCREACT_HOST_DEVICE inline T const & operator[]( int const dim ) const { return data[dim]; }
9393

9494
/// The underlying 1D C-style array.
9595
T data[DIM0]{};
@@ -161,7 +161,7 @@ struct CArrayWrapper< T, DIM0, DIM1 >
161161
* @param dim1 Index in the second dimension (range [0, DIM1)).
162162
* @return Reference to the element at the specified 2D location.
163163
*/
164-
HPCREACT_HOST_DEVICE constexpr inline T & operator()( int const dim0, int const dim1 )
164+
constexpr HPCREACT_HOST_DEVICE inline T & operator()( int const dim0, int const dim1 )
165165
{
166166
return data[dim0][dim1];
167167
}
@@ -172,7 +172,7 @@ struct CArrayWrapper< T, DIM0, DIM1 >
172172
* @param dim1 Index in the second dimension (range [0, DIM1)).
173173
* @return Const reference to the element at the specified 2D location.
174174
*/
175-
HPCREACT_HOST_DEVICE constexpr inline T const & operator()( int const dim0, int const dim1 ) const
175+
constexpr HPCREACT_HOST_DEVICE inline T const & operator()( int const dim0, int const dim1 ) const
176176
{
177177
return data[dim0][dim1];
178178
}
@@ -184,7 +184,7 @@ struct CArrayWrapper< T, DIM0, DIM1 >
184184
*
185185
* This allows usage like `obj[dim0][dim1]`.
186186
*/
187-
HPCREACT_HOST_DEVICE constexpr inline T ( & operator[]( int const dim0 ))[DIM1]
187+
constexpr HPCREACT_HOST_DEVICE inline T ( & operator[]( int const dim0 ))[DIM1]
188188
{
189189
return data[dim0];
190190
}
@@ -194,7 +194,7 @@ struct CArrayWrapper< T, DIM0, DIM1 >
194194
* @param dim0 The row index (range [0, DIM0)).
195195
* @return Const reference to an array of type T[DIM1].
196196
*/
197-
HPCREACT_HOST_DEVICE constexpr inline T const (&operator[]( int const dim0 ) const)[DIM1]
197+
constexpr HPCREACT_HOST_DEVICE inline T const (&operator[]( int const dim0 ) const)[DIM1]
198198
{
199199
return data[dim0];
200200
}
@@ -275,7 +275,7 @@ struct CArrayWrapper< T, DIM0, DIM1, DIM2 >
275275
* @note Currently, this function incorrectly indexes data[dim0][dim1], missing dim2.
276276
* It should be `data[dim0][dim1][dim2]`. Please correct if intended.
277277
*/
278-
HPCREACT_HOST_DEVICE constexpr inline T & operator()( int const dim0, int const dim1, int const dim2 )
278+
constexpr HPCREACT_HOST_DEVICE inline T & operator()( int const dim0, int const dim1, int const dim2 )
279279
{
280280
// NOTE: This looks like a bug in your original code. Should be data[dim0][dim1][dim2].
281281
return data[dim0][dim1][dim2];
@@ -288,7 +288,7 @@ struct CArrayWrapper< T, DIM0, DIM1, DIM2 >
288288
* @param dim2 Index in the third dimension (range [0, DIM2)).
289289
* @return Const reference to the element at the specified 3D location.
290290
*/
291-
HPCREACT_HOST_DEVICE constexpr inline T const & operator()( int const dim0, int const dim1, int const dim2 ) const
291+
constexpr HPCREACT_HOST_DEVICE inline T const & operator()( int const dim0, int const dim1, int const dim2 ) const
292292
{
293293
// NOTE: Same potential bug as above. Should be data[dim0][dim1][dim2].
294294
return data[dim0][dim1][dim2];
@@ -301,7 +301,7 @@ struct CArrayWrapper< T, DIM0, DIM1, DIM2 >
301301
*
302302
* This allows usage like `obj[dim0][dim1][dim2]`.
303303
*/
304-
HPCREACT_HOST_DEVICE constexpr inline T ( & operator[]( int const dim0 ))[DIM1][DIM2]
304+
constexpr HPCREACT_HOST_DEVICE inline T ( & operator[]( int const dim0 ))[DIM1][DIM2]
305305
{
306306
return data[dim0];
307307
}
@@ -311,7 +311,7 @@ struct CArrayWrapper< T, DIM0, DIM1, DIM2 >
311311
* @param dim0 The slice index (range [0, DIM0)).
312312
* @return Const reference to an array of type T[DIM1][DIM2].
313313
*/
314-
HPCREACT_HOST_DEVICE constexpr inline T const (&operator[]( int const dim0 ) const)[DIM1][DIM2]
314+
constexpr HPCREACT_HOST_DEVICE inline T const (&operator[]( int const dim0 ) const)[DIM1][DIM2]
315315
{
316316
return data[dim0];
317317
}

0 commit comments

Comments
 (0)