xgboost
|
Namespaces | |
detail | |
Classes | |
class | Tensor |
A tensor storage. To use it for other functionality like slicing one needs to obtain a view first. This way we can use it on both host and device. More... | |
class | TensorView |
A tensor view with static type and dimension. It implements indexing and slicing. More... | |
Typedefs | |
template<typename T > | |
using | VectorView = TensorView< T, 1 > |
A view over a vector, specialization of Tensor. More... | |
template<typename T > | |
using | MatrixView = TensorView< T, 2 > |
A view over a matrix, specialization of Tensor. More... | |
Functions | |
constexpr detail::AllTag | All () |
Specify all elements in the axis for slicing. More... | |
template<typename I > | |
constexpr detail::RangeTag< I > | Range (I beg, I end) |
Specify a range of elements in the axis for slicing. More... | |
template<typename Container , typename I , int32_t D, std::enable_if_t<!common::detail::IsSpan< Container >::value > * = nullptr> | |
auto | MakeTensorView (Container &data, I const (&shape)[D], int32_t device) |
Constructor for automatic type deduction. More... | |
template<typename T , typename I , int32_t D> | |
LINALG_HD auto | MakeTensorView (common::Span< T > data, I const (&shape)[D], int32_t device) |
template<size_t D> | |
LINALG_HD auto | UnravelIndex (size_t idx, common::Span< size_t const, D > shape) |
Turns linear index into multi-dimension index. Similar to numpy unravel. More... | |
template<typename T > | |
auto | MakeVec (T *ptr, size_t s, int32_t device=-1) |
Create a vector view from contigious memory. More... | |
template<typename T > | |
auto | MakeVec (HostDeviceVector< T > *data) |
template<typename T > | |
auto | MakeVec (HostDeviceVector< T > const *data) |
template<typename T , int32_t D> | |
Json | ArrayInterface (TensorView< T const, D > const &t) |
Array Interface defined by numpy. More... | |
template<typename T , int32_t D> | |
Json | ArrayInterface (TensorView< T, D > const &t) |
Same as const version, but returns non-readonly data pointer. More... | |
template<typename T , int32_t D> | |
auto | ArrayInterfaceStr (TensorView< T const, D > const &t) |
Return string representation of array interface. More... | |
template<typename T , int32_t D> | |
auto | ArrayInterfaceStr (TensorView< T, D > const &t) |
template<typename T , int32_t D> | |
void | Stack (Tensor< T, D > *l, Tensor< T, D > const &r) |
template<typename T , int32_t D, typename Fn > | |
void | ElementWiseTransformHost (linalg::TensorView< T, D > t, int32_t n_threads, Fn &&fn) |
template<typename T , int32_t D, typename Fn > | |
void | ElementWiseKernelHost (linalg::TensorView< T, D > t, int32_t n_threads, Fn &&fn) |
template<typename T , int32_t D, typename Fn > | |
void | ElementWiseKernelDevice (linalg::TensorView< T, D > t, Fn &&fn, void *s=nullptr) |
template<typename T , int32_t D, typename Fn > | |
void | ElementWiseTransformDevice (linalg::TensorView< T, D > t, Fn &&fn, void *s=nullptr) |
template<typename T , int32_t D, typename Fn > | |
void | ElementWiseKernel (GenericParameter const *ctx, linalg::TensorView< T, D > t, Fn &&fn) |
using xgboost::linalg::MatrixView = typedef TensorView<T, 2> |
A view over a matrix, specialization of Tensor.
T | data type of matrix |
using xgboost::linalg::VectorView = typedef TensorView<T, 1> |
A view over a vector, specialization of Tensor.
T | data type of vector |
|
constexpr |
Specify all elements in the axis for slicing.
Json xgboost::linalg::ArrayInterface | ( | TensorView< T const, D > const & | t | ) |
Array Interface defined by numpy.
stream
is optionally included when data is on CUDA device.
Json xgboost::linalg::ArrayInterface | ( | TensorView< T, D > const & | t | ) |
Same as const version, but returns non-readonly data pointer.
auto xgboost::linalg::ArrayInterfaceStr | ( | TensorView< T const, D > const & | t | ) |
Return string representation of array interface.
auto xgboost::linalg::ArrayInterfaceStr | ( | TensorView< T, D > const & | t | ) |
void xgboost::linalg::ElementWiseKernel | ( | GenericParameter const * | ctx, |
linalg::TensorView< T, D > | t, | ||
Fn && | fn | ||
) |
void xgboost::linalg::ElementWiseKernelDevice | ( | linalg::TensorView< T, D > | t, |
Fn && | fn, | ||
void * | s = nullptr |
||
) |
void xgboost::linalg::ElementWiseKernelHost | ( | linalg::TensorView< T, D > | t, |
int32_t | n_threads, | ||
Fn && | fn | ||
) |
void xgboost::linalg::ElementWiseTransformDevice | ( | linalg::TensorView< T, D > | t, |
Fn && | fn, | ||
void * | s = nullptr |
||
) |
void xgboost::linalg::ElementWiseTransformHost | ( | linalg::TensorView< T, D > | t, |
int32_t | n_threads, | ||
Fn && | fn | ||
) |
LINALG_HD auto xgboost::linalg::MakeTensorView | ( | common::Span< T > | data, |
I const (&) | shape[D], | ||
int32_t | device | ||
) |
auto xgboost::linalg::MakeTensorView | ( | Container & | data, |
I const (&) | shape[D], | ||
int32_t | device | ||
) |
Constructor for automatic type deduction.
auto xgboost::linalg::MakeVec | ( | HostDeviceVector< T > * | data | ) |
auto xgboost::linalg::MakeVec | ( | HostDeviceVector< T > const * | data | ) |
auto xgboost::linalg::MakeVec | ( | T * | ptr, |
size_t | s, | ||
int32_t | device = -1 |
||
) |
Create a vector view from contigious memory.
ptr | Pointer to the contigious memory. |
s | Size of the vector. |
device | (optional) Device ordinal, default to be host. |
|
constexpr |
Specify a range of elements in the axis for slicing.
void xgboost::linalg::Stack | ( | Tensor< T, D > * | l, |
Tensor< T, D > const & | r | ||
) |
LINALG_HD auto xgboost::linalg::UnravelIndex | ( | size_t | idx, |
common::Span< size_t const, D > | shape | ||
) |
Turns linear index into multi-dimension index. Similar to numpy unravel.