|
xgboost
|
DMatrix 相关数据的线程感知 FIFO 缓存。更多...
#include <cache.h>

类 | |
| 结构 | 哈希 |
| 结构 | 项目 |
| 结构 | 键 |
公共成员函数 | |
| DMatrixCache (std::size_t cache_size) | |
| DMatrixCache & | operator= (DMatrixCache &&that) |
| template<typename... Args> | |
| std::shared_ptr< CacheT > | CacheItem (std::shared_ptr< DMatrix > m, Args const &... args) |
| 如果 DMatrix 尚未在缓存中,则缓存新的 DMatrix。更多... | |
| template<typename... Args> | |
| std::shared_ptr< CacheT > | ResetItem (std::shared_ptr< DMatrix > m, Args const &... args) |
| 重新初始化缓存中的项。更多... | |
| decltype(container_) const & | Container () |
| 获取底层哈希映射的 const 引用。返回前清除已过期的缓存。更多... | |
| std::shared_ptr< CacheT > | Entry (DMatrix const *m) const |
静态公共成员函数 | |
| static constexpr std::size_t | DefaultSize () |
保护成员函数 | |
| void | CheckConsistent () const |
| void | ClearExpired () |
| void | ClearExcess () |
保护属性 | |
| std::unordered_map< Key, Item, Hash > | container_ |
| std::queue< Key > | queue_ |
| std::size_t | max_size_ |
用于 DMatrix 相关数据的线程感知 FIFO 缓存。
| CacheT | 需要缓存的类型。 |
|
内联显式 |
| cache_size | 缓存的最大大小。 |
|
inline |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inline |
获取底层哈希映射的 const 引用。返回前清除已过期的缓存。
|
inlinestaticconstexpr |
|
inline |
|
inline |
|
inline |
重新初始化缓存中的项。
由于 shared_ptr 用于保存项,因此无法从缓存中访问缓存外部存在的任何引用。
我们使用 reset 而不是 erase,以避免为更新单个项遍历整个缓存。(缓存是 FIFO,需要保持顺序)。
|
protected |
|
protected |
|
protected |