CUDA使用解释器还是编译器? [英] Does CUDA use an interpreter or a compiler?
问题描述
这是一个愚蠢的问题,但我想知道CUDA是否使用解释器或编译器?
我想知道,因为我不太确定CUDA如何管理源代码在具有不同计算能力的两张卡上运行。
This is a bit of silly question, but I'm wondering if CUDA uses an interpreter or a compiler? I'm wondering because I'm not quite sure how CUDA manages to get source code to run on two cards with different compute capabilities.
推荐答案
维基百科:
程序员通过PathScale Open64 C编译器使用C for CUDA(C与Nvidia扩展和某些限制)。
Programmers use 'C for CUDA' (C with Nvidia extensions and certain restrictions), compiled through a PathScale Open64 C compiler.
所以,你的答案是:它使用编译器。
在多张卡片上投放(来源):
And to touch on the reason it can run on multiple cards (source):
CUDA C / C ++提供了一个抽象,它是一种表达你希望程序执行的方式。编译器生成PTX代码,这也不是硬件特定的。在运行时,PTX是为特定目标GPU编译的 - 这是驱动程序的责任,每次发布新的GPU时更新。
CUDA C/C++ provides an abstraction, it's a means for you to express how you want your program to execute. The compiler generates PTX code which is also not hardware specific. At runtime the PTX is compiled for a specific target GPU - this is the responsibility of the driver which is updated every time a new GPU is released.
这篇关于CUDA使用解释器还是编译器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!