MemInfo
函数功能
构造MemInfo,通常在CacheManager的remap_registered_memory接口中作为参数类型使用。
函数原型
1 | __init__(mem_type: Memtype, addr: int, size: int) |
参数说明
参数名称 |
数据类型 |
取值说明 |
---|---|---|
mem_type |
内存地址类型。 |
|
addr |
int |
内存地址。 |
size |
int |
内存地址对应大小,单位字节。 |
调用示例
1 2 | from llm_datadist import MemInfo mem_info = MemInfo(Memtype.MEM_TYPE_DEVICE, 1234, 10) |
返回值
正常情况下返回MemInfo的实例。
传入数据类型错误情况下会抛出TypeError或ValueError异常。
约束说明
无