Before the program running, static loader or dynamic loader need to initialize the content of the progress stack which is stipulated by System V Application Binary Interface.
Program Loading
ELF File Format Analysis
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.
- Clang Offload Bundler is used to combined different code for different machine structurel.
- Clang Offload Packager is used to embed device code into host code.
- 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 进行链接,这个过程该怎么进行比较难想。
Several Methods for Obtaining Time
We can reference this article
About the last method that using rdtsc assembly command to obtain time, there are some error prone points, we can reference to this article.
If you want to learn about the TST, please reference to this article.