Nvidia CUDA Compiler: Difference between revisions

Content deleted Content added
No edit summary
 
(24 intermediate revisions by 18 users not shown)
Line 1:
{{Short description|Proprietary compiler by Nvidia}}
{{Infobox software
| name =
| title =
| logo = <!-- ImageFile name is enoughonly -->
| logo caption =
| logo size =
| logo_size =
| logo alt =
| logo_alt =
| screenshot = <!-- ImageFile name is enoughonly -->
| caption =
| screenshot size =
| screenshot_size =
| screenshot alt =
| screenshot_alt =
| author = <!-- Human name(s) -->
| collapsible =
| author developer = [[Nvidia]]
| released = <!-- {{Start date and age|YYYY2007|MM|DD|df=yes/no06}} -->
| developer =
| latest release version = 12.6.0
| released = <!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} -->
| latest release date = <!-- {{Start date and age|YYYY2024|MM|DD|df=yes/no08}} -->
| discontinued =
| latest release version =
| latest release date = <!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} -->
| latest preview version =
| latest preview date = <!-- {{Start date and age|YYYY2024|MM|DD|df=yes/no08}} -->
| programming language = <!-- =[[C++]]? -->
| status =
| operating system =
| programming language =
| platform =
| operating system =
| size =
| platform =
| language = English
| size =
| language count = <!-- DO NOT include this parameter unless you know what it does = -->
| language footnote =
| language count = <!-- DO NOT include this parameter unless you know what it does -->
| genre = [[Compiler]]
| language footnote =
| license = [[Proprietary software|Proprietary]]
| genre = [[compiler]]
| website = {{URL|http://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/#introduction}}
| license = [[proprietary software]]
| website = {{URL|http://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/#introduction}}
}}
 
''' Nvidia CUDA Compiler''' ('''NVCC''') is a [[compiler]] by [[Nvidia]] intended for use with [[CUDA]]. It is [[proprietary software]].
''' Nvidia CUDA Compiler''' ('''NVCC''') is a [[proprietary software|proprietary]] [[compiler]] by [[Nvidia]] intended for use with [[CUDA]]. CUDA codes runs on both the [[CPU]] and [[GPU]]. NVCC separates these two parts and sends host code (the part of code which will be run on the [[CPU]]) to a [[C (programming language)|C]] compiler like [[GNU Compiler Collection|GCC]] or [[Intel C++ Compiler]] (ICC) or [[Microsoft Visual C]] Compiler, and sends the device code (the part which will run on the GPU) to the GPU. The device code is further compiled by NVCC.
 
==Compiler==
Any source file containing CUDA language extensions (.cu) must be compiled with nvcc. NVCC is a compiler driver which works by invoking all the necessary tools and compilers like cudacc, g++, cl, etc. NVCC can output either C code (CPU Code) that must then be compiled with the rest of the application using another tool or PTX or object code directly. An executable with CUDA code requires: the CUDA core library (cuda) and the CUDA runtime library (cudart).
CUDA code runs on both the [[central processing unit]] (CPU) and [[graphics processing unit]] (GPU). NVCC separates these two parts and sends host code (the part of code which will be run on the [[CPU]]) to a [[C (programming language)|C]] compiler like [[GNU Compiler Collection]] (GCC) or [[Intel C++ Compiler]] (ICC) or [[Microsoft Visual C++]] Compiler (MVCC), and sends device code called "kernels" (the part which will run on the GPU) to the GPU. The device code is further compiled by NVCC. NVCC is based on [[LLVM]].<ref>{{cite web|title=CUDA LLVM Compiler |url=https://developer.nvidia.com/cuda-llvm-compiler|publisher=Nvidia Developer |access-date=Apr 6, 2016}}</ref> According to Nvidia provided documentation, nvcc in version 7.0 supports many language constructs that are defined by the [[C++11]] standard, and a few from [[C99]]. In version 9.0, several more constructs from the [[C++14]] standard are added.<ref>{{Cite web|url=https://docs.nvidia.com/cuda/cuda-c-programming-guide/|title=CUDA C++ Programming Guide |website=NVIDIA Documentation Hub |language=en-us|access-date=2019-06-28}}</ref>
 
Any source file containing CUDA language extensions (.cu) must be compiled with nvcc. NVCC is a compiler driver which works by invoking all the necessary tools and compilers like cudacc, g++, cl, etc. NVCC can output either C code (CPU Code) that must then be compiled with the rest of the application using another tool or [[Parallel Thread Execution]] (PTX) or object code directly. An executable with CUDA code requires: the CUDA core [[Library (computing)|library]] (cuda) and the CUDA runtime library (cudart).
 
Other widely used libraries:
Line 45 ⟶ 46:
* [[OpenCL]]
* [[Heterogeneous System Architecture]]
* [[CUDA binary]] (cubin) – a type of fat binary
 
== References ==
{{Reflist}}
 
===General===
# David B. Kirk, and Wen-mei W. Hwu. Programming massively parallel processors: a hands-on approach. Morgan Kaufmann, 2010.
# {{Cite web |title=Nvidia DocumentationCUDA onCompiler nvccDriver NVCC |url=https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/ http|url-status=live |archive-url=https://web.archive.org/web/20231013194328/https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/ |archive-date=Oct 13, 2023 |website=Nvidia Documentation Hub}}
# {{Cite web |title=CUDPP |url=http://gpgpu.org/developer/cudpp |url-status=dead |archive-url=https://web.archive.org/web/20181117222643/http://gpgpu.org/developer/cudpp |archive-date=Nov 17, 2018 |website=GPGPU}}
# CUDPP. http://gpgpu.org/developer/cudpp
 
== External links ==
[[Category:Nvidia]]
*{{Official website|docs.nvidia.com/cuda/cuda-compiler-driver-nvcc}}
[[Category:Compilers]]
 
[[Category:Nvidia software]]
{{computer-stub}}
[[Category:Compilers]]