Languages Features Creators CSV Resources Challenges Add Language
GitHub icon

CUDA

CUDA - Programming language

< >

CUDA, aka Compute Unified Device Architecture, is a programming language created in 2007.

#49on PLDB 16Years Old 38.6kUsers
35Books 29Papers 18kRepos

CUDA is a parallel computing platform and application programming interface (API) model created by Nvidia. It allows software developers and software engineers to use a CUDA-enabled graphics processing unit (GPU) for general purpose processing – an approach termed GPGPU (General-Purpose computing on Graphics Processing Units). The CUDA platform 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. Read more on Wikipedia...


Example from hello-world:
#include <stdio.h> __global__ void hello_world(){ printf("Hello World\n"); } int main() { hello_world<<<1,1>>>(); return 0; }
// Hello world in CUDA #include <stdio.h> const int N = 16; const int blocksize = 16; __global__ void hello(char *a, int *b) { a[threadIdx.x] += b[threadIdx.x]; } int main() { char a[N] = "Hello \0\0\0\0\0\0"; int b[N] = {15, 10, 6, 0, -11, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; char *ad; int *bd; const int csize = N*sizeof(char); const int isize = N*sizeof(int); printf("%s", a); cudaMalloc( (void**)&ad, csize ); cudaMalloc( (void**)&bd, isize ); cudaMemcpy( ad, a, csize, cudaMemcpyHostToDevice ); cudaMemcpy( bd, b, isize, cudaMemcpyHostToDevice ); dim3 dimBlock( blocksize, 1 ); dim3 dimGrid( 1, 1 ); hello<<<dimGrid, dimBlock>>>(ad, bd); cudaMemcpy( a, ad, csize, cudaMemcpyDeviceToHost ); cudaFree( ad ); cudaFree( bd ); printf("%s\n", a); return EXIT_SUCCESS; }
Example from Linguist:
#include <stdio.h> #include <cuda_runtime.h> /** * CUDA Kernel Device code * * Computes the vector addition of A and B into C. The 3 vectors have the same * number of elements numElements. */ __global__ void vectorAdd(const float *A, const float *B, float *C, int numElements) { int i = blockDim.x * blockIdx.x + threadIdx.x; if (i < numElements) { C[i] = A[i] + B[i]; } } /** * Host main routine */ int main(void) { // Error code to check return values for CUDA calls cudaError_t err = cudaSuccess; // Launch the Vector Add CUDA Kernel int threadsPerBlock = 256; int blocksPerGrid =(numElements + threadsPerBlock - 1) / threadsPerBlock; vectorAdd<<<blocksPerGrid, threadsPerBlock>>>(d_A, d_B, d_C, numElements); err = cudaGetLastError(); if (err != cudaSuccess) { fprintf(stderr, "Failed to launch vectorAdd kernel (error code %s)!\n", cudaGetErrorString(err)); exit(EXIT_FAILURE); } // Reset the device and exit err = cudaDeviceReset(); return 0; }
Example from Wikipedia:
import numpy from pycublas import CUBLASMatrix A = CUBLASMatrix( numpy.mat([[1,2,3]],[[4,5,6]],numpy.float32) ) B = CUBLASMatrix( numpy.mat([[2,3]],[4,5],[[6,7]],numpy.float32) ) C = A*B print C.np_mat()

Language features

Feature Supported Token Example
Comments ✓
/* A comment
*/
MultiLine Comments ✓ /* */
/* A comment
*/
Print() Debugging ✓ printf
Case Insensitive Identifiers X
Semantic Indentation X

Books about CUDA on goodreads

title author year reviews ratings rating
Cuda by Example: An Introduction to General-Purpose Gpu Programming Jason Sanders 2010 13 131 4.03
Professional Cuda C Programming John Cheng 2014 0 7 4.14

Books about CUDA from ISBNdb

