在「Using Libc for GPUs (llvm.org)」這邊看到的,本來在想是個路人的噱頭 project,但仔細看才發現是 LLVM libc 官方的文件:「Using libc for GPUs」。
不是所有的 libc 函數都被 porting 上去,但從列出來的支援清單可以看到主要就是計算類會用到的,但還是有包括一些 I/O (stdio.h
) 與時間 (time.h
) 相關的函數:
Once you have finished building the GPU C library it can be used to run libc or libm functions directly on the GPU. Currently, not all C standard functions are supported on the GPU. Consult the list of supported functions for a comprehensive list.
不過這些運算在 OpenCL 也有支援,只是用法上跟 libc 的有差異...