18#ifndef __NNFW_CKER_EIGEN_EIGEN_CONVOLUTION_HELPERS_H__
19#define __NNFW_CKER_EIGEN_EIGEN_CONVOLUTION_HELPERS_H__
46template <
typename TensorEvaluatorType,
typename PacketType,
typename IndexType>
50 template <
typename TensorEvaluatorT,
typename PacketT,
typename IndexT>
52 typename std::enable_if<
53 unpacket_traits<PacketT>::masked_load_available &&
55 decltype(std::declval<const TensorEvaluatorT>().
template partialPacket<PacketT>(
56 std::declval<IndexT>(),
57 std::declval<
typename unpacket_traits<PacketT>::mask_t>()))>
::value>::type *)
60 template <
typename TensorEvaluatorT,
typename PacketT,
typename IndexT>
63 typedef decltype(functionExistsSfinae<TensorEvaluatorType, PacketType, IndexType>(
66 static constexpr bool value = status::value;
71template <
typename Packet>
72EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
73 typename std::enable_if<unpacket_traits<Packet>::masked_load_available,
74 typename unpacket_traits<Packet>::mask_t>::type
77 const Index packet_size = internal::unpacket_traits<Packet>::size;
78 eigen_assert(0 <= from && to <= (packet_size + 1) && from < to);
80 using Mask =
typename internal::unpacket_traits<Packet>::mask_t;
81 const Mask mask_max = std::numeric_limits<Mask>::max();
83 return (mask_max >> (packet_size - to)) ^ (mask_max >> (packet_size - from));
static auto functionExistsSfinae(...) -> std::false_type
decltype(functionExistsSfinae< TensorEvaluatorType, PacketType, IndexType >(nullptr)) status
static auto functionExistsSfinae(typename std::enable_if< unpacket_traits< PacketT >::masked_load_available &&std::is_same< PacketT, decltype(std::declval< const TensorEvaluatorT >().template partialPacket< PacketT >(std::declval< IndexT >(), std::declval< typename unpacket_traits< PacketT >::mask_t >()))>::value >::type *) -> std::true_type
static constexpr bool value
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE std::enable_if< unpacket_traits< Packet >::masked_load_available, typenameunpacket_traits< Packet >::mask_t >::type mask(int from, int to)