In computing, CUDA is a proprietary[1]parallel computing platform and application programming interface (API) that allows software to use certain types of graphics processing units (GPUs) for accelerated general-purpose processing, an approach called general-purpose computing on GPUs. CUDA was created by Nvidia in 2006.[2] When it was first introduced, the name was an acronym for Compute Unified Device Architecture,[3] but Nvidia later dropped the common use of the acronym and now rarely expands it.[4]
CUDA is a software layer that gives direct access to the GPU's virtual instruction set and parallel computational elements for the execution of compute kernels.[5] In addition to drivers and runtime kernels, the CUDA platform includes compilers, libraries and developer tools to help programmers accelerate their applications.
CUDA is designed to work with programming languages such as C, C++, Fortran and Python. This accessibility makes it easier for specialists in parallel programming to use GPU resources, in contrast to prior APIs like Direct3D and OpenGL, which require advanced skills in graphics programming.[6] CUDA-powered GPUs also support programming frameworks such as OpenMP, OpenACC and OpenCL.[7][5]
The graphics processing unit (GPU), as a specialized computer processor, addresses the demands of real-time high-resolution 3D graphics compute-intensive tasks. By 2012, GPUs had evolved into highly parallel multi-core systems allowing efficient manipulation of large blocks of data. This design is more effective than general-purpose central processing unit (CPUs) for algorithms in situations where processing large blocks of data is done in parallel, such as:
Ian Buck, while at Stanford in 2000, created an 8K gaming rig using 32 GeForce cards, then obtained a DARPA grant to perform general purpose parallel programming on GPUs. He then joined Nvidia, where since 2004 he has been overseeing CUDA development. In pushing for CUDA, Jensen Huang aimed for the Nvidia GPUs to become a general hardware for scientific computing. CUDA was released in 2007. Around 2015, the focus of CUDA changed to neural networks.[8]
Ontology
The following table offers a non-exact description for the ontology of CUDA framework.
Copy the resulting data from GPU memory to main memory
The CUDA platform is accessible to software developers through CUDA-accelerated libraries, compiler directives such as OpenACC, and extensions to industry-standard programming languages including C, C++, Fortran and Python. C/C++ programmers can use 'CUDA C/C++', compiled to PTX with nvcc, Nvidia's LLVM-based C/C++ compiler, or by clang itself.[9] Fortran programmers can use 'CUDA Fortran', compiled with the PGI CUDA Fortran compiler from The Portland Group.[needs update] Python programmers can use the cuNumeric library to accelerate applications on Nvidia GPUs.
CUDA provides both a low level API (CUDA Driver API, non single-source) and a higher level API (CUDA Runtime API, single-source). The initial CUDA SDK was made public on 15 February 2007, for Microsoft Windows and Linux. Mac OS X support was later added in version 2.0,[17] which supersedes the beta released February 14, 2008.[18] CUDA works with all Nvidia GPUs from the G8x series onwards, including GeForce, Quadro and the Tesla line. CUDA is compatible with most standard operating systems.
CUDA 8.0 comes with the following libraries (for compilation & runtime, in alphabetical order):
cuBLAS – CUDA Basic Linear Algebra Subroutines library
CUDART – CUDA Runtime library
cuFFT – CUDA Fast Fourier Transform library
cuRAND – CUDA Random Number Generation library
cuSOLVER – CUDA based collection of dense and sparse direct solvers
cuSPARSE – CUDA Sparse Matrix library
NPP – NVIDIA Performance Primitives library
nvGRAPH – NVIDIA Graph Analytics library
NVML – NVIDIA Management Library
NVRTC – NVIDIA Runtime Compilation library for CUDA C++
CUDA 8.0 comes with these other software components:
nView – NVIDIA nView Desktop Management Software
NVWMI – NVIDIA Enterprise Management Toolkit
GameWorks PhysX – is a multi-platform game physics engine
CUDA 9.0–9.2 comes with these other components:
CUTLASS 1.0 – custom linear algebra algorithms,
NVIDIA Video Decoder was deprecated in CUDA 9.2; it is now available in NVIDIA Video Codec SDK
CUDA 10 comes with these other components:
nvJPEG – Hybrid (CPU and GPU) JPEG processing
CUDA 11.0–11.8 comes with these other components:[19][20][21][22]
CUDA has several advantages over traditional general-purpose computation on GPUs (GPGPU) using graphics APIs:
Scattered reads – code can read from arbitrary addresses in memory.
Unified virtual memory (CUDA 4.0 and above)
Unified memory (CUDA 6.0 and above)
Shared memory – CUDA exposes a fast shared memory region that can be shared among threads. This can be used as a user-managed cache, enabling higher bandwidth than is possible using texture lookups.[23]
Faster downloads and readbacks to and from the GPU
Full support for integer and bitwise operations, including integer texture lookups
Limitations
Whether for the host computer or the GPU device, all CUDA source code is now processed according to C++ syntax rules.[24] This was not always the case. Earlier versions of CUDA were based on C syntax rules.[25] As with the more general case of compiling C code with a C++ compiler, it is therefore possible that old C-style CUDA source code will either fail to compile or will not behave as originally intended.
Interoperability with rendering languages such as OpenGL is one-way, with OpenGL having access to registered CUDA memory but CUDA not having access to OpenGL memory.
Copying between host and device memory may incur a performance hit due to system bus bandwidth and latency (this can be partly alleviated with asynchronous memory transfers, handled by the GPU's DMA engine).
Threads should be running in groups of at least 32 for best performance, with total number of threads numbering in the thousands. Branches in the program code do not affect performance significantly, provided that each of 32 threads takes the same execution path; the SIMD execution model becomes a significant limitation for any inherently divergent task (e.g. traversing a space partitioning data structure during ray tracing).
No emulation or fallback functionality is available for modern revisions.
Valid C++ may sometimes be flagged and prevent compilation due to the way the compiler approaches optimization for target GPU device limitations.[citation needed]
C++ run-time type information (RTTI) and C++-style exception handling are only supported in host code, not in device code.
In single-precision on first generation CUDA compute capability 1.x devices, denormal numbers are unsupported and are instead flushed to zero, and the precision of both the division and square root operations are slightly lower than IEEE 754-compliant single precision math. Devices that support compute capability 2.0 and above support denormal numbers, and the division and square root operations are IEEE 754 compliant by default. However, users can obtain the prior faster gaming-grade math of compute capability 1.x devices if desired by setting compiler flags to disable accurate divisions and accurate square roots, and enable flushing denormal numbers to zero.[26]
Unlike OpenCL, CUDA-enabled GPUs are only available from Nvidia as it is proprietary.[27][1] Attempts to implement CUDA on other GPUs include:
Project Coriander: Converts CUDA C++11 source to OpenCL 1.2 C. A fork of CUDA-on-CL intended to run TensorFlow.[28][29][30]
GPUOpen HIP: A thin abstraction layer on top of CUDA and ROCm intended for AMD and Nvidia GPUs. Has a conversion tool for importing CUDA C++ source. Supports CUDA 4.0 plus C++11 and float16.
ZLUDA is a drop-in replacement for CUDA on AMD GPUs and formerly Intel GPUs with near-native performance.[32] The developer, Andrzej Janik, was separately contracted by both Intel and AMD to develop the software in 2021 and 2022, respectively. However, neither company decided to release it officially due to the lack of a business use case. AMD's contract included a clause that allowed Janik to release his code for AMD independently, allowing him to release the new version that only supports AMD GPUs.[33]
chipStar can compile and run CUDA/HIP programs on advanced OpenCL 3.0 or Level Zero platforms.[34]
Example
This example code in C++ loads a texture from an image into an array on the GPU:
texture<float,2,cudaReadModeElementType>tex;voidfoo(){cudaArray*cu_array;// Allocate arraycudaChannelFormatDescdescription=cudaCreateChannelDesc<float>();cudaMallocArray(&cu_array,&description,width,height);// Copy image data to arraycudaMemcpyToArray(cu_array,image,width*height*sizeof(float),cudaMemcpyHostToDevice);// Set texture parameters (default)tex.addressMode[0]=cudaAddressModeClamp;tex.addressMode[1]=cudaAddressModeClamp;tex.filterMode=cudaFilterModePoint;tex.normalized=false;// do not normalize coordinates// Bind the array to the texturecudaBindTextureToArray(tex,cu_array);// Run kerneldim3blockDim(16,16,1);dim3gridDim((width+blockDim.x-1)/blockDim.x,(height+blockDim.y-1)/blockDim.y,1);kernel<<<gridDim,blockDim,0>>>(d_data,height,width);// Unbind the array from the texturecudaUnbindTexture(tex);}//end foo()__global__voidkernel(float*odata,intheight,intwidth){unsignedintx=blockIdx.x*blockDim.x+threadIdx.x;unsignedinty=blockIdx.y*blockDim.y+threadIdx.y;if(x<width&&y<height){floatc=tex2D(tex,x,y);odata[y*width+x]=c;}}
Below is an example given in Python that computes the product of two arrays on the GPU. The unofficial Python language bindings can be obtained from PyCUDA.[35]
importpycuda.compilerascompimportpycuda.driverasdrvimportnumpyimportpycuda.autoinitmod=comp.SourceModule("""__global__ void multiply_them(float *dest, float *a, float *b){ const int i = threadIdx.x; dest[i] = a[i] * b[i];}""")multiply_them=mod.get_function("multiply_them")a=numpy.random.randn(400).astype(numpy.float32)b=numpy.random.randn(400).astype(numpy.float32)dest=numpy.zeros_like(a)multiply_them(drv.Out(dest),drv.In(a),drv.In(b),block=(400,1,1))print(dest-a*b)
Additional Python bindings to simplify matrix multiplication operations can be found in the program pycublas.[36]
This section needs to be updated. The reason given is: Missing CUDA compute capability 10.x (Blackwell). Please help update this article to reflect recent events or newly available information.(March 2024)
Feature support (unlisted features are supported for all compute capabilities)
oneAPI is an initiative based in open standards, created to support software development for multiple hardware architectures.[117] The oneAPI libraries must implement open specifications that are discussed publicly by the Special Interest Groups, offering the possibility for any developer or organization to implement their own versions of oneAPI libraries.[118][119]
Originally made by Intel, other hardware adopters include Fujitsu and Huawei.
Unified Acceleration Foundation (UXL)
Unified Acceleration Foundation (UXL) is a new technology consortium working on the continuation of the OneAPI initiative, with the goal to create a new open standard accelerator software ecosystem, related open standards and specification projects through Working Groups and Special Interest Groups (SIGs). The goal is to offer open alternatives to Nvidia's CUDA. The main companies behind it are Intel, Google, ARM, Qualcomm, Samsung, Imagination, and VMware.[120]
SYCL – an open standard from Khronos Group for programming a variety of platforms, including GPUs, with single-source modern C++, similar to higher-level CUDA Runtime API (single-source)
BrookGPU – the Stanford University graphics group's compiler
^In the Whitepapers the Tensor Core cube diagrams represent the Dot Product Unit Width into the height (4 FP16 for Volta and Turing, 8 FP16 for A100, 4 FP16 for GA102, 16 FP16 for GH100). The other two dimensions represent the number of Dot Product Units (4x4 = 16 for Volta and Turing, 8x4 = 32 for Ampere and Hopper). The resulting gray blocks are the FP16 FMA operations per cycle. Pascal without Tensor core is only shown for speed comparison as is Volta V100 with non-FP16 datatypes.
^No more than one scheduler can issue 2 instructions at once. The first scheduler is in charge of warps with odd IDs. The second scheduler is in charge of warps with even IDs.
^Note that Jia, Zhe; Maggioni, Marco; Smith, Jeffrey; Daniele Paolo Scarpazza (2019). "Dissecting the NVidia Turing T4 GPU via Microbenchmarking". arXiv:1903.07486 [cs.DC]. disagrees and states 2 KiB L0 instruction cache per SM partition and 16 KiB L1 instruction cache per SM
Artikel ini tidak memiliki referensi atau sumber tepercaya sehingga isinya tidak bisa dipastikan. Tolong bantu perbaiki artikel ini dengan menambahkan referensi yang layak. Tulisan tanpa sumber dapat dipertanyakan dan dihapus sewaktu-waktu.Cari sumber: Mohd Fadhli Mohd Shas – berita · surat kabar · buku · cendekiawan · JSTOR Mohd Fadhli Mohd ShasInformasi pribadiNama lengkap Mohd Fadhli bin Mohd ShasTanggal lahir 21 Januari 1991 (umur 33)Tempat la...
دورة فرنسا المفتوحة 1983 - فردي السيدات جزء من دورة فرنسا المفتوحة 1983 رقم الفعالية 76 البلد فرنسا التاريخ 1983 الرياضة كرة المضرب البطل(ة) كريس إيفرت الوصيف(ة) ميما ياوشوفيتس النتيجة 6–1، 6–2 دورة فرنسا المفتوحة 1982 - فردي السيدات دورة فرنسا المفتوحة 1984 - فردي ال...
Artikel ini sebatang kara, artinya tidak ada artikel lain yang memiliki pranala balik ke halaman ini.Bantulah menambah pranala ke artikel ini dari artikel yang berhubungan atau coba peralatan pencari pranala.Tag ini diberikan pada November 2022. George Thatcher George Thatcher (12 April 1754 – 6 April 1824) adalah seorang pengacara, yuris, dan negarawan Amerika Serikat dari distrik Maine, Massachusetts. Namanya terkadang ditulis sebagai George Thacher. Ia merupakan delegasi un...
Artikel ini memerlukan pemutakhiran informasi. Harap perbarui artikel dengan menambahkan informasi terbaru yang tersedia. Homoseksual legal Pembatasan kebebasan berekspresi Pernikahan sesama jenis Tipe berpasangan lain (atau pasangan tak terdaftar) Pernikahan sesama jenis asing diakui2 Pasangan sesama jenis tidak diakui Homoseksual ilegal Penjara, tidak diterapkan1 Penjara, diterapkan dengan penangkapan atau ...
Artikel ini membutuhkan rujukan tambahan agar kualitasnya dapat dipastikan. Mohon bantu kami mengembangkan artikel ini dengan cara menambahkan rujukan ke sumber tepercaya. Pernyataan tak bersumber bisa saja dipertentangkan dan dihapus.Cari sumber: Itanagar – berita · surat kabar · buku · cendekiawan · JSTOR Letak Itanagar di Arunachal Pradesh Itanagar merupakan sebuah kota di India. Kota ini letaknya di bagian timur laut. Tepatnya di negara bagian Arun...
العلاقات اليمنية البحرينية البحرين اليمن السفارات سفارة البحرين في اليمن العنوان : صنعاء سفارة اليمن في البحرين العنوان : المنامة تعديل مصدري - تعديل العلاقات اليمنية البحرينية هي العلاقات الثنائية بين الحكومة اليمنية وحكومة البحر�...
يفتقر محتوى هذه المقالة إلى الاستشهاد بمصادر. فضلاً، ساهم في تطوير هذه المقالة من خلال إضافة مصادر موثوق بها. أي معلومات غير موثقة يمكن التشكيك بها وإزالتها. (نوفمبر 2019) الدوري اليوناني 1973–74 تفاصيل الموسم الدوري اليوناني النسخة 15، و38 البلد اليونان المنظم الات�...
RanunculalesRentang fosil: 124–0 jtyl PreЄ Є O S D C P T J K Pg N Kapur Awal–Sekarang Klasifikasi ilmiah Kerajaan: Plantae (tanpa takson): Tracheophyta (tanpa takson): Angiospermae (tanpa takson): Eudikotil Ordo: Ranunculales Famili lihat teks. Ranunculales adalah salah satu ordo tumbuhan berbunga yang termasuk dalam klad Eudikotil menurut Sistem klasifikasi APG II). Bangsa ini juga diakui sebagai ordo dalam sistem klasifikasi Cronquist yang tercakup dalam anak kelas Magnoliidae. ...
British racing driver (born 1954) Jeff AllamAllam in 2017Nationality BritishBorn (1954-12-19) 19 December 1954 (age 69)Epsom, Surrey, EnglandBritish Saloon / Touring Car ChampionshipYears active16TeamsAllam Motor ServicesTriplex Esso Motor TeamTom Walkinshaw RacingR.A. Potter Racing DevelopmentsTrakstar MotorsportVic Lee MotorsportDave Cook Racing ServicesRay Mallock Ltd.Starts146Wins17Poles9Fastest laps23Best finish4th in 1977, 1982, 1992 Jeffrey Frank Allam (born 19 December 1954 in Ep...
Lauro Toneatto Toneatto sulla panchina del Bari negli anni 1960 Nazionalità Italia Calcio Ruolo Allenatore (ex difensore) Termine carriera 1963 - giocatore1989 - allenatore Carriera Squadre di club1 1953-1955 Empoli60 (0)1955-1963 Siena202 (3) Carriera da allenatore 1964-1966 Siena1966-1969 Bari1969-1970 Pisa1970-1972 Bari1972-1975 Foggia1975-1976 Arezzo1976-1978 Cagliari1978-1979 Sambenedettese1979-1980 Sampdoria1980-1981 Pi...
Protected area in North Yorkshire, England Farndale Local Nature ReserveDaffodils in FarndaleLocationReserveCoordinates54°21′32″N 0°58′18″W / 54.35889°N 0.97167°W / 54.35889; -0.97167Owned byNorth York Moors National ParkPlantsWild daffodils Farndale Local Nature Reserve is a Local Nature Reserve (LNR) in the valley of Farndale, North Yorkshire, England. It is located within the North York Moors National Park region and is looked after by the North Yo...
Georgy Ketoev Ketoev in 2012 Medal record Representing Armenia World Championships 2017 Paris 97 kg Representing Russia Men's Freestyle wrestling Olympic Games 2008 Beijing 84 kg World Championships 2007 Baku 84 kg European Championships 2008 Tampere 84 kg 2009 Vilnius 96 kg Georgy Ketoyev (Ossetian: Четиты Важайы фырт Геуæрги; born 19 November 1985 in Tbilisi, Georgian SSR) is a Russian-born Armenian freestyle wrestler. He won a bronze medal at the 2008 Su...
Style of building Buddha statue in Borobudur (Indonesia), the world's largest Buddhist temple. Buddhist religious architecture developed in the Indian subcontinent. Three types of structures are associated with the religious architecture of early Buddhism: monasteries (viharas), places to venerate relics (stupas), and shrines or prayer halls (chaityas, also called chaitya grihas), which later came to be called temples in some places. The initial function of a stupa was the veneration and safe...
Battle in the Middle East First Battle of RamlaPart of the CrusadesBaldwin I of JerusalemDate7 September 1101LocationRamlaResult Crusader victoryBelligerents Kingdom of Jerusalem Fatimid CaliphateCommanders and leaders Baldwin I of Jerusalem Sa'd al-Dawla al-Qawwasi[1][2]Strength 1,160[3][4] 260 knights900 infantry Modern estimates: 3,000–5,000[5] Contemporary sources:32,000[3] 11,000 cavalry21,000 infantryCasualties and losses 80 ...
American home video distribution company The Criterion Collection, Inc.Company typePrivately held companyIndustryMotion picture video productionFounded1984; 40 years ago (1984)FoundersRobert SteinAleen SteinJoe MedjuckHeadquartersNew York City, New York, U.S.[1]Area servedUnited Kingdom (Europe)United States, Canada (North America)Key peopleJonathan B. Turell(CEO)[1]Peter Becker(President)[2]ProductsLaserDisc (1984–1999)VHS and Betamax (1985, 1989)D...
Canadian river in Alberta Athabasca RiverAthabasca River in Jasper National ParkAthabasca River watershed in western CanadaLocationCountryCanadaProvinceAlbertaPhysical characteristicsSourceColumbia Icefield • locationJasper National Park • coordinates52°10′4″N 117°25′50″W / 52.16778°N 117.43056°W / 52.16778; -117.43056 • elevation1,520 m (4,990 ft)(foot of glacier) MouthLake Athabasca ̶...
Pour les articles homonymes, voir Nazca. Plaque de Nazca Éponyme Nazca Composition Lithosphère océanique Frontières Fosse du Pérou et Chili, dorsales des Galápagos, du Pacifique Est et du Chili Superficie 0,39669 stéradians Déplacement · Direction : · Vitesse : nord-est7,55 cm/an(référentiel : plaque africaine) Rotation · Vitesse : · Pôle eulérien : 1,359 9 °/Ma55° 58′ N 90° 10′ O(référentiel : plaque pac...