54
Universal Parallel Computing Universal Parallel Computing Research Center Research Center University of California, University of California, Berkeley Berkeley

An Introduction to CUDA and Manycore Graphics Processors Bryan Catanzaro, UC Berkeley Universal Parallel Computing Research Center University of California,

  • View
    226

  • Download
    0

Embed Size (px)

Citation preview

Page 1: An Introduction to CUDA and Manycore Graphics Processors Bryan Catanzaro, UC Berkeley Universal Parallel Computing Research Center University of California,

Universal Parallel Computing Research Universal Parallel Computing Research CenterCenterUniversity of California, BerkeleyUniversity of California, Berkeley

Page 2: An Introduction to CUDA and Manycore Graphics Processors Bryan Catanzaro, UC Berkeley Universal Parallel Computing Research Center University of California,

2/54

Terminology: Multicore, Manycore, SIMD The CUDA Programming model Mapping CUDA to Nvidia GPUs Experiences with CUDA

Page 3: An Introduction to CUDA and Manycore Graphics Processors Bryan Catanzaro, UC Berkeley Universal Parallel Computing Research Center University of California,

3/54

Multicore: yoke of oxen Each core optimized for executing a single thread

Manycore: flock of chickens Cores optimized for aggregate throughput,

deemphasizing individual performance

Multicore Manycore

Page 4: An Introduction to CUDA and Manycore Graphics Processors Bryan Catanzaro, UC Berkeley Universal Parallel Computing Research Center University of California,

4/54

Specifications Core i7 960 GTX285

Processing Elements 4 cores, 4 way [email protected] GHz

30 cores, 8 way [email protected] GHz

Resident Strands/Threads

(max)

4 cores, 2 threads, 4 way SIMD:

32 strands

30 cores, 32 SIMD vectors, 32 way

SIMD:30720 threads

SP GFLOP/s 102 1080

Memory Bandwidth 25.6 GB/s 159 GB/s

Register File - 1.875 MB

Local Store - 480 kB

Core i7 (45nm)

GTX285 (55nm)

Page 5: An Introduction to CUDA and Manycore Graphics Processors Bryan Catanzaro, UC Berkeley Universal Parallel Computing Research Center University of California,

5/54

Is a core an ALU? ATI: We have 800 streaming processors!!▪ Actually, we have 5 way VLIW * 16 way SIMD * 10 “SIMD

cores” Is a core a SIMD vector unit?

Nvidia: We have 240 streaming processors!!▪ Actually, we have 8 way SIMD * 30 “multiprocessors” ▪ To match ATI, they could count another factor of 2 for dual

issue In this lecture, we’re using core consistent with

the CPU world Superscalar, VLIW, SIMD are part of a core’s

architecture, not the number of cores

Page 6: An Introduction to CUDA and Manycore Graphics Processors Bryan Catanzaro, UC Berkeley Universal Parallel Computing Research Center University of California,

6/54

a

Single Instruction Multiple Data architectures make use of data parallelism

SIMD can be area and power efficient Amortize control overhead over SIMD width

Parallelism exposed to programmer & compiler

b

c

a2

a1

b2

b1

c2

c1

+ +SISDSIMD

width=2

Page 7: An Introduction to CUDA and Manycore Graphics Processors Bryan Catanzaro, UC Berkeley Universal Parallel Computing Research Center University of California,

7/54

It is difficult for a compiler to exploit SIMD How do you deal with sparse data &

branches? Many languages (like C) are difficult to vectorize Fortran is somewhat better

Most common solution: Either forget about SIMD▪ Pray the autovectorizer likes you

Or instantiate intrinsics (assembly language) Requires a new code version for every SIMD

extension

Page 8: An Introduction to CUDA and Manycore Graphics Processors Bryan Catanzaro, UC Berkeley Universal Parallel Computing Research Center University of California,

8/54

Page 9: An Introduction to CUDA and Manycore Graphics Processors Bryan Catanzaro, UC Berkeley Universal Parallel Computing Research Center University of California,

9/54

Neglecting SIMD in the future will be more expensive AVX: 8 way SIMD, Larrabee: 16 way SIMD, Nvidia: 32 way

SIMD, ATI: 64 way SIMD This problem composes with thread level parallelism We need a programming model which addresses both

problems

4 way SIMD (SSE) 16 way SIMD (LRB)

