|
1 | 1 | //================================================================================
|
2 | 2 | // this file has been auto-generated, do not modify its contents!
|
3 |
| -// date: 2023-08-15 14:44:32.635916 |
4 |
| -// git hash: 35d55328fd0cd6644f23137ea17dd4dd470a870d |
| 3 | +// date: 2023-08-16 12:43:52.493856 |
| 4 | +// git hash: b236a521d5decdd59b17361febbb7ee39803b715 |
5 | 5 | //================================================================================
|
6 | 6 |
|
7 | 7 | #ifndef KERNEL_FLOAT_MACROS_H
|
@@ -507,6 +507,24 @@ struct into_vector_traits {
|
507 | 507 | }
|
508 | 508 | };
|
509 | 509 |
|
| 510 | +template<typename T, size_t N> |
| 511 | +struct into_vector_traits<T[N]> { |
| 512 | + using value_type = T; |
| 513 | + using extent_type = extent<N>; |
| 514 | + |
| 515 | + KERNEL_FLOAT_INLINE |
| 516 | + static vector_storage<T, N> call(const T (&input)[N]) { |
| 517 | + return call(input, make_index_sequence<N>()); |
| 518 | + } |
| 519 | + |
| 520 | + private: |
| 521 | + template<size_t... Is> |
| 522 | + KERNEL_FLOAT_INLINE static vector_storage<T, N> |
| 523 | + call(const T (&input)[N], index_sequence<Is...>) { |
| 524 | + return {input[Is]...}; |
| 525 | + } |
| 526 | +}; |
| 527 | + |
510 | 528 | template<typename V>
|
511 | 529 | struct into_vector_traits<const V>: into_vector_traits<V> {};
|
512 | 530 |
|
@@ -1731,10 +1749,10 @@ struct cast<constant<T>, R, m> {
|
1731 | 1749 | return constant<T>(operator OP(T(left.get()), T(right.get()))); \
|
1732 | 1750 | }
|
1733 | 1751 |
|
1734 |
| -KERNEL_FLOAT_CONSTANT_DEFINE_OP(+) |
1735 |
| -KERNEL_FLOAT_CONSTANT_DEFINE_OP(-) |
1736 |
| -KERNEL_FLOAT_CONSTANT_DEFINE_OP(*) |
1737 |
| -KERNEL_FLOAT_CONSTANT_DEFINE_OP(/) |
| 1752 | +//KERNEL_FLOAT_CONSTANT_DEFINE_OP(+) |
| 1753 | +//KERNEL_FLOAT_CONSTANT_DEFINE_OP(-) |
| 1754 | +//KERNEL_FLOAT_CONSTANT_DEFINE_OP(*) |
| 1755 | +//KERNEL_FLOAT_CONSTANT_DEFINE_OP(/) |
1738 | 1756 |
|
1739 | 1757 | } // namespace kernel_float
|
1740 | 1758 |
|
@@ -2964,7 +2982,8 @@ struct vector: public S {
|
2964 | 2982 | *
|
2965 | 2983 | * - For vectors `vec<T, N>`, it simply returns the original vector.
|
2966 | 2984 | * - For primitive types `T` (e.g., `int`, `float`, `double`), it returns a `vec<T, 1>`.
|
2967 |
| - * - For array-like types (e.g., `int2`, `std::array<float, 3>`, `T[N]`), it returns `vec<T, N>`. |
| 2985 | + * - For array-like types (e.g., `std::array<T, N>`, `T[N]`), it returns `vec<T, N>`. |
| 2986 | + * - For vector-like types (e.g., `int2`, `dim3`), it returns `vec<T, N>`. |
2968 | 2987 | */
|
2969 | 2988 | template<typename V>
|
2970 | 2989 | KERNEL_FLOAT_INLINE into_vector_type<V> into_vector(V&& input) {
|
@@ -3664,10 +3683,12 @@ KERNEL_FLOAT_INLINE constexpr kconstant<T> kconst(T value) {
|
3664 | 3683 | return value;
|
3665 | 3684 | }
|
3666 | 3685 |
|
| 3686 | +KERNEL_FLOAT_INLINE |
3667 | 3687 | static constexpr kconstant<double> operator""_c(long double v) {
|
3668 | 3688 | return static_cast<double>(v);
|
3669 | 3689 | }
|
3670 | 3690 |
|
| 3691 | +KERNEL_FLOAT_INLINE |
3671 | 3692 | static constexpr kconstant<long long int> operator""_c(unsigned long long int v) {
|
3672 | 3693 | return static_cast<long long int>(v);
|
3673 | 3694 | }
|
|
0 commit comments