title authors year publisher
CUDA by Example: An Introduction to General-Purpose GPU Programming Sanders / Kandrot, Jason 2010 Addison-Wesley Professional
Cuda Handbook Nicholas Wilt 2013 Pearson
CUDA Programming: A Developers Guide to Parallel Computing with GPUs(Chinese Edition) [ MEI ] KU KE ( Shane Cook ) 2014 Machinery Industry Press
CUDA by Example: An Introduction to General-Purpose GPU Programming Sanders, Jason and Kandrot, Edward 2010 Addison-Wesley Professional
Learn CUDA Programming: A beginner's guide to GPU programming and parallel computing with CUDA 10.x and C/C++ Han, Jaegeun and Sharma, Bharatkumar 2019-09-27T00:00:01Z Packt Publishing
Hands-On GPU Programming with Python and CUDA: Explore high-performance parallel computing with CUDA Tuomanen, Dr. Brian 2018 Packt Publishing
Professional CUDA C Programming Cheng, John and Grossman, Max and McKercher, Ty 2014 Wrox
Professional CUDA C Programming Cheng, John and Grossman, Max and McKercher, Ty 2014 Wrox
The CUDA Handbook: A Comprehensive Guide to GPU Programming Wilt, Nicholas Wilt 2013 Addison-Wesley Professional
CUDA Fortran for Scientists and Engineers: Best Practices for Efficient CUDA Fortran Programming Ruetsch, Gregory and Fatica, Massimiliano 2013 Morgan Kaufmann
CUDA Programming: A Developer's Guide to Parallel Computing with GPUs (Applications of Gpu Computing) Cook, Shane 2012 Morgan Kaufmann
CUDA Application Design and Development Farber, Rob 2011 Morgan Kaufmann
CUDA Handbook, The: A Comprehensive Guide to GPU Programming Wilt, Nicholas 2013 Addison-Wesley Professional
CUDA Programming: A Developer's Guide to Parallel Computing with GPUs (Applications of Gpu Computing) Cook, Shane 2012 Morgan Kaufmann
CUDA Application Design and Development Farber, Rob 2011 Morgan Kaufmann
Deep Belief Nets in C++ and CUDA C: Volume 2: Autoencoding in the Complex Domain Masters, Timothy 2018 Apress
Image Processing Using CUDA: Designing an object oriented framework for CUDA based image processing Shete, Pritam and Bose, Surojit Kumar 2012 LAP LAMBERT Academic Publishing
Cuda Winner Charles Brown 2016 Createspace Independent Publishing Platform
Cuda For Newbies Dylan Skinner 2016 Createspace Independent Publishing Platform
Cuda For Engineers Duane Storti 2015 Addison-Wesley Longman, Incorporated
CUDA by Example Jason Sanders and Edward Kandrot 2010 Pearson
Learn CUDA Programming Jaegeun Han and Bharatkumar Sharma 2019-09-27 Packt Publishing
CUDA for Engineers Duane Storti; Mete Yurtoglu 20151102 Pearson Technology Group
Professional CUDA C Programming John Cheng, Max Grossman, Ty McKercher 2014-09-02 Wiley Professional Development (P&T)
Programming in Parallel with CUDA Programming in Parallel with CUDA Richard Ansorge 20220602 Cambridge University Press
CUDA Fortran for Scientists and Engineers: Best Practices for Efficient CUDA Fortran Programming Ruetsch, Gregory; Fatica, Massimiliano 09/2013 Elsevier S & T
GPU Parallel Program Development Using CUDA Tolga Soyata 20180119 Taylor & Francis
Hands-On GPU Programming with Python and CUDA Dr. Brian Tuomanen 27-11-2018 Packt Publishing
Nvidia Gpu Programming: Massively Parallel Programming With Cuda Cook and Shane Wrox
The Cuda Handbook: A Comprehensive Guide To Gpu Programming Wilt, Nicholas , 1970- 2013 Addison-wesley
Deep Belief Nets in C and CUDA C: Volume 3 Timothy Masters 20180704 Springer Nature
Deep Belief Nets in C and CUDA C: Volume 1 Timothy Masters 20180423 Springer Nature
Novel Open Source Morphology Using GPU Processing With LTU- CUDA Jagannathan Gnanasekaran 2019-01-23 LAP LAMBERT Academic Publishing

Publications about CUDA from Semantic Scholar