Page 10: An Introduction to CUDA and Manycore Graphics Processors Bryan Catanzaro, UC Berkeley Universal Parallel Computing Research Center University of California,

10/54

CUDA is a recent programming model, designed for Manycore architectures Wide SIMD parallelism Scalability

CUDA provides: A thread abstraction to deal with SIMD Synchronization & data sharing between small

groups of threads CUDA programs are written in C + extensions OpenCL is inspired by CUDA, but HW & SW vendor

neutral Programming model essentially identical

Page 11: An Introduction to CUDA and Manycore Graphics Processors Bryan Catanzaro, UC Berkeley Universal Parallel Computing Research Center University of California,

11/54

Parallel kernels composed of many threads all threads execute the same sequential program

Threads are grouped into thread blocks threads in the same block can cooperate

Threads/blocks have unique IDs

Thread t

t0 t1 … tNBlock b

Page 12: An Introduction to CUDA and Manycore Graphics Processors Bryan Catanzaro, UC Berkeley Universal Parallel Computing Research Center University of California,

12/54

Independent thread of execution has its own PC, variables (registers), processor

state, etc. no implication about how threads are scheduled

CUDA threads might be physicalphysical threads as on NVIDIA GPUs

CUDA threads might be virtualvirtual threads might pick 1 block = 1 physical thread on

multicore CPU

Page 13: An Introduction to CUDA and Manycore Graphics Processors Bryan Catanzaro, UC Berkeley Universal Parallel Computing Research Center University of California,

13/54

Thread block = virtualized multiprocessorvirtualized multiprocessor freely choose processors to fit data freely customize for each kernel launch

Thread block = a (data) parallel taskparallel task all blocks in kernel have the same entry point but may execute any code they want

Thread blocks of kernel must be independentindependent tasks

program valid for any interleaving of block executions

Page 14: An Introduction to CUDA and Manycore Graphics Processors Bryan Catanzaro, UC Berkeley Universal Parallel Computing Research Center University of California,

14/54

Threads within a block may synchronize with barriers

… Step 1 …__syncthreads();… Step 2 …

Blocks coordinate via atomic memory operations e.g., increment shared queue pointer with

atomicInc()

Implicit barrier between dependent kernelsvec_minus<<<nblocks, blksize>>>(a, b, c);

vec_dot<<<nblocks, blksize>>>(c, c);

Page 15: An Introduction to CUDA and Manycore Graphics Processors Bryan Catanzaro, UC Berkeley Universal Parallel Computing Research Center University of California,

15/54

Any possible interleaving of blocks should be valid

presumed to run to completion without pre-emption can run in any order can run concurrently OR sequentially

Blocks may coordinate but not synchronize shared queue pointer: OKOK shared lock: BAD BAD … can easily deadlock

Independence requirement gives scalabilityscalability

Page 16: An Introduction to CUDA and Manycore Graphics Processors Bryan Catanzaro, UC Berkeley Universal Parallel Computing Research Center University of California,

16/54

Manycore chips exist in a diverse set of configurations

Number of cores

CUDA allows one binary to target all these chips

Thread blocks bring scalability!

Page 17: An Introduction to CUDA and Manycore Graphics Processors Bryan Catanzaro, UC Berkeley Universal Parallel Computing Research Center University of California,

17/54

//Compute vector sum C=A+B//Each thread performs one pairwise addition__global__ void vecAdd(float* a, float* b, float* c)

{int i = blockIdx.x * blockDim.x + threadIdx.x;c[i] = a[i] + b[i];

}

int main() {//Run N/256 blocks of 256 threads eachvecAdd<<<N/256, 256>>>(d_a, d_b, d_c);

}

Page 18: An Introduction to CUDA and Manycore Graphics Processors Bryan Catanzaro, UC Berkeley Universal Parallel Computing Research Center University of California,

18/54

Thread parallelism each thread is an independent thread of

execution

Data parallelism across threads in a block across blocks in a kernel

Task parallelism different blocks are independent independent kernels

Page 19: An Introduction to CUDA and Manycore Graphics Processors Bryan Catanzaro, UC Berkeley Universal Parallel Computing Research Center University of California,

19/54

Thread

Per-threadLocal Memory

Block

Per-blockShared Memory

Page 20: An Introduction to CUDA and Manycore Graphics Processors Bryan Catanzaro, UC Berkeley Universal Parallel Computing Research Center University of California,

20/54

Kernel Kernel 00

