2020 年 CUDA 驱动程序 API 与运行时 API

CUDA Driver API vs Runtime API in 2020

十多年前,a great question about the pros and cons of the CUDA Driver API vs Runtime API

很明显时间过去了,我想知道发生了多少变化。如果您使用与 API.

接口的多个线程,那么旧问题对运行时 API 的问题有很好的回答

还有问题吗?大多数为 GPU 编写代码的人现在使用什么?我刚开始使用 CUDA,想知道我是否应该更喜欢一个 API 而不是另一个。我正在使用多个线程和上下文,如果这有所不同的话。

The old question had a great answer about things that were problematic with the runtime API if you used multiple threads that interfaced with the API.

Is that still problematic?

没有。 CUDA 4 发布时API 修复了运行时的线程安全

What do most folks writing code for GPUs use now?

一个权威的答案需要对开发者行为进行调查,除了 NVIDIA 之外,可能没有人会进行调查,而且我从未见过类似的发布。

我猜绝大多数人都使用运行时 API。我也猜压倒性的专业总是使用运行时 API。在某些用例中,驱动程序 API 仍然更有意义,但一如既往地使用运行时 API 未公开的特定设施。它们与线程安全无关,