Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
几个 CUDA 函数名称中包含 Symbol 一词。
e.g. cudaMemcpyToSymbol() , cudaMemcpyFromSymbol(), cudaGetSymbolAddress() etc.
编程指南中对这些函数的作用的解释非常清楚。我没有得到的是在命名这些函数时选择“符号”这个词。这是什么意思?
他们使用“符号”一词,因为这些函数可以将设备变量的名称作为字符串。例如:
cudaMemcpyToSymbol("my_var_d", my_var_h, sizeof(my_var_d));
据推测,这种奇怪的语法允许一些我还没有想到的用例:)
这个“符号”是一个设备变量。