xgboost
|
#include <xgboost/base.h>
#include <cstddef>
#include <cstdio>
#include <iterator>
#include <limits>
#include <type_traits>
#include <utility>
#include <vector>
类 | |
class | xgboost::common::detail::SpanIterator< SpanType, IsConst > |
struct | xgboost::common::detail::ExtentValue< Extent, Offset, Count > |
struct | xgboost::common::detail::ExtentAsBytesValue< T, Extent > |
struct | xgboost::common::detail::IsAllowedExtentConversion< From, To > |
struct | xgboost::common::detail::IsAllowedElementTypeConversion< From, To > |
struct | xgboost::common::detail::IsSpanOracle< T > |
struct | xgboost::common::detail::IsSpanOracle< Span< T, Extent > > |
struct | xgboost::common::detail::IsSpan< T > |
struct | xgboost::common::detail::Less< T > |
struct | xgboost::common::detail::Greater< T > |
class | xgboost::common::Span< T, Extent > |
基于 ISO++20 span<T> 的 span 类实现。接口应与 ISO++20 相同。更多... | |
class | xgboost::common::IterSpan< It > |
一个简单的自定义 Span 类型,使用通用迭代器代替指针。更多... | |
命名空间 | |
xgboost | |
用于多目标树的核心数据结构。 | |
xgboost::common | |
xgboost::common::detail | |
宏 | |
#define | __span_noexcept noexcept |
基于 ISO++20 span 的 span 类 更多... | |
#define | KERNEL_CHECK(cond) (XGBOOST_EXPECT((cond), true) ? static_cast<void>(0) : std::terminate()) |
#define | SPAN_CHECK(cond) KERNEL_CHECK(cond) |
#define | SPAN_LT(lhs, rhs) SPAN_CHECK((lhs) < (rhs)) |
类型定义 | |
using | xgboost::common::detail::ptrdiff_t = typename std::conditional_t< std::is_same_v< std::ptrdiff_t, std::int64_t >, std::ptrdiff_t, std::int64_t > |
枚举 | |
enum class | xgboost::common::byte : unsigned char |
函数 | |
template<class InputIt1 , class InputIt2 , class Compare = detail::Less<decltype(std::declval<InputIt1>().operator*())>> | |
XGBOOST_DEVICE bool | xgboost::common::detail::LexicographicalCompare (InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2) |
template<class T , std::size_t X, class U , std::size_t Y> | |
XGBOOST_DEVICE bool | xgboost::common::operator== (Span< T, X > l, Span< U, Y > r) |
template<class T , std::size_t X, class U , std::size_t Y> | |
constexpr XGBOOST_DEVICE bool | xgboost::common::operator!= (Span< T, X > l, Span< U, Y > r) |
template<class T , std::size_t X, class U , std::size_t Y> | |
constexpr XGBOOST_DEVICE bool | xgboost::common::operator< (Span< T, X > l, Span< U, Y > r) |
template<class T , std::size_t X, class U , std::size_t Y> | |
constexpr XGBOOST_DEVICE bool | xgboost::common::operator<= (Span< T, X > l, Span< U, Y > r) |
template<class T , std::size_t X, class U , std::size_t Y> | |
constexpr XGBOOST_DEVICE bool | xgboost::common::operator> (Span< T, X > l, Span< U, Y > r) |
template<class T , std::size_t X, class U , std::size_t Y> | |
constexpr XGBOOST_DEVICE bool | xgboost::common::operator>= (Span< T, X > l, Span< U, Y > r) |
template<class T , std::size_t E> | |
XGBOOST_DEVICE auto | xgboost::common::as_bytes (Span< T, E > s) __span_noexcept -> Span< const byte, detail::ExtentAsBytesValue< T, E >::value > |
template<class T , std::size_t E> | |
XGBOOST_DEVICE auto | xgboost::common::as_writable_bytes (Span< T, E > s) __span_noexcept -> Span< byte, detail::ExtentAsBytesValue< T, E >::value > |
template<typename T > | |
xgboost::common::Span (std::vector< T > const &) -> Span< T const > | |
template<typename T > | |
xgboost::common::Span (std::vector< T > &) -> Span< T > | |
变量 | |
constexpr std::size_t | xgboost::common::dynamic_extent = std::numeric_limits<std::size_t>::max() |
#define __span_noexcept noexcept |
基于 ISO++20 span 的 span 类
版权所有 2018-2024,XGBoost 贡献者
关于此文件中的 NOLINT
如果希望 Span 与 std 接口一起工作,例如范围 for 循环,则命名必须与 std 一致,而不是 XGBoost。此外,接口也与 XGBoost 编码风格冲突,特别是对“explicit”关键字的使用。
部分代码复制自 Guidelines Support Library,以下是其许可
Copyright (c) 2015 Microsoft Corporation. All rights reserved.
此代码根据 MIT 许可 (MIT) 获得许可。
本软件按“原样”提供,不提供任何明示或暗示的担保,包括但不限于适销性、特定用途适用性和非侵权性的担保。在任何情况下,作者或版权持有人均不对任何索赔、损害或其他责任负责,无论是合同诉讼、侵权诉讼或其他形式的诉讼,无论是由本软件引起、与之相关或与本软件的使用或其他交易有关。
版本号 1910 取自 GSL。
我们可能希望使用 dmlc/concurrentqueue.h 中的 MOODYCAMEL_NOEXCEPT。但该文件中还有许多其他定义会导致 MSVC 2013 中的警告/问题。目前我们尽量保持 Span 的闭包最小。
MSVC 还有其他变通方法,如 _Unwrapped, _Verify_range 等。其中一些是 MSVC 的隐藏魔法,我尽量避免使用它们。如果其中任何一个成为必要,请参考 GSL 的源代码,并可能查阅此线程中的一些解释
https://github.com/Microsoft/GSL/pull/664
TODO(trivialfis):将这些 MSVC 变通方法分组到一个易于管理的地方。
#define KERNEL_CHECK | ( | cond | ) | (XGBOOST_EXPECT((cond), true) ? static_cast<void>(0) : std::terminate()) |
#define SPAN_CHECK | ( | cond | ) | KERNEL_CHECK(cond) |
#define SPAN_LT | ( | lhs, | |
rhs | |||
) | SPAN_CHECK((lhs) < (rhs)) |