@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月以来,哪怕对市场风向再不敏感的人,也感觉到阵阵凉意。二级市场连续下挫,一级市场融资环境恶化,不论企业融资数量还...