AI Engine API User Guide (AIE) 2023.2
Loading...
Searching...
No Matches
detail/utils.hpp File Reference
#include <array>
#include <type_traits>
#include "config.hpp"

Classes

struct  aie::detail::utils::circular_index< Max >
 
struct  aie::detail::utils::circular_index<(unsigned) -1 >
 
struct  aie::detail::utils::get_complex_component_type< T >
 
struct  aie::detail::utils::get_complex_component_type< cint16 >
 
struct  aie::detail::utils::get_complex_component_type< cint32 >
 
struct  aie::detail::utils::get_integer_type< false, 16 >
 
struct  aie::detail::utils::get_integer_type< false, 32 >
 
struct  aie::detail::utils::get_integer_type< false, 64 >
 
struct  aie::detail::utils::get_integer_type< false, 8 >
 
struct  aie::detail::utils::get_integer_type< true, 16 >
 
struct  aie::detail::utils::get_integer_type< true, 32 >
 
struct  aie::detail::utils::get_integer_type< true, 64 >
 
struct  aie::detail::utils::get_integer_type< true, 8 >
 
struct  aie::detail::utils::get_next_integer_type< T >
 
struct  aie::detail::utils::get_next_integer_type< int16_t >
 
struct  aie::detail::utils::get_next_integer_type< int32_t >
 
struct  aie::detail::utils::get_next_integer_type< int8_t >
 
struct  aie::detail::utils::get_next_integer_type< uint16_t >
 
struct  aie::detail::utils::get_next_integer_type< uint32_t >
 
struct  aie::detail::utils::get_next_integer_type< uint8_t >
 
struct  aie::detail::utils::get_prev_integer_type< T >
 
struct  aie::detail::utils::get_prev_integer_type< int16_t >
 
struct  aie::detail::utils::get_prev_integer_type< int32_t >
 
struct  aie::detail::utils::get_prev_integer_type< int64_t >
 
struct  aie::detail::utils::get_prev_integer_type< uint16_t >
 
struct  aie::detail::utils::get_prev_integer_type< uint32_t >
 
struct  aie::detail::utils::get_prev_integer_type< uint64_t >
 
struct  aie::detail::utils::has_address_space< T >
 
struct  aie::detail::utils::is_one_of< T, Types >
 
struct  aie::detail::utils::make_integer_broadcast_impl< Elems, T, Value, Generated >
 
struct  aie::detail::utils::make_integer_broadcast_impl< 0, T, Value, Generated... >
 
struct  aie::detail::utils::make_signed< T >
 
struct  aie::detail::utils::make_signed< uint16_t >
 
struct  aie::detail::utils::make_signed< uint32_t >
 
struct  aie::detail::utils::make_signed< uint8_t >
 
struct  aie::detail::utils::make_unsigned< T >
 
struct  aie::detail::utils::make_unsigned< int16_t >
 
struct  aie::detail::utils::make_unsigned< int32_t >
 
struct  aie::detail::utils::make_unsigned< int8_t >
 
struct  aie::detail::utils::num_elems< T >
 
struct  aie::detail::utils::num_elems< std::array< T, N > >
 
struct  aie::detail::utils::pack2< T >
 
struct  aie::detail::utils::remove_all< T >
 
struct  aie::detail::utils::unroll_context< T, Start, End, It >
 
struct  aie::detail::utils::unroll_for_helper< T, Start, End, It, Step >
 

Namespaces

namespace  aie
 Base namespace for AIE operations and types.
 
namespace  aie::detail
 
namespace  aie::detail::utils
 

Macros

#define __AIE_API_DETAIL_UTILS__HPP__
 
#define REQUIRES(a)   REQUIRES_MSG(a, "Requirement " STRINGIFY(a) " not met")
 
#define REQUIRES_CONSTANT(a)
 
#define REQUIRES_CONSTANT_MSG(a, m)
 
#define REQUIRES_MSG(a, m)   RUNTIME_ASSERT(a, m)
 
#define RUNTIME_ASSERT(e, m)   assert(e && m)
 
#define RUNTIME_ASSERT_NO_ASSUME(e, m)   assert(e && m)
 
#define STATIC_ASSERT_CONSTANT(e, m)
 
#define STATIC_ASSERT_CONSTANT_EXPRESSION(e, m)
 
#define STRINGIFY(a)   #a
 
#define UNREACHABLE_MSG(m)
 

Typedefs

template<typename T >
using aie::detail::utils::get_complex_component_type_t = typename get_complex_component_type< T >::type
 
template<bool Signed, unsigned Bits>
using aie::detail::utils::get_integer_type_t = typename get_integer_type< Signed, Bits >::type
 
template<typename T >
using aie::detail::utils::get_next_integer_type_t = typename get_next_integer_type< T >::type
 
template<typename T >
using aie::detail::utils::get_prev_integer_type_t = typename get_prev_integer_type< T >::type
 
template<size_t Elems, size_t Value>
using aie::detail::utils::make_index_broadcast = make_integer_broadcast< size_t, Elems, Value >
 
template<typename T , size_t Elems, T Value>
using aie::detail::utils::make_integer_broadcast = typename make_integer_broadcast_impl< Elems, T, Value >::type
 
