C++ Class Inheritance

Access Modifiers

  1. public: 成员可以被任意地方访问,包括类的外部
  2. protected: 成员可以被类本身及其子类访问
  3. private: 成员只能被类本身访问

We can use different modifier to modify super class and different modifier has different effect

Terminal

特性真实的虚拟终端 (VT)伪终端 (PTS)
硬件依赖直接与物理硬件(显示器、键盘)交互软件仿真,不直接与物理硬件交互
设备文件/dev/tty1, /dev/tty2 等/dev/pts/0, /dev/pts/1 等
使用场景物理机的控制台登录,无需图形界面图形终端仿真器、远程登录(如 SSH)会话
固定数量通常有 6 个或更多虚拟终端动态创建,按需分配
终端切换方式Ctrl + Alt + F1 到 Ctrl + Alt + F6软件仿真器或通过网络远程连接,如 ssh 登录

通过 /proc/<PID> 可以查看进程的相关信息,一些命令的实现也是基于这个文件

Linux Device Drivers

层次结构

在了解驱动程序的具体内容之前,我们可以首先从 Nvidia GPU 所提供的一些 API 层级入手来理解整体的结构,下图展示了上层应用程序在使用 cudaMalloc 时的调用流程图,其中的重点就是 Runtime API, Driver API 和 驱动程序。

Runtime

在主板上增加 PLX 芯片以提供更多的 PCIe 通道

PCIe 设备插到 PCIe 插槽需要由 PLX 芯片提供支持

一个PCIe插槽在物理层面上确实只能插入一个设备。例如,你只能插入一张显卡或一块SSD到一个PCIe插槽中。但是通过PLX芯片等交换设备,可以让多个PCIe设备通过该插槽共享带宽并同时被RC识别和使用(PLX芯片实际上是在分配带宽,这并没有改变某一时刻 RC 只会和某个插槽上的一台设备进行通信的事实,对于资源有限的PCIe插槽环境比较有意义)

Function Simulator

The key class of function simulator is TopUnit. We can use TopUnit.CycleStep() to begin the execution of simulator.

In CycleStep(), we will call the Frontend() and Backend(), the former is used to update the many types of counters and the latter is used to execute instructions sequence.

In Backend(), we will call the following functions one by one

  • BackendCommit()
  • BackendMemory()
  • BackendExecute()
  • BackendSchedule()

Among all these functions, the third function BackendExecute() will execute all the instructions.

0%