Skip to content

Commit 06e08f5

Browse files
committed
Change conversion ctor of vector_ptr
1 parent c4fae9d commit 06e08f5

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

include/kernel_float/memory.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ struct vector_ptr {
429429
* only allows conversion if the alignment of the source is greater than or equal to the alignment of the target.
430430
*/
431431
template<typename T2, size_t N2>
432-
KERNEL_FLOAT_INLINE vector_ptr(vector_ptr<T2, N2, U> p, enable_if_t<(N2 >= N), int> = {}) :
432+
KERNEL_FLOAT_INLINE vector_ptr(vector_ptr<T2, N2, U> p, enable_if_t<(N2 % N == 0), int> = {}) :
433433
data_(p.get()) {}
434434

435435
/**
@@ -514,11 +514,11 @@ struct vector_ptr<T, N, const U> {
514514

515515
template<typename T2, size_t N2>
516516
KERNEL_FLOAT_INLINE
517-
vector_ptr(vector_ptr<T2, N2, const U> p, enable_if_t<(N2 >= N), int> = {}) :
517+
vector_ptr(vector_ptr<T2, N2, const U> p, enable_if_t<(N2 % N == 0), int> = {}) :
518518
data_(p.get()) {}
519519

520520
template<typename T2, size_t N2>
521-
KERNEL_FLOAT_INLINE vector_ptr(vector_ptr<T2, N2, U> p, enable_if_t<(N2 >= N), int> = {}) :
521+
KERNEL_FLOAT_INLINE vector_ptr(vector_ptr<T2, N2, U> p, enable_if_t<(N2 % N == 0), int> = {}) :
522522
data_(p.get()) {}
523523

524524
template<size_t K = N>

single_include/kernel_float.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
//================================================================================
1818
// this file has been auto-generated, do not modify its contents!
19-
// date: 2024-02-22 10:17:59.488348
20-
// git hash: c81e76a8c623162ef1970192f239b70d54c85123
19+
// date: 2024-02-22 10:29:30.717359
20+
// git hash: c4fae9db85e61372cfefc53d4755b418beb2d93e
2121
//================================================================================
2222

2323
#ifndef KERNEL_FLOAT_MACROS_H
@@ -2751,7 +2751,7 @@ struct vector_ptr {
27512751
* only allows conversion if the alignment of the source is greater than or equal to the alignment of the target.
27522752
*/
27532753
template<typename T2, size_t N2>
2754-
KERNEL_FLOAT_INLINE vector_ptr(vector_ptr<T2, N2, U> p, enable_if_t<(N2 >= N), int> = {}) :
2754+
KERNEL_FLOAT_INLINE vector_ptr(vector_ptr<T2, N2, U> p, enable_if_t<(N2 % N == 0), int> = {}) :
27552755
data_(p.get()) {}
27562756

27572757
/**
@@ -2836,11 +2836,11 @@ struct vector_ptr<T, N, const U> {
28362836

28372837
template<typename T2, size_t N2>
28382838
KERNEL_FLOAT_INLINE
2839-
vector_ptr(vector_ptr<T2, N2, const U> p, enable_if_t<(N2 >= N), int> = {}) :
2839+
vector_ptr(vector_ptr<T2, N2, const U> p, enable_if_t<(N2 % N == 0), int> = {}) :
28402840
data_(p.get()) {}
28412841

28422842
template<typename T2, size_t N2>
2843-
KERNEL_FLOAT_INLINE vector_ptr(vector_ptr<T2, N2, U> p, enable_if_t<(N2 >= N), int> = {}) :
2843+
KERNEL_FLOAT_INLINE vector_ptr(vector_ptr<T2, N2, U> p, enable_if_t<(N2 % N == 0), int> = {}) :
28442844
data_(p.get()) {}
28452845

28462846
template<size_t K = N>

0 commit comments

Comments
 (0)