template<std::size_t N>
using aie::detail::utils::make_reverse_index_sequence = decltype(generate_index_sequence_reverse(std::make_index_sequence< N >{}))
 
template<typename T >
using aie::detail::utils::make_signed_t = typename make_signed< T >::type
 
template<typename T >
using aie::detail::utils::make_unsigned_t = typename make_unsigned< T >::type
 
template<typename T >
using aie::detail::utils::remove_all_t = typename remove_all< T >::type
 

Functions

 aie::detail::utils::circular_index (unsigned max) -> circular_index<(unsigned) -1 >
 
template<typename T >
constexpr T * aie::detail::utils::floor_ptr (T *ptr)
 
template<std::size_t ... Indices>
constexpr auto aie::detail::utils::generate_index_sequence_reverse (const std::index_sequence< Indices... > &) -> decltype(std::index_sequence< sizeof...(Indices) - 1U - Indices... >{})
 
template<unsigned N, typename T , typename... Args>
constexpr auto aie::detail::utils::get_nth (const T &t, Args &&... args)
 
template<typename T >
constexpr bool aie::detail::utils::is_powerof2 (T v)
 
template<typename T1 , typename T2 >
constexpr bool aie::detail::utils::is_same_object (const T1 &a, const T2 &b)
 
template<typename T >
constexpr unsigned aie::detail::utils::log2 (T v)
 
template<unsigned Start, unsigned End, typename... T>
constexpr auto aie::detail::utils::subtuple (const std::tuple< T... > &t)
 
template<unsigned Start, typename... T, std::size_t... I>
constexpr auto aie::detail::utils::subtuple_ (const std::tuple< T... > &t, std::index_sequence< I... >)
 
template<typename T , T Start, T End, T Step = 1, typename Fn >
void aie::detail::utils::unroll_for (Fn &&fn)
 
template<unsigned Times, typename Fn >
void aie::detail::utils::unroll_times (Fn &&fn)
 

Variables

template<typename T >
constexpr unsigned aie::detail::utils::num_elems_v = num_elems<T>::value
 

Class Documentation

◆ aie::detail::utils::get_complex_component_type

struct aie::detail::utils::get_complex_component_type
template<typename T>
struct aie::detail::utils::get_complex_component_type< T >
Class Members
typedef void type

◆ aie::detail::utils::get_complex_component_type< cint16 >

struct aie::detail::utils::get_complex_component_type< cint16 >
Class Members
typedef int16_t type

◆ aie::detail::utils::get_complex_component_type< cint32 >

struct aie::detail::utils::get_complex_component_type< cint32 >
Class Members
typedef int32_t type

◆ aie::detail::utils::get_integer_type< false, 16 >

struct aie::detail::utils::get_integer_type< false, 16 >
Class Members
typedef uint16_t type

◆ aie::detail::utils::get_integer_type< false, 32 >

struct aie::detail::utils::get_integer_type< false, 32 >
Class Members
typedef uint32_t type

◆ aie::detail::utils::get_integer_type< false, 64 >

struct aie::detail::utils::get_integer_type< false, 64 >
Class Members
typedef uint64_t type

◆ aie::detail::utils::get_integer_type< false, 8 >

struct aie::detail::utils::get_integer_type< false, 8 >
Class Members
typedef uint8_t type

◆ aie::detail::utils::get_integer_type< true, 16 >

struct aie::detail::utils::get_integer_type< true, 16 >
Class Members
typedef int16_t type

◆ aie::detail::utils::get_integer_type< true, 32 >

struct aie::detail::utils::get_integer_type< true, 32 >
Class Members
typedef int32_t type

◆ aie::detail::utils::get_integer_type< true, 64 >

struct aie::detail::utils::get_integer_type< true, 64 >
Class Members
typedef int64_t type

◆ aie::detail::utils::get_integer_type< true, 8 >

struct aie::detail::utils::get_integer_type< true, 8 >
Class Members
typedef int8_t type

◆ aie::detail::utils::get_next_integer_type

struct aie::detail::utils::get_next_integer_type
template<typename T>
struct aie::detail::utils::get_next_integer_type< T >
Class Members
typedef void type

◆ aie::detail::utils::get_next_integer_type< int16_t >

struct aie::detail::utils::get_next_integer_type< int16_t >
Class Members
typedef int32_t type

◆ aie::detail::utils::get_next_integer_type< int32_t >

struct aie::detail::utils::get_next_integer_type< int32_t >
Class Members
typedef int64_t type

◆ aie::detail::utils::get_next_integer_type< int8_t >

struct aie::detail::utils::get_next_integer_type< int8_t >
Class Members
typedef int16_t type

◆ aie::detail::utils::get_next_integer_type< uint16_t >

struct aie::detail::utils::get_next_integer_type< uint16_t >
Class Members
typedef uint32_t type

◆ aie::detail::utils::get_next_integer_type< uint32_t >

struct aie::detail::utils::get_next_integer_type< uint32_t >
Class Members
typedef uint64_t type

◆ aie::detail::utils::get_next_integer_type< uint8_t >