Kernel Kernel 11

SequentiSequentialal

KernelsKernels …

… Per Device Global

Memory

Per Device Global

Memory

Page 21: An Introduction to CUDA and Manycore Graphics Processors Bryan Catanzaro, UC Berkeley Universal Parallel Computing Research Center University of California,

21/54

Host Memory

Host Memory

Device 0 MemoryDevice 0 Memory

Device 1 MemoryDevice 1 Memory

cudaMemcpy()

Page 22: An Introduction to CUDA and Manycore Graphics Processors Bryan Catanzaro, UC Berkeley Universal Parallel Computing Research Center University of California,

22/54

Variables shared across block__shared____shared__ int *begin, *end;

Scratchpad memory__shared____shared__ int scratch[BLOCKSIZE];scratch[threadIdx.xthreadIdx.x] = begin[threadIdx.xthreadIdx.x];// … compute on scratch values …begin[threadIdx.xthreadIdx.x] = scratch[threadIdx.xthreadIdx.x];

Communicating values between threadsscratch[threadIdx.xthreadIdx.x] = begin[threadIdx.xthreadIdx.x];__syncthreads()__syncthreads();int left = scratch[threadIdx.xthreadIdx.x - 1];

Per-block shared memory is very fast Often just as fast as a register file access

It is relatively small: On GTX280, the register file is 4x bigger

Block Share

dShare

d

Page 23: An Introduction to CUDA and Manycore Graphics Processors Bryan Catanzaro, UC Berkeley Universal Parallel Computing Research Center University of California,

23/54

Declaration specifiers to indicate where things live__global__ void KernelFunc(...); // kernel callable from host__device__ void DeviceFunc(...); // function callable on device__device__ int GlobalVar; // variable in device memory__shared__ int SharedVar; // in per-block shared memory

Extend function invocation syntax for parallel kernel launchKernelFunc<<<500, 128>>>(...); // 500 blocks, 128 threads each

Special variables for thread identification in kernelsdim3 threadIdx; dim3 blockIdx; dim3 blockDim;

Intrinsics that expose specific operations in kernel code__syncthreads(); // barrier synchronization

Page 24: An Introduction to CUDA and Manycore Graphics Processors Bryan Catanzaro, UC Berkeley Universal Parallel Computing Research Center University of California,

24/54

Double and single precision

Standard mathematical functions sinfsinf, powfpowf, atanfatanf, ceilceil, minmin, sqrtfsqrtf, etc.

Atomic memory operations atomicAddatomicAdd, atomicMinatomicMin, atomicAndatomicAnd, atomicCASatomicCAS,

etc. These work on both global and shared

memory

Page 25: An Introduction to CUDA and Manycore Graphics Processors Bryan Catanzaro, UC Berkeley Universal Parallel Computing Research Center University of California,

25/54

Explicit memory allocation returns pointers to GPU memory cudaMalloc()cudaMalloc(), cudaFree()cudaFree()

Explicit memory copy for host ↔ device, device ↔ device cudaMemcpy()cudaMemcpy(), cudaMemcpy2D()cudaMemcpy2D(), ...

Texture management cudaBindTexture()cudaBindTexture(), cudaBindTextureToArray()cudaBindTextureToArray(), ...

OpenGL & DirectX interoperability cudaGLMapBufferObject()cudaGLMapBufferObject(),

cudaD3D9MapVertexBuffer()cudaD3D9MapVertexBuffer(), …

Page 26: An Introduction to CUDA and Manycore Graphics Processors Bryan Catanzaro, UC Berkeley Universal Parallel Computing Research Center University of California,

26/54

CUDA is designed to be functionally forgiving First priority: make things work. Second: get performance.

However, to get good performance, one must understand how CUDA is mapped to Nvidia GPUs

Threads: each thread is a SIMD vector lane

Warps: A SIMD instruction acts on a “warp” Warp width is 32 elements: LOGICAL SIMD width

Thread blocks: Each thread block is scheduled onto a processor Peak efficiency requires multiple thread blocks per

processor

Page 27: An Introduction to CUDA and Manycore Graphics Processors Bryan Catanzaro, UC Berkeley Universal Parallel Computing Research Center University of California,

27/54

The GPU is very deeply pipelined Throughput machine, trying to hide memory latency

This means that performance depends on the number of thread blocks which can be allocated on a processor

