Add missing utils

This commit is contained in:
Rostyslav Geyyer
2025-03-10 15:46:36 +00:00
parent 39b93e4a20
commit ac0224532e

View File

@@ -346,6 +346,10 @@ inline constexpr bool is_native_type()
is_same<T, f6_t>::value || is_same<T, bf6_t>::value;
}
// non_native_vector_base
template <typename T, index_t N, typename Enable = void>
struct non_native_vector_base;
// vector_type
template <typename T, index_t N, typename Enable = void>
struct vector_type;
@@ -416,6 +420,13 @@ struct scalar_type<T __attribute__((ext_vector_type(N)))>
static constexpr index_t vector_size = N;
};
template <typename T, index_t N>
struct scalar_type<non_native_vector_base<T, N>>
{
using type = T;
static constexpr index_t vector_size = N;
};
template <typename T, index_t N>
struct scalar_type<vector_type<T, N>>
{
@@ -524,6 +535,13 @@ struct scalar_type<bool>
static constexpr index_t vector_size = 1;
};
template <>
struct scalar_type<f4x2_pk_t>
{
using type = f4x2_pk_t::type;
static constexpr index_t vector_size = 1;
};
template <typename T>
struct vector_type<T, 1, typename ck::enable_if_t<is_native_type<T>()>>
{
@@ -1652,9 +1670,6 @@ struct vector_type<T, 256, typename ck::enable_if_t<is_native_type<T>()>>
}
};
template <typename T, index_t N, typename Enable = void>
struct non_native_vector_base;
template <typename T>
struct nnvb_data_t_selector
{