xgboost

Classes | Typedefs | Functions
xgboost::linalg::detail Namespace Reference

## Classes
struct | AllTag
struct | ArrayInterfaceHandler
struct | IntTag
struct | RangeTag

## Typedefs
template<typename S >
using | RemoveCRType = std::remove_const_t< std::remove_reference_t< S > >
template<typename S >
using | IndexToTag = std::conditional_t< std::is_integral< RemoveCRType< S > >::value, IntTag, S >

## Functions
template<size_t dim, typename S , typename Head , size_t D>
constexpr size_t | Offset (S(&strides)[D], size_t n, Head head)
template<size_t dim, typename S , size_t D, typename Head , typename... Tail>
constexpr std::enable_if_t< sizeof...(Tail) !=0, size_t > | Offset (S(&strides)[D], size_t n, Head head, Tail &&...rest)
template<int32_t D, bool f_array = false>
constexpr void | CalcStride (size_t const (&shape)[D], size_t(&stride)[D])
template<typename T >
constexpr int32_t | CalcSliceDim ()
| Calculate the dimension of sliced tensor. More...
template<typename T , typename... S>
constexpr std::enable_if_t< sizeof...(S) !=0, int32_t > | CalcSliceDim ()
template<int32_t D>
constexpr size_t | CalcSize (size_t(&shape)[D])
template<int32_t n, typename Fn >
constexpr LINALG_HD auto | UnrollLoop (Fn fn)
template<typename T >
int32_t | NativePopc (T v)
LINALG_HD int | Popc (uint32_t v)
LINALG_HD int | Popc (uint64_t v)
template<class T , std::size_t N, std::size_t... Idx>
constexpr auto | Arr2Tup (T(&arr)[N], std::index_sequence< Idx... >)
template<class T , std::size_t N>
constexpr auto | Arr2Tup (T(&arr)[N])
template<typename I , int32_t D>
LINALG_HD auto | UnravelImpl (I idx, common::Span< size_t const, D > shape)
template<size_t dim, typename I , int32_t D>
void | ReshapeImpl (size_t(&out_shape)[D], I s)
template<size_t dim, int32_t D, typename... S, typename I , std::enable_if_t< sizeof...(S) !=0 > * = nullptr>
void | ReshapeImpl (size_t(&out_shape)[D], I &&s, S &&...rest)
template<typename Fn , typename Tup , size_t... I>
decltype(auto) constexpr LINALG_HD | Apply (Fn &&f, Tup &&t, std::index_sequence< I... >)
template<typename Fn , typename Tup >
decltype(auto) constexpr LINALG_HD | Apply (Fn &&f, Tup &&t)

## Typedef Documentation

## ◆ IndexToTag

template<typename S >

using xgboost::linalg::detail::IndexToTag = typedef std::conditional_t<std::is_integral<RemoveCRType<S> >::value, IntTag, S>

## ◆ RemoveCRType

template<typename S >

using xgboost::linalg::detail::RemoveCRType = typedef std::remove_const_t<std::remove_reference_t<S> >

## Function Documentation

## ◆ Apply() [1/2]

template<typename Fn , typename Tup >

decltype(auto) constexpr LINALG_HD xgboost::linalg::detail::Apply | ( | Fn && | f,
|  | Tup && | t
| ) |  |
| constexpr

C++ 17 style apply.

Parameters

  f | function to apply
  t | tuple of arguments

## ◆ Apply() [2/2]

template<typename Fn , typename Tup , size_t... I>

decltype(auto) constexpr LINALG_HD xgboost::linalg::detail::Apply | ( | Fn && | f,
|  | Tup && | t,
|  | std::index_sequence< I... > |
| ) |  |
| constexpr

## ◆ Arr2Tup() [1/2]

template<class T , std::size_t N>

constexpr auto xgboost::linalg::detail::Arr2Tup | ( | T(&) | arr[N] | ) |
| constexpr

## ◆ Arr2Tup() [2/2]

template<class T , std::size_t N, std::size_t... Idx>

constexpr auto xgboost::linalg::detail::Arr2Tup | ( | T(&) | arr[N],
|  | std::index_sequence< Idx... > |
| ) |  |
| constexpr

## ◆ CalcSize()

template<int32_t D>

constexpr size_t xgboost::linalg::detail::CalcSize | ( | size_t(&) | shape[D] | ) |
| constexpr

## ◆ CalcSliceDim() [1/2]

template<typename T >

constexpr int32_t xgboost::linalg::detail::CalcSliceDim | ( |  | ) |
| constexpr

Calculate the dimension of sliced tensor.

## ◆ CalcSliceDim() [2/2]

template<typename T , typename... S>

constexpr std::enable_if_t<sizeof...(S) != 0, int32_t> xgboost::linalg::detail::CalcSliceDim | ( |  | ) |
| constexpr

## ◆ CalcStride()

template<int32_t D, bool f_array = false>

constexpr void xgboost::linalg::detail::CalcStride | ( | size_t const (&) | shape[D],
|  | size_t(&) | stride[D]
| ) |  |
| constexpr

## ◆ NativePopc()

template<typename T >

int32_t xgboost::linalg::detail::NativePopc | ( | T | v | ) |

## ◆ Offset() [1/2]

template<size_t dim, typename S , typename Head , size_t D>

constexpr size_t xgboost::linalg::detail::Offset | ( | S(&) | strides[D],
|  | size_t | n,
|  | Head | head
| ) |  |
| constexpr

## ◆ Offset() [2/2]

template<size_t dim, typename S , size_t D, typename Head , typename... Tail>

constexpr std::enable_if_t<sizeof...(Tail) != 0, size_t> xgboost::linalg::detail::Offset | ( | S(&) | strides[D],
|  | size_t | n,
|  | Head | head,
|  | Tail &&... | rest
| ) |  |
| constexpr

## ◆ Popc() [1/2]

LINALG_HD int xgboost::linalg::detail::Popc | ( | uint32_t | v | ) |
| inline

## ◆ Popc() [2/2]

LINALG_HD int xgboost::linalg::detail::Popc | ( | uint64_t | v | ) |
| inline

## ◆ ReshapeImpl() [1/2]

template<size_t dim, int32_t D, typename... S, typename I , std::enable_if_t< sizeof...(S) !=0 > * = nullptr>

void xgboost::linalg::detail::ReshapeImpl | ( | size_t(&) | out_shape[D],
|  | I && | s,
|  | S &&... | rest
| ) |  |

## ◆ ReshapeImpl() [2/2]

template<size_t dim, typename I , int32_t D>

void xgboost::linalg::detail::ReshapeImpl | ( | size_t(&) | out_shape[D],
|  | I | s
| ) |  |

## ◆ UnravelImpl()

template<typename I , int32_t D>

LINALG_HD auto xgboost::linalg::detail::UnravelImpl | ( | I | idx,
|  | common::Span< size_t const, D > | shape
| ) |  |

## ◆ UnrollLoop()

template<int32_t n, typename Fn >

constexpr LINALG_HD auto xgboost::linalg::detail::UnrollLoop | ( | Fn | fn | ) |
| constexpr