Therefore, resource usage costs performance: More registers => Fewer thread blocks More shared memory usage => Fewer thread blocks

It is often worth trying to reduce register count in order to get more thread blocks to fit on the chip

For previous architectures, 10 registers or less per thread meant full occupancy

For GTX280, target 16 registers or less per thread

Page 28: An Introduction to CUDA and Manycore Graphics Processors Bryan Catanzaro, UC Berkeley Universal Parallel Computing Research Center University of California,

28/54

The GPU tries to fit as many thread blocks simultaneously as possible on to a processor The number of simultaneous thread blocks (B) is

≤ 8 The number of warps per thread block (T) ≤

16 B * T ≤ 32 The number of threads per warp (V) is 32 B * T * V * Registers per thread ≤ 16384 B * Shared memory (bytes) per block ≤ 16384

Occupancy is reported as B * T / 32

Page 29: An Introduction to CUDA and Manycore Graphics Processors Bryan Catanzaro, UC Berkeley Universal Parallel Computing Research Center University of California,

29/54

Nvidia GPU hardware handles control flow divergence and reconvergence

Write scalar SIMD code, the hardware schedules the SIMD execution

One caveat: __syncthreads()__syncthreads() can’t appear in a divergent path▪ This will cause programs to hang

Good performing code will try to keep the execution convergent within a warp▪ Warp divergence only costs because of a finite

instruction cache

Page 30: An Introduction to CUDA and Manycore Graphics Processors Bryan Catanzaro, UC Berkeley Universal Parallel Computing Research Center University of California,

30/54

A many core processor ≡ A device for turning a compute bound problem into a memory bound problem

Lots of processors, only one socket Memory concerns dominate performance

tuning

Page 31: An Introduction to CUDA and Manycore Graphics Processors Bryan Catanzaro, UC Berkeley Universal Parallel Computing Research Center University of California,

31/54

Virtually all processors have SIMD memory subsystems

0 1 2 3 4 5 6 7

cache line width

This has two effects: Sparse access wastes bandwidth

0 1 2 3 4 5 6 7 2 words used, 8 words loaded:¼ effective bandwidth

Unaligned access wastes bandwidth

0 1 2 3 4 5 6 74 words used, 8 words loaded:

½ effective bandwidth

Page 32: An Introduction to CUDA and Manycore Graphics Processors Bryan Catanzaro, UC Berkeley Universal Parallel Computing Research Center University of California,

32/54

Current GPUs don’t have cache lines as such, but they do have similar issues with alignment and sparsity

Nvidia GPUs have a “coalescer”, which examines memory requests dynamically and coalesces them

To use bandwidth effectively, when threads load, they should: Present a set of unit strided loads (dense

accesses) Keep sets of loads aligned to vector boundaries

Page 33: An Introduction to CUDA and Manycore Graphics Processors Bryan Catanzaro, UC Berkeley Universal Parallel Computing Research Center University of California,

33/54

Multidimensional arrays are usually stored as monolithic vectors in memory

Care should be taken to assure aligned memory accesses for the necessary access pattern

(row major)

Page 34: An Introduction to CUDA and Manycore Graphics Processors Bryan Catanzaro, UC Berkeley Universal Parallel Computing Research Center University of California,

34/54

× =

Problem: Sparse Matrix Vector Multiplication How should we represent the matrix?

Can we take advantage of any structure in this matrix?

Page 35: An Introduction to CUDA and Manycore Graphics Processors Bryan Catanzaro, UC Berkeley Universal Parallel Computing Research Center University of California,

35/54

Since this matrix has nonzeros only on diagonals, let’s project the diagonals into vectors

Sparse representation becomes dense

Launch a thread per row Are we done?

The straightforward diagonal projection is not aligned

Page 36: An Introduction to CUDA and Manycore Graphics Processors Bryan Catanzaro, UC Berkeley Universal Parallel Computing Research Center University of California,

36/54

Skew the diagonals again

This ensures that all memory loads from matrix are coalesced

Don’t forget padding!

padding

Page 37: An Introduction to CUDA and Manycore Graphics Processors Bryan Catanzaro, UC Berkeley Universal Parallel Computing Research Center University of California,

37/54

Different data access patterns may also require transposing data structures

Array of Structs Structure of Arrays

T

The cost of a transpose on the data structure is often much less than the cost of uncoalesced memory accesses