struct aie::detail::utils::get_next_integer_type< uint8_t >
Class Members
typedef uint16_t type

◆ aie::detail::utils::get_prev_integer_type

struct aie::detail::utils::get_prev_integer_type
template<typename T>
struct aie::detail::utils::get_prev_integer_type< T >
Class Members
typedef void type

◆ aie::detail::utils::get_prev_integer_type< int16_t >

struct aie::detail::utils::get_prev_integer_type< int16_t >
Class Members
typedef int8_t type

◆ aie::detail::utils::get_prev_integer_type< int32_t >

struct aie::detail::utils::get_prev_integer_type< int32_t >
Class Members
typedef int16_t type

◆ aie::detail::utils::get_prev_integer_type< int64_t >

struct aie::detail::utils::get_prev_integer_type< int64_t >
Class Members
typedef int32_t type

◆ aie::detail::utils::get_prev_integer_type< uint16_t >

struct aie::detail::utils::get_prev_integer_type< uint16_t >
Class Members
typedef uint8_t type

◆ aie::detail::utils::get_prev_integer_type< uint32_t >

struct aie::detail::utils::get_prev_integer_type< uint32_t >
Class Members
typedef uint16_t type

◆ aie::detail::utils::get_prev_integer_type< uint64_t >

struct aie::detail::utils::get_prev_integer_type< uint64_t >
Class Members
typedef uint32_t type

◆ aie::detail::utils::make_integer_broadcast_impl

struct aie::detail::utils::make_integer_broadcast_impl
template<size_t Elems, typename T, T Value, T... Generated>
struct aie::detail::utils::make_integer_broadcast_impl< Elems, T, Value, Generated >
Class Members
typedef typename type type

◆ aie::detail::utils::make_integer_broadcast_impl< 0, T, Value, Generated... >

struct aie::detail::utils::make_integer_broadcast_impl< 0, T, Value, Generated... >
template<typename T, T Value, T... Generated>
struct aie::detail::utils::make_integer_broadcast_impl< 0, T, Value, Generated... >
Class Members
typedef integer_sequence< T, Generated... > type

◆ aie::detail::utils::make_signed

struct aie::detail::utils::make_signed
template<typename T>
struct aie::detail::utils::make_signed< T >
Class Members
typedef T type

◆ aie::detail::utils::make_signed< uint16_t >

struct aie::detail::utils::make_signed< uint16_t >
Class Members
typedef int16_t type

◆ aie::detail::utils::make_signed< uint32_t >

struct aie::detail::utils::make_signed< uint32_t >
Class Members
typedef int32_t type

◆ aie::detail::utils::make_signed< uint8_t >

struct aie::detail::utils::make_signed< uint8_t >
Class Members
typedef int8_t type

◆ aie::detail::utils::make_unsigned

struct aie::detail::utils::make_unsigned
template<typename T>
struct aie::detail::utils::make_unsigned< T >
Class Members
typedef T type

◆ aie::detail::utils::make_unsigned< int16_t >

struct aie::detail::utils::make_unsigned< int16_t >
Class Members
typedef uint16_t type

◆ aie::detail::utils::make_unsigned< int32_t >

struct aie::detail::utils::make_unsigned< int32_t >
Class Members
typedef uint32_t type

◆ aie::detail::utils::make_unsigned< int8_t >

struct aie::detail::utils::make_unsigned< int8_t >
Class Members
typedef uint8_t type

◆ aie::detail::utils::remove_all

struct aie::detail::utils::remove_all
template<typename T>
struct aie::detail::utils::remove_all< T >
Class Members
typedef remove_cv_t< remove_reference_t< T > > type

Macro Definition Documentation

◆ __AIE_API_DETAIL_UTILS__HPP__

#define __AIE_API_DETAIL_UTILS__HPP__

◆ REQUIRES

#define REQUIRES (   a)    REQUIRES_MSG(a, "Requirement " STRINGIFY(a) " not met")

◆ REQUIRES_CONSTANT

#define REQUIRES_CONSTANT (   a)

◆ REQUIRES_CONSTANT_MSG

#define REQUIRES_CONSTANT_MSG (   a,
 
)

◆ REQUIRES_MSG

#define REQUIRES_MSG (   a,
 
)    RUNTIME_ASSERT(a, m)

◆ RUNTIME_ASSERT

#define RUNTIME_ASSERT (   e,
 
)    assert(e && m)

◆ RUNTIME_ASSERT_NO_ASSUME

#define RUNTIME_ASSERT_NO_ASSUME (   e,
 
)    assert(e && m)

◆ STATIC_ASSERT_CONSTANT

#define STATIC_ASSERT_CONSTANT (   e,
 
)

◆ STATIC_ASSERT_CONSTANT_EXPRESSION

#define STATIC_ASSERT_CONSTANT_EXPRESSION (   e,
 
)

◆ STRINGIFY

#define STRINGIFY (   a)    #a

◆ UNREACHABLE_MSG

#define UNREACHABLE_MSG (   m)
Value:
do { \
assert(false && "Unreachable; " m); \
__builtin_unreachable(); \
} while (0)