@startuml
class GpuQueue {
RegisterRelease
IsEmpty
IsFull
Push
Front
Pop
Destroy
}
class BlockingQueue {
Create
RegisterRelease
Push
Front
Pop
Destroy
std::shared_ptr<GpuQueue> queue_
}
class GpuBufferMgr {
GetInstance()
Create(device_id, channel_name, *addr, shape,capacity)
Open(device_id, channel_name, shape,
std::function<void(void *)> func)
Push(handle, data, unsigned int timeout_in_sec);
Front(unsigned int handle, void **addr, size_t *len);
Pop(unsigned int handle);
set_device_id(int device_id);
Close(unsigned int handle) noexcept;
IsInit()
IsClosed()
Destroy()
CloseNotify()
CloseConfirm()
std::map<unsigned int, std::shared_ptr<BlockingQueue>> handle_queue_map_
std::map<std::string, std::shared_ptr<BlockingQueue>> name_queue_map_
}
interface KernelMod {
GetInputSizeList()
GetOutputSizeList()
GetWorkspaceSizeList()
bool Launch(inputs, workspace,
outputs, stream_ptr)
GenParameters()
}
class AscendKernelMod {
GenTask
block_dim
stream_id
}
class AicpuOpKernelMod{
SetInputSizeList
SetOutputSizeList
SetWorkspaceSizeList
GetInputSizeList
GetOutputSizeList
GetWorkspaceSizeList
Launch
GenTask
SetInputList
SetOutputList
SetAnfNode
SetNodeDef
SetNodeName
CreateCpuKernelInfo(inputs, outputs)
}
class TbeKernelMod{
SetInputSizeList
SetOutputSizeList
SetWorkspaceSizeList
GetInputSizeList
GetOutputSizeList
GetWorkspaceSizeList
Launch
GenTask
GenParameters
}
class AkgKernelMod
class HcclKernel
class RtKernel
class ProfilingKernelMod
class ProfilingKernelMod
class SendKernel
class RecvKernel
class StreamActiveKernel
class StreamSwitchKernel
class MemCpyAsyncKernel
class AssignKernel
class LabelGotoKernel
class LabelSetKernel
class LabelSwitchKernel
class CPUKernel
class GpuKernel {
Init(const CNodePtr &kernel_node)
}
class AddNGpuFwdKernel{
Init()
Launch()
}
class xxxKernel {
Init()
Launch()
}
class Conv2dGpuFwdKernel {
Init()
Launch()
}
KernelMod <|.. GpuKernel
KernelMod <|.. AscendKernelMod
KernelMod <|.. CPUKernel
GpuKernel <|-- AddNGpuFwdKernel
GpuKernel <|-- xxxKernel
GpuKernel <|-- Conv2dGpuFwdKernel
AscendKernelMod <|-- AicpuOpKernelMod
AscendKernelMod <|-- TbeKernelMod
AscendKernelMod <|-- AkgKernelMod
AscendKernelMod <|-- HcclKernel
AscendKernelMod <|-- RtKernel
RtKernel <|-- ProfilingKernelMod
RtKernel <|-- SendKernel
RtKernel <|-- RecvKernel
RtKernel <|-- StreamActiveKernel
RtKernel <|-- StreamSwitchKernel
RtKernel <|-- MemCpyAsyncKernel
RtKernel <|-- AssignKernel
RtKernel <|-- LabelGotoKernel
RtKernel <|-- LabelSetKernel
RtKernel <|-- LabelSwitchKernel
class GPUDeviceManager
class GPUKernelRuntime
class DatasetInitKernel
class DatasetIteratorKernel
GpuBufferMgr *-right- BlockingQueue
BlockingQueue o-right- GpuQueue
GpuBufferMgr <.down. GPUDeviceManager
GpuBufferMgr <.down. GPUKernelRuntime
GpuBufferMgr <.down. DatasetInitKernel
GpuBufferMgr <.. DatasetIteratorKernel
@enduml
mindspore gpu类图
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
推荐阅读更多精彩内容
- 第02章 GPU 图形绘制管线 万事开头难,每门科学都是如此。------ 马克思 图形绘制管线描述 GPU 渲...
- 通过阅读本文你将能够知道: 统一渲染架构和分离式渲染架构是什么以及二者的区别 固定功能渲染管线和可编程渲染管线是什...
- 系统配置 我所使用的环境总体来说为: Ubuntu 18.04 cuda 9.0 cudnn 7.5.0 pyth...
- 5月以来,哪怕对市场风向再不敏感的人,也感觉到阵阵凉意。二级市场连续下挫,一级市场融资环境恶化,不论企业融资数量还...