Page 38: An Introduction to CUDA and Manycore Graphics Processors Bryan Catanzaro, UC Berkeley Universal Parallel Computing Research Center University of California,

38/54

Image Contour Detection Support Vector Machines

Page 39: An Introduction to CUDA and Manycore Graphics Processors Bryan Catanzaro, UC Berkeley Universal Parallel Computing Research Center University of California,

39/54

Contours are subjective – they depend on personal perspective

Surprise: Humans agree (more or less) J. Malik’s group has developed a “ground truth”

benchmark

Image Human ContoursMachine Contours

Page 40: An Introduction to CUDA and Manycore Graphics Processors Bryan Catanzaro, UC Berkeley Universal Parallel Computing Research Center University of California,

40/54

global Probability of boundary

Currently, the most accurate image contour detector

7.8 mins per small image (0.15 MP) limits its applicability ~3 billion images on web 10000 computer cluster

would take 5 years to find their contours

How many new images would there be by then? Maire, Arbelaez, Fowlkes,

Malik, CVPR 2008

Page 41: An Introduction to CUDA and Manycore Graphics Processors Bryan Catanzaro, UC Berkeley Universal Parallel Computing Research Center University of California,

41/54

ImageImage

Convert Convert ColorspacColorspac

ee

Textons:Textons:K-meansK-means

Texture Texture GradientGradient

CombineCombine

Non-maxNon-maxsuppressisuppressi

onon

Intervening Intervening ContourContour

Generalized Generalized EigensolverEigensolver

Oriented Energy Oriented Energy CombinationCombination

Combine, Combine, NormalizeNormalize

ContoursContours

LgLg AgAg BgBg

Page 42: An Introduction to CUDA and Manycore Graphics Processors Bryan Catanzaro, UC Berkeley Universal Parallel Computing Research Center University of California,

42/54

Computation Original Type

gPb: CVPR 2008

Damascene Speedup

Textons: Kmeans C++ 16.6 0.152 109x

Gradients C++ 85.2 4.03 21x

Smoothing Matlab 116 0.23 509x

Intervening Contour C++ 7.61 0.024 317x

Eigensolver C++/Matlab

235 1.19 197x

Oriented Energy Matlab 2.3 0.16 140x

OverallC++/Matlab

469 seconds 5.5 seconds 85xgPb: CVPR 2008

Page 43: An Introduction to CUDA and Manycore Graphics Processors Bryan Catanzaro, UC Berkeley Universal Parallel Computing Research Center University of California,

43/54

Textures are analyzed in the image by finding textons

The image is convolved with a filter bank Responses to the filter bank are clustered Kmeans clustering:

Iterate: Compute centroid for each label Relabel each point with nearest centroid

16.6s 16.6s 0.15s0.15s

16.6s 16.6s 0.15s0.15s

Page 44: An Introduction to CUDA and Manycore Graphics Processors Bryan Catanzaro, UC Berkeley Universal Parallel Computing Research Center University of California,

44/54

Four types of gradients are constructed, at 8 orientations (θ)and 3 image scales (r)

These gradients describe the response at each pixel: if there is a boundary at a particular orientation at a pixel, the response is high

Construct blurred histograms at each pixel, which describe the image on both sides of a set of oriented lines, at a set of scales

Chi-squared distance between histograms describes pixel response to that orientation and scale

θθrr

Page 45: An Introduction to CUDA and Manycore Graphics Processors Bryan Catanzaro, UC Berkeley Universal Parallel Computing Research Center University of California,

45/54

Smooth responses by fitting parabolas Derive gradients at 8 orientations, 3

scales, for 4 channels (texture, brightness, A & B color channel)

Parallelism comes from pixels and Map Reduce: all 96 gradients are computed sequentially

201s 201s 4.3s4.3s

201s 201s 4.3s4.3s

Page 46: An Introduction to CUDA and Manycore Graphics Processors Bryan Catanzaro, UC Berkeley Universal Parallel Computing Research Center University of California,

46/54

The Normalized Cut Spectral Graph Partitioning method finds good contoursby avoiding those contours which create small, isolated regions

An affinity matrix links each pixel to itslocal neighbors

Like chainmail, the local connectionsbind the local affinities into a globally connected system

Generalized eigenvectors from this system identify the important boundaries

This step was the most computationally dominant for the serial implementation

Normalized cutNormalized cut

Min-cutMin-cut

