主机软件

CUDA C++ 编程语言CUDA C++ programming language

CUDA C++ 是 CUDA 编程模型 的一种实现,作为 C++ 编程语言的扩展。

为实现 CUDA 编程模型,CUDA C++ 为 C++ 语言添加了若干特性,具体如下:

CUDA C++ 程序的编译由主机端 C/C++ 编译器(如 gcc)与 NVIDIA CUDA 编译器驱动 nvcc 共同编译。

有关如何在 Modal 上使用 CUDA C++ 的信息,请参阅本指南

英文原文(Modal GPU Glossary)

CUDA C++ is an implementation of the CUDA programming model as an extension of the C++ programming language.

CUDA C++ adds several features to C++ to implement the CUDA programming model, including:

  • Kernel definition with
  • __global__*. CUDA kernels are
  • implemented as C++ functions that take in pointers and have return type
  • void, annotated with this keyword.
  • Kernel launches with <<<>>>.
  • Kernels are executed from the CPU host
  • using a triple bracket syntax that sets the
  • thread block grid
  • dimensions.
  • Shared memory allocation
  • with the shared keyword, barrier synchronization with the
  • __syncthreads() intrinsic function, and
  • thread block* and
  • thread indexing* with the
  • blockDim and threadIdx built-in variables.

CUDA C++ programs are compiled by a combination of host C/C++ compiler drivers like gcc and the NVIDIA CUDA Compiler Driver, nvcc.

For information on how to use CUDA C++ on Modal, see this guide.

相关词条

本词条改编自 Modal GPU Glossary(CC BY 4.0)· 中文翻译 miter6/gpu-glossary-zh,MAE 整理排版。