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.

Heterogeneous Compilation

CUDA Compilation 不同在于

The tools used in the CUDA compilation are all closed source except gcc, g++ etc., for example fatbinary and nvlink. We need to substitue these tools to tools in clang system.

  1. Clang Offload Bundler is used to combined different code for different machine structurel.
  2. Clang Offload Packager is used to embed device code into host code.
  3. Clang Linker Wrapper is used to .

这里面最复杂的感觉是怎么处理链接关系,如果仅仅说代码嵌入,从 CUDA 的流程来看,在 cudafe1.cpp include stub.c 生成 .o 这一步中 host code 中就已经包含了 device code,如果仅仅说 embed 的话,这显然就已经完成了,但是为何 CUDA 还进行后续那么多步骤,因为这一步生成的 .o 显然是无法运行的,device code 都还只是一个 extern signal,还需要同 CUDA runtime library 进行链接,这个过程该怎么进行比较难想。

0%