title authors year citations influentialCitations
CUDA by Example: An Introduction to General-Purpose GPU Programming Jie Cheng 2010 1084 118
accULL: An OpenACC Implementation with CUDA and OpenCL Support Ruymán Reyes and I. López-Rodríguez and J. Fumero and F. Sande 2012 84 2
GPU programming in a high level language: compiling X10 to CUDA D. Cunningham and R. Bordawekar and V. Saraswat 2011 59 8
GPU-accelerated SART reconstruction using the CUDA programming environment B. Keck and H. Hofmann and H. Scherl and M. Kowarschik and J. Hornegger 2009 49 5
CAMPARY: Cuda Multiple Precision Arithmetic Library and Applications M. Joldes and J. Muller and V. Popescu and W. Tucker 2016 37 4
Overview and comparison of OpenCL and CUDA technology for GPGPU Ching-Lung Su and Po-Yu Chen and Chun-Chieh Lan and Lung-Sheng Huang and Kuo-Hsuan Wu 2012 34 1
BARRACUDA: binary-level analysis of runtime RAces in CUDA programs Ariel Eizenberg and Yuanfeng Peng and Toma Pigli and William Mansky and Joseph Devietti 2017 25 7
Efficient compilation of CUDA kernels for high-performance computing on FPGAs Alexandros Papakonstantinou and Karthik Gururaj and J. Stratton and Deming Chen and J. Cong and W. Hwu 2013 22 0
Evolving CUDA PTX programs by quantum inspired linear genetic programming L. F. Cupertino and C. D. Silva and D. M. Dias and M. Pacheco and C. Bentes 2011 14 0
CUDA Expression Templates for Electromagnetic Applications on GPUs [EM Programmer's Notebook] A. Breglia and A. Capozzoli and C. Curcio and A. Liseno 2013 12 0
C2CU : A CUDA C Program Generator for Bulk Execution of a Sequential Algorithm Daisuke Takafuji and K. Nakano and Yasuaki Ito 2014 11 0
Parallelized Seeded Region Growing Using CUDA Seongjin Park and Jeongjin Lee and Hyunna Lee and Juneseuk Shin and Jinwook Seo and K. Lee and Y. Shin and B. H. Kim 2014 9 1
Porting a Legacy CUDA Stencil Code to oneAPI Steffen Christgau and T. Steinke 2020 9 0
Computer vision algorithms acceleration using graphic processors NVIDIA CUDA Mouna Afif and Yahia Said and M. Atri 2020 9 0
SciPAL: Expression Templates and Composition Closure Objects for High Performance Computational Physics with CUDA and OpenMP S. Kramer and J. Hagemann 2015 8 0
Real-time moving human detection using HOG and Fourier descriptor based on CUDA implementation Haythem Bahri and Marwa Chouchene and F. Sayadi and Mohamed Atri 2019 7 0
Using a commercial graphical processing unit and the CUDA programming language to accelerate scientific image processing applications R. Broussard and R. Ives 2011 7 0
Efficient 2D Convolution Filters Implementations on Graphics Processing Unit Using NVIDIA CUDA Mouna Afif and Yahia Said and Mohamed Atri 2018 6 0
Breast Cancer Prediction by Logistic Regression with CUDA Parallel Programming Support Aless and R. Peretti and F. Amenta 2016 5 0
Efficient implementation of integrall image algorithm on NVIDIA CUDA Mouna Afif and Yahia Said and Mohamed Atri 2018 3 0
Document clustering using Multi-Objective Genetic Algorithms with parallel programming based on CUDA Jung Song Lee and Soon-cheol Park and Jong-Joo Lee and Han-hee Ham 2014 3 0
Programming in CUDA for Kepler and Maxwell Architecture E. Clua and M. Zamith 2015 3 1
Research on Matrix Multiplication Based on the Combination of OpenACC and CUDA Yuexing Wang 2018 2 0
A Performance Study of Random Neural Network as Supervised Learning Tool Using CUDA S. Basterrech and J. Janousek and V. Snášel 2016 2 0
GPU accelerated foreground segmentation using CodeBook model and shadow removal using CUDA Praveen Gudivaka and N. Mishra and A. Agrawal 2017 2 0
Impact of CUDA and OpenCL on Parallel and Distributed Computing A. Asaduzzaman and Alec Trent and S. Osborne and C. Aldershof and F. Sibai 2021 2 0
Cuda Parallelization of Commit Framework for Efficient Microstructure-Informed Tractography Erick Hernandez-Gutierrez and Alonso Ramirez-Manzanares and J. Marroquín and Mario Ocampo-Pineda and Alessandro Daducci 2019 1 0
Detecting Undefined Behaviors in CUDA C Wentao Li and Jianhua Sun and Hao Chen 2019 1 0
A Compiler Translate Directive-Based Language to Optimized CUDA Feng Li and Hong An and Weihao Liang and Xiaoqiang Li and Yichao Cheng and Xia Jiang 2014 1 0
erlang.html · cuda.html · scheme.html

View source

- Build the next great programming language · Search · Day 209 · About · Blog · Acknowledgements · Traffic · Traffic Today · GitHub · feedback@pldb.com