TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: C++ still dominates on GPUs, why not Rust?

11 点作者 Ambix将近 2 年前
From what I know, modern GPUs are still programmed with C++ exclusively. See CUDA [0] for Nvidia and ROCm [1] for AMD.<p>Why is this? Why Rust is not loved there?<p>[0] https:&#x2F;&#x2F;docs.nvidia.com&#x2F;cuda&#x2F;<p>[1] https:&#x2F;&#x2F;github.com&#x2F;ROCm-Developer-Tools&#x2F;HIP

2 条评论

thesuperbigfrog将近 2 年前
&gt;&gt; Why is this? Why Rust is not loved there?<p>History and demand.<p>CUDA is about 15 years old. MPI and similar parallel computing APIs are even older.<p>C, C++, and Fortran have been the &quot;goto&quot; programming languages for parallel and scientific computing for decades.<p>Rust is a relative newcomer that does not have enough demand yet to mandate CUDA APIs. It probably will some day.<p>Another concern is the number of decades-mature libraries that are used in parallel computing domains. It seems much more likely that any Rust support will initially be Rust wrappers around C or C++ APIs rather than native Rust implementations.<p>Some projects for Rust on CUDA are in progress:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;Rust-GPU&#x2F;Rust-CUDA">https:&#x2F;&#x2F;github.com&#x2F;Rust-GPU&#x2F;Rust-CUDA</a><p><a href="https:&#x2F;&#x2F;github.com&#x2F;bheisler&#x2F;RustaCUDA">https:&#x2F;&#x2F;github.com&#x2F;bheisler&#x2F;RustaCUDA</a>
ActorNightly将近 2 年前
GPU programming =&#x2F;= CPU programming. GPUs don&#x27;t have complex execution paths with branching, and the programs that run are &quot;memory safe&quot; in the sense of what Rust aims to improve.