batmat 0.0.19
Batched linear algebra routines
Loading...
Searching...
No Matches
dtypes.hpp File Reference
#include <batmat/config.hpp>
#include <algorithm>
#include <array>
#include <functional>
#include <type_traits>

Go to the source code of this file.

Classes

struct  batmat::types::Types< Ts >
struct  batmat::types::Head< Types< T, Ts... > >
struct  batmat::types::Tail< Types< T, Ts... > >
struct  batmat::types::Concat<>
struct  batmat::types::Concat< Types< Ts... > >
struct  batmat::types::Concat< Types< Ts1... >, Types< Ts2... >, Rest... >
struct  batmat::types::Map< Func, Types< Ts... > >
struct  batmat::types::FlatMap< Func, Types< Ts... > >
struct  batmat::types::Filter< Pred, Types< Ts... > >
struct  batmat::types::DTypeVectorLength< T, VL >
struct  batmat::types::VectorLengthIs< VL >
struct  batmat::types::DTypeIs< DT >

Namespaces

namespace  batmat
namespace  batmat::types

Macros

#define BATMAT_PREFIX_COMMA(...)
#define BATMAT_INST_DT_VL(DT, VL)
 Types containing DTypeVectorLength for all supported (dtype, VL) combinations.

Typedefs

template<template< class > class Func, class List>
using batmat::types::Map_t = typename Map<Func, List>::type
template<template< class > class Func, class List>
using batmat::types::FlatMap_t = typename FlatMap<Func, List>::type
template<template< class > class Pred, class List>
using batmat::types::Filter_t = typename Filter<Pred, List>::type
template<index_t VL, class List>
using batmat::types::FilterVL = FlatMap_t<VectorLengthIs<VL>::template type, List>
template<class Ts>
using batmat::types::GetDType = typename Ts::dtype
using batmat::types::dtype_all = Tail<Types<void , double >>::type
 Types containing all supported dtypes.
using batmat::types::dtype_vl_all = Tail<Types<void , DTypeVectorLength<double, 1> , DTypeVectorLength<double, 4> , DTypeVectorLength<double, 8> >>::type
template<index_t VL>
using batmat::types::dtypes_for_vl = Map_t<GetDType, Filter_t<VectorLengthIs<VL>::template type, dtype_vl_all>>
 Types containing all supported dtypes for a given vector length VL.
template<class DT, index_t VL>
using batmat::types::lookup_dtype_vl
 Types containing the given dtype and vector length combination, if supported.

Functions

template<class F>
constexpr auto batmat::types::foreach_dtype_vl (F &&f)
 Call a given function f for all supported (dtype, VL) combinations.

Variables

template<class DT>
constexpr std::array batmat::types::vl_for_dtype
 Array of supported vector lengths for a given dtype T.
constexpr std::array batmat::types::vl_for_real_t = vl_for_dtype<real_t>
 Array of supported vector lengths for the default real_t.
template<class DT, index_t VL>
constexpr bool batmat::types::is_supported_dtype_vl = !std::is_same_v<lookup_dtype_vl<DT, VL>, Types<>>
 Check if a given (dtype, VL) combination is supported.
template<class DT, index_t VL>
constexpr index_t batmat::types::vl_at_least
 The smallest supported vector length for dtype DT that is greater than or equal to VL.
template<class DT, index_t VL>
constexpr index_t batmat::types::vl_at_most
 The largest supported vector length for dtype DT that is less than or equal to VL.
template<class DT, index_t VL>
constexpr index_t batmat::types::vl_or_largest
 VL if it is a supported vector length for dtype DT, otherwise the largest supported vector length for DT.

Class Documentation

◆ batmat::types::Types

struct batmat::types::Types
Class Members
typedef Template< Args..., Ts... > into Template<Args..., Ts...>

◆ batmat::types::Head< Types< T, Ts... > >

struct batmat::types::Head< Types< T, Ts... > >
Class Members
typedef Types< T > type Types<T>

◆ batmat::types::Tail< Types< T, Ts... > >

struct batmat::types::Tail< Types< T, Ts... > >
Class Members
typedef Types< Ts... > type Types<Ts...>

◆ batmat::types::Concat<>

struct batmat::types::Concat<>
Class Members
typedef Types<> type Types<>

◆ batmat::types::Concat< Types< Ts... > >

struct batmat::types::Concat< Types< Ts... > >
Class Members
typedef Types< Ts... > type Types<Ts...>

◆ batmat::types::Concat< Types< Ts1... >, Types< Ts2... >, Rest... >

struct batmat::types::Concat< Types< Ts1... >, Types< Ts2... >, Rest... >
Class Members
typedef typename Concat< Types< Ts1..., Ts2... >, Rest... >::type type typename Concat<Types<Ts1..., Ts2...>, Rest...>::type

◆ batmat::types::Map< Func, Types< Ts... > >

struct batmat::types::Map< Func, Types< Ts... > >
Class Members
typedef Types< Func< Ts >... > type Types<Func<Ts>...>

◆ batmat::types::FlatMap< Func, Types< Ts... > >

struct batmat::types::FlatMap< Func, Types< Ts... > >
Class Members
typedef typename Concat< Func< Ts >... >::type type typename Concat<Func<Ts>...>::type

◆ batmat::types::Filter< Pred, Types< Ts... > >

struct batmat::types::Filter< Pred, Types< Ts... > >
Class Members
typedef typename value, Types< Ts >, Types<> >... >::type type typename Concat<std::conditional_t<Pred<Ts>::value, Types<Ts>, Types<>>...>::type

◆ batmat::types::VectorLengthIs

struct batmat::types::VectorLengthIs
Class Members
typedef bool_constant< VL==vl > type std::bool_constant<VL == T::vl>

◆ batmat::types::DTypeIs

struct batmat::types::DTypeIs
Class Members
typedef is_same< DT, typename dtype > type std::is_same<DT, typename T::dtype>

Macro Definition Documentation

◆ BATMAT_PREFIX_COMMA

#define BATMAT_PREFIX_COMMA ( ...)
Value:
, __VA_ARGS__

Definition at line 98 of file dtypes.hpp.

◆ BATMAT_INST_DT_VL

#define BATMAT_INST_DT_VL ( DT,
VL )
Value:
, DTypeVectorLength<DT, VL>

Types containing DTypeVectorLength for all supported (dtype, VL) combinations.

Definition at line 103 of file dtypes.hpp.