@@ -52,22 +52,6 @@ using uint = unsigned int;
52
52
using uint64 = unsigned long int ;
53
53
using int64 = long int ;
54
54
55
- static const int __cv_rvv_e8m1_nlanes = __riscv_vsetvlmax_e8m1();
56
- static const int __cv_rvv_e16m1_nlanes = __riscv_vsetvlmax_e16m1();
57
- static const int __cv_rvv_e32m1_nlanes = __riscv_vsetvlmax_e32m1();
58
- static const int __cv_rvv_e64m1_nlanes = __riscv_vsetvlmax_e64m1();
59
- static const int __cv_rvv_e8m2_nlanes = __riscv_vsetvlmax_e8m2();
60
- static const int __cv_rvv_e16m2_nlanes = __riscv_vsetvlmax_e16m2();
61
- static const int __cv_rvv_e32m2_nlanes = __riscv_vsetvlmax_e32m2();
62
- static const int __cv_rvv_e64m2_nlanes = __riscv_vsetvlmax_e64m2();
63
- static const int __cv_rvv_e8m4_nlanes = __riscv_vsetvlmax_e8m4();
64
- static const int __cv_rvv_e16m4_nlanes = __riscv_vsetvlmax_e16m4();
65
- static const int __cv_rvv_e32m4_nlanes = __riscv_vsetvlmax_e32m4();
66
- static const int __cv_rvv_e64m4_nlanes = __riscv_vsetvlmax_e64m4();
67
- static const int __cv_rvv_e8m8_nlanes = __riscv_vsetvlmax_e8m8();
68
- static const int __cv_rvv_e16m8_nlanes = __riscv_vsetvlmax_e16m8();
69
- static const int __cv_rvv_e32m8_nlanes = __riscv_vsetvlmax_e32m8();
70
- static const int __cv_rvv_e64m8_nlanes = __riscv_vsetvlmax_e64m8();
71
55
72
56
template <class T >
73
57
struct VTraits ;
@@ -76,7 +60,7 @@ struct VTraits;
76
60
template <> \
77
61
struct VTraits <REG> \
78
62
{ \
79
- static inline int vlanes () { return __cv_rvv_ ##SUF##_nlanes ; } \
63
+ static inline int vlanes () { return __riscv_vsetvlmax_ ##SUF () ; } \
80
64
using lane_type = TYP; \
81
65
static const int max_nlanes = CV_RVV_MAX_VLEN/SZ; \
82
66
};
@@ -1813,8 +1797,8 @@ inline int v_scan_forward(const v_float64& a)
1813
1797
// mask: {0,0,0,1, ...} -> {T,T,T,F, ...}
1814
1798
#define OPENCV_HAL_IMPL_RVV_PACK_TRIPLETS (_Tpvec, v_trunc ) \
1815
1799
inline _Tpvec v_pack_triplets (const _Tpvec& vec) { \
1816
- size_t vl = __cv_rvv_e8m1_nlanes ; \
1817
- vuint32m1_t one = __riscv_vmv_v_x_u32m1 (1 , __cv_rvv_e32m1_nlanes ); \
1800
+ size_t vl = VTraits<v_uint8>:: vlanes () ; \
1801
+ vuint32m1_t one = __riscv_vmv_v_x_u32m1 (1 , VTraits<v_uint32>:: vlanes () ); \
1818
1802
vuint8m1_t zero = __riscv_vmv_v_x_u8m1 (0 , vl); \
1819
1803
vuint8m1_t mask = __riscv_vreinterpret_u8m1 (one); \
1820
1804
return __riscv_vcompress (vec, __riscv_vmseq (v_trunc (__riscv_vslideup (zero, mask, 3 , vl)), 0 , vl), VTraits<_Tpvec>::vlanes ()); \
0 commit comments