|
16 | 16 |
|
17 | 17 | //================================================================================ |
18 | 18 | // this file has been auto-generated, do not modify its contents! |
19 | | -// date: 2025-09-15 12:44:05.768243 |
20 | | -// git hash: 9b41485a27b669ea6f4aae118b4d251947608bf6 |
| 19 | +// date: 2025-09-15 16:14:44.345265 |
| 20 | +// git hash: e824b62e2e7d40e70322cae48a0b652fbec3803c |
21 | 21 | //================================================================================ |
22 | 22 |
|
23 | 23 | #ifndef KERNEL_FLOAT_MACROS_H |
@@ -3202,6 +3202,18 @@ KERNEL_FLOAT_INLINE vector_ptr<T, N, U, A>& operator+=(vector_ptr<T, N, U, A>& p |
3202 | 3202 | return p = p + i; |
3203 | 3203 | } |
3204 | 3204 |
|
| 3205 | +/** |
| 3206 | + * Creates a `vector_ptr<T, N, U>` from a raw pointer `U*`. |
| 3207 | + * |
| 3208 | + * @tparam T The type of the elements as viewed by the user. |
| 3209 | + * @tparam N The vector size in number of elements. |
| 3210 | + * @tparam U The type of the elements pointed to by the raw pointer. |
| 3211 | + */ |
| 3212 | +template<typename T, size_t N = 1, typename U> |
| 3213 | +KERNEL_FLOAT_INLINE vector_ptr<T, N, U> wrap_ptr(U* ptr) { |
| 3214 | + return vector_ptr<T, N, U> {ptr}; |
| 3215 | +} |
| 3216 | + |
3205 | 3217 | /** |
3206 | 3218 | * Creates a `vector_ptr<T, N>` from a raw pointer `T*` by asserting a specific alignment `N`. |
3207 | 3219 | * |
@@ -3234,10 +3246,10 @@ using view_ptr = vector_ptr<T, 1, U, alignof(U)>; |
3234 | 3246 |
|
3235 | 3247 | #if defined(__cpp_deduction_guides) |
3236 | 3248 | template<typename T> |
3237 | | -vector_ptr(T*) -> vector_ptr<T, 1, T>; |
| 3249 | +vector_ptr(T*) -> vector_ptr<T, 1, T, alignof(T)>; |
3238 | 3250 |
|
3239 | 3251 | template<typename T> |
3240 | | -vector_ptr(const T*) -> vector_ptr<T, 1, const T>; |
| 3252 | +vector_ptr(const T*) -> vector_ptr<T, 1, const T, alignof(T)>; |
3241 | 3253 |
|
3242 | 3254 | #if __cpp_deduction_guides >= 201907L |
3243 | 3255 | template<typename T> |
|
0 commit comments