CUDA is a parallel computing platform and programming model created by NVIDIA and implemented
by the graphics processing units that they produce.
CUDA gives program developers direct access to the virtual instruction set and memory
of the parallel computational elements in CUDA GPUs.
Using CUDA, the GPUs can be used for general purpose processing; this approach is known
as GPGPU.
Unlike CPUs, however, GPUs have a parallel throughput architecture that emphasizes executing
many concurrent threads slowly, rather than executing a single thread very quickly.
The CUDA platform is accessible to software developers through CUDA-accelerated libraries,
compiler directives, and extensions to industry-standard programming languages, including C, C++ and
Fortran. C/C++ programmers use 'CUDA C/C++', compiled with "nvcc", NVIDIA's LLVM-based
C/C++ compiler, and Fortran programmers can use 'CUDA Fortran', compiled with the PGI
CUDA Fortran compiler from The Portland Group.
In addition to libraries, compiler directives, CUDA C/C++ and CUDA Fortran, the CUDA platform
supports other computational interfaces, including the Khronos Group's OpenCL, Microsoft's DirectCompute,
and C++ AMP.
Third party wrappers are also available for Python, Perl, Fortran, Java, Ruby, Lua, Haskell,
MATLAB, IDL, and native support in Mathematica.
In the computer game industry, GPUs are used not only for graphics rendering but also in
game physics calculations; examples include PhysX and Bullet.
CUDA has also been used to accelerate non-graphical applications in computational biology, cryptography
and other fields by an order of magnitude or more.
CUDA provides both a low level API and a higher level API.
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, which supersedes the beta released February
14, 2008.
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.
Nvidia states that programs developed for the G8x series will also work without modification
on all future Nvidia video cards, due to binary compatibility.
Background
The GPU, as a specialized processor, addresses the demands of real-time high-resolution 3D
graphics compute-intensive tasks.
As of 2012, GPUs have evolved into highly parallel multi-core systems allowing very
efficient manipulation of large blocks of data.
This design is more effective than general-purpose CPUs for algorithms where processing of large
blocks of data is done in parallel, such as: push-relabel maximum flow algorithm
fast sort algorithms of large lists two-dimensional fast wavelet transform
molecular dynamics simulations Advantages
CUDA has several advantages over traditional general-purpose computation on GPUs using
graphics APIs: Scattered reads – code can read from arbitrary
addresses in memory Unified Virtual Memory
Shared memory – CUDA exposes a fast shared memory region that can be shared amongst threads.
This can be used as a user-managed cache, enabling higher bandwidth than is possible
using texture lookups.
Faster downloads and readbacks to and from the GPU
Full support for integer and bitwise operations, including integer texture lookups
Limitations CUDA does not support the full C standard,
as it runs host code through a C++ compiler, which makes some valid C code fail to compile.
Texture rendering is not supported.
Copying between host and device memory may incur a performance hit due to system bus
bandwidth and latency 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.
Unlike OpenCL, CUDA-enabled GPUs are only available from Nvidia
Valid C/C++ may sometimes be flagged and prevent compilation due to optimization techniques
the compiler is required to employ to use limited resources.
CUDA uses a recursion-free, function-pointer-free subset of the C language, plus some simple
extensions.
However, a single process must run spread across multiple disjoint memory spaces, unlike
other C language runtime environments.
CUDA allows a subset of C++ class functionality, for example member functions may not be virtual.
[See CUDA C Programming Guide 3.1 – Appendix D.6]
Double precision floats deviate from the IEEE 754 standard: round-to-nearest-even is the
only supported rounding mode for reciprocal, division, and square root.
In single precision, denormals and signalling NaNs are not supported; only two IEEE rounding
modes are supported, and those are specified on a per-instruction basis rather than in
a control word; and the precision of division/square root is slightly lower than single precision.
Supported GPUs Compute capability table by GPU and card.
Also available directly from Nvidia: '*' - OEM-only products
A table of devices officially supporting CUDA: Version features and specifications
For more information please visit this site: http:www.geeks3d.comgpu-computing-nvidia-cuda-compute-capability-comparative-table/
and also read Nvidia CUDA programming guide.
Example This example code in C++ loads a texture from
an image into an array on the GPU:
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.
Additional Python bindings to simplify matrix multiplication operations can be found in
the program pycublas.
Language bindings Fortran – FORTRAN CUDA, PGI CUDA Fortran
Compiler Haskell – Data.Array.Accelerate
IDL – GPULib Java – jCUDA, JCuda, JCublas, JCufft
Lua – KappaCUDA Mathematica – CUDALink
MATLAB – Parallel Computing Toolbox, MATLAB Distributed Computing Server, and 3rd party
packages like Jacket.
.NET – CUDA.NET; CUDAfy.NET .NET kernel and host code, CURAND, CUBLAS, CUFFT
Perl – KappaCUDA, CUDA::Minimal Python – PyCUDA, KappaCUDA
Ruby – KappaCUDA R – gputools
Current and future usages of CUDA architecture Accelerated rendering of 3D graphics
Accelerated interconversion of video file formats
Accelerated encryption, decryption and compression Distributed calculations, such as predicting
the native conformation of proteins Medical analysis simulations, for example
virtual reality based on CT and MRI scan images.
Physical simulations, in particular in fluid dynamics.
Distributed computing Molecular Dynamics
Mining Cryptocurrencies See also
BrookGPU – the Stanford University graphics group's compiler
Vectorization Stream processing
rCUDA – An API for computing on remote computers Molecular modeling on GPU
References
External links Official website
CUDA Community on Google+