mxnet代码剖析之--Storage篇
2016-04-11 10:09
471 查看
/// Storage manager across multiple devices
struct Handle
void* dptr; /// Pointer to the data.
size_t size; /// Size of the storage.
Context ctx; /// Context information about device and ID.
/// Base storage manager interface
class StorageManager
Alloc()
Free()
class NaiveStorageManager, PooledStorageManager
class CPUDeviceStorage, GPUDeviceStorage, PinnedMemoryStorage
class LazyAllocArray: Get element of corresponding index, if it is not created create by creator
class MXNET_API Storage
1 mxnet存储管理器
2 存储由内存地址,大小,设备属性构成,分别对应Handle: dptr, size, ctx
3 存储管理器主要负责内存申请,内存销毁操作
4 实现内存复用,节省内存new/delete引起的开销,主要由PooledStorageManager类完成
5 存储设备包括GPU, CPU, PinnedCPU, 具体实现分别由GPUDeviceStorage, CPUDeviceStorage与PinnedMemoryStorage实现
6 优点:封装内存管理类,尤其是pooled管理策略!结合其LazyAllocArray功能,可以实现内存复用,减少内存new/delete 操作
struct Handle
void* dptr; /// Pointer to the data.
size_t size; /// Size of the storage.
Context ctx; /// Context information about device and ID.
/// Base storage manager interface
class StorageManager
Alloc()
Free()
class NaiveStorageManager, PooledStorageManager
class CPUDeviceStorage, GPUDeviceStorage, PinnedMemoryStorage
class LazyAllocArray: Get element of corresponding index, if it is not created create by creator
class MXNET_API Storage
1 mxnet存储管理器
2 存储由内存地址,大小,设备属性构成,分别对应Handle: dptr, size, ctx
3 存储管理器主要负责内存申请,内存销毁操作
4 实现内存复用,节省内存new/delete引起的开销,主要由PooledStorageManager类完成
5 存储设备包括GPU, CPU, PinnedCPU, 具体实现分别由GPUDeviceStorage, CPUDeviceStorage与PinnedMemoryStorage实现
6 优点:封装内存管理类,尤其是pooled管理策略!结合其LazyAllocArray功能,可以实现内存复用,减少内存new/delete 操作
相关文章推荐
- java程序打包jre以及制作安装包
- 使用cocoapods导入第三方类库后 头文件没有代码提示?
- C#控件及常用设计整理
- PHP中的header()函数
- 浅谈php字符串
- 从HAL层到java应用层重写mini6410 led功能
- Java Phaser
- 初学python(对比java语言不同) 第五篇
- PHP $_SERVER (eg:REMOTE_ADDR)
- python监控进程
- 【java】JDK环境变量配置
- ftp 服务器相关
- Java中的堆栈(转)
- getParent()与getParentFile()的区别
- python学习笔记(excel+unittest)
- JAVA的包装类
- c++设计模式
- asp.net 时间操作
- PHP读取mssql json数据中文乱码的解决办法
- Pixhawk之启动代码和入口函数(.mk、rcS、__start、hrt)