我正在一台具有四个核心CPU的机器上运行cuda程序,如何更改cuda c程序以使用所有四个核心和所有可用的GPU?
我的意思是我的程序在 GPU 上计算之前也会在主机端执行操作...
谢谢!
最佳答案
CUDA 无意执行此操作。 CUDA 的目的是提供对GPU的访问以进行并行处理。它不会使用您的 CPU 核心。
来自What is CUDA?页面:
CUDA is NVIDIA’s parallel computing architecture that enables dramatic increases in computing performance by harnessing the power of the GPU (graphics processing unit).
这应该通过更传统的多线程技术来处理。
关于c - nvidia cuda使用机器的所有核心,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2255146/