Page 47: An Introduction to CUDA and Manycore Graphics Processors Bryan Catanzaro, UC Berkeley Universal Parallel Computing Research Center University of California,

47/54

This led to some interesting algorithm exploration: Lanczos algorithm with the Cullum-Willoughby

test Heavily dependent on SpMV: We achieve 39.5

GFLOPS

235s 235s 1.2s1.2s

235s 235s 1.2s1.2s

Page 48: An Introduction to CUDA and Manycore Graphics Processors Bryan Catanzaro, UC Berkeley Universal Parallel Computing Research Center University of California,

48/54

We achieve equivalent accuracy on the Berkeley Segmentation Dataset Comparing to human

segmented “ground truth”

F-measure 0.70 for both Human agreement = 0.79

7.8 minutes to 5.5 seconds

RecallRecall

Pre

cisi

Pre

cisi

onon

Page 49: An Introduction to CUDA and Manycore Graphics Processors Bryan Catanzaro, UC Berkeley Universal Parallel Computing Research Center University of California,

49/26

Example Kernel Functions:Example Kernel Functions:Example Kernel Functions:Example Kernel Functions:

Quadratic ProgramQuadratic ProgramQuadratic ProgramQuadratic Program Variables:Variables:

αα: : Weight for each training Weight for each training point (determines classifier)point (determines classifier)

Data:Data:

ll: : number of training pointsnumber of training points

yy: : Label (+/- 1) for each Label (+/- 1) for each training pointtraining point

xx: : training pointstraining points

Variables:Variables:

αα: : Weight for each training Weight for each training point (determines classifier)point (determines classifier)

Data:Data:

ll: : number of training pointsnumber of training points

yy: : Label (+/- 1) for each Label (+/- 1) for each training pointtraining point

xx: : training pointstraining points

Page 50: An Introduction to CUDA and Manycore Graphics Processors Bryan Catanzaro, UC Berkeley Universal Parallel Computing Research Center University of California,

50/26

The Sequential Minimal Optimization algorithm (Platt, 1999) is an iterative solution method for the SVM training problem

At each iteration, it adjusts only 2 of the variables (chosen by heuristic) The optimization step is then a trivial one dimensional

problem:

Computing full kernel matrix Q not required Despite name, algorithm can be quite parallel Computation is dominated by KKT optimality condition

updates

Page 51: An Introduction to CUDA and Manycore Graphics Processors Bryan Catanzaro, UC Berkeley Universal Parallel Computing Research Center University of California,

51/26

LibSVM running on Intel Core 2 Duo 2.66 GHz Our solver running on Nvidia GeForce 8800GTX Gaussian kernel used for all experiments 9-35x speedup

Training Time (seconds)5.095.09

0.5760.576

27.627.6

1.321.32

550550

26.926.9

24222422

164164

1696616966

483483

6652466524

20232023

Name #points

#dim

USPS 7291 256

Face 6977 381

Adult 32561 123

Web 49749 300

MNIST 60000 784

Forest 561012 54

Page 52: An Introduction to CUDA and Manycore Graphics Processors Bryan Catanzaro, UC Berkeley Universal Parallel Computing Research Center University of California,

52/26

To classify a point z, evaluate :

For standard kernels, SVM Classification involves comparing all support vectors and all test vectors with a dot product

We take advantage of the common situation when one has multiple data points to classify simultaneously

We cast the dot products as a Matrix-Matrix multiplication, and then use Map Reduce to finish the classification

Page 53: An Introduction to CUDA and Manycore Graphics Processors Bryan Catanzaro, UC Berkeley Universal Parallel Computing Research Center University of California,

53/26

0.770.77

0.230.23

0.00960.0096

6161

7.57.5

0.5750.575

8989

5.25.20.710.71

107107

15.715.7

1.061.06

270270

9.59.51.951.95

CPU optimized version achieves 3-30x speedup GPU version achieves an additional 5-24x speedup, for a

total of 81-138x speedup Results identical to serial version

Classification Time (seconds)

Page 54: An Introduction to CUDA and Manycore Graphics Processors Bryan Catanzaro, UC Berkeley Universal Parallel Computing Research Center University of California,

54/54

CUDA is a programming model for manycore processors

It abstracts SIMD, making it easy to use wide SIMD vectors

It provides good performance on today’s GPUs

In the near future, CUDA-like approaches will map well to many processors & GPUs

CUDA encourages SIMD friendly, highly scalable algorithm design and implementation