Stanford University. NVIDIA Tesla M2090. NVIDIA GeForce GTX 690

Size: px
Start display at page:

Download "Stanford University. NVIDIA Tesla M2090. NVIDIA GeForce GTX 690"

Transcription

1 Stanford University NVIDIA Tesla M2090 NVIDIA GeForce GTX 690

2 Moore s Law 2

3 Clock Speed Pentium 4 Prescott Core 2 Nehalem Sandy Bridge 1000 Pentium 4 Williamette Clock Speed (MHz) Pentium Pentium II Pentium III Date of Introduction 3

4 How did they use all those additional transistors? Additional functionality Floating point units SSE vector units Caches Data Instructions Translation Lookaside Buffer (virtual memory) Hardware prefetcher Instruction Level Parallelism Instruction pipelining Superscalar execution Out of order execution Speculative execution Branch prediction 4

5 Multicore CPUs Maximum # cores Six core AMD Opteron (image from AMD) Date of Introduction for AMD Opteron CPUs 5

6 Graphics Processing Unit (GPU) Leverages demand and volume from video game players Consumer versions widely available at any electronics store at a variety of price points Programmable via free software options (images from NVIDIA) 6

7 Compute and Bandwidth Performance FLOPS Bandwidth Source: NVIDIA CUDA C Programming Guide Version 4.2 7

8 Hardware Characteristics 3 or 4 generations of NVIDIA CUDA architectures released from Key characteristics are: Architectural differences Double precision floating point on newer generations Memory system Newer generations are much more flexible L1 and L2 caches have been added in later generations Number of cores and the rate at which they re clocked Bandwidth Depends on memory clock and width of the memory interface Amount of on-board memory (256 MB to 6 GB) Power consumption Higher end GPUs need auxiliary 6- and/or 8-pin PCIe power connectors 8

9 NVIDIA Fermi Architecture 9

10 Fermi Streaming Multiprocessor 10

11 GPU Parallelism Multicore CPU needs one or two threads per core to run efficiently GPUs need thousands to tens of thousands of threads to run efficiently Each time a GPU computes a frame (which it does tens of times a second) it uses a thread per pixel, of which there are millions In the context of computation, this means fine grain parallelism This is possible because GPU threads are different than CPU threads 11

12 GPU Threads Lightweight compared to CPU threads Creation, scheduling, destruction are done in hardware Fast switching between threads Many times more threads than cores Typically about 100x more threads than cores Why so many threads? 12

13 GPU Memory System GPU doesn t rely solely on cache to hide memory latency Many more transistors available for computational units Can do without cache because it s specialized to handle parallel computations When a thread stalls due to memory access latency, a core switches to executing another thread and when that thread eventually stalls, the core switches to another thread, etc. Registers are partitioned to allow fast switching (one clock cycle) More threads means more opportunity for latency hiding A GPU can run a single-threaded function but the performance will be horrible 13

14 GPU Programming Today NVIDIA CUDA C and Fortran OpenCL Microsoft DirectCompute OpenACC 14

15 Getting Started with CUDA Hardware Requires compatible hardware (emulator no longer available) Any reasonably new NVIDIA GPU supports CUDA Check NVIDIA website for more information: CUDA C Freely available from NVIDIA website: CUDA driver (part of display driver), toolkit (compiler and libraries), and SDK code examples Windows, Linux, and Mac OS X supported Use the Quick Start Guides for installation and verification 15

16 CUDA C CPU code API for interacting with the GPU(s) Extension for easily invoking computational kernels that run on the GPU GPU code Subset of C Kernels must return void Recursion, malloc / free or new / delete, printf, assert, etc. only supported on Fermi GPUs and beyond Extensions Parallel programming model Libraries Callable from the CPU, run on the GPU BLAS, FFT, CURAND, CUSPARSE, NPP, Thrust, etc. 16

17 Simple CUDA C Program global void addvectors(float *a, float *b, float *c) { int idx = blockidx.x*blockdim.x + threadidx.x c[idx] = a[idx] + b[idx]; addvectors<<<nvalues/256, 256>>>(a_d, b_d, c_d); Keyword that indicates GPU code } Each thread computes a unique index to access the data it will access and produce // CPU code calls GPU code CPU specifies how many GPU threads to start, in this case one thread per element in the vectors 17

18 CPU and GPU Memory CPU and GPU each have their own physical memory Data transferred over PCI Express (PCIe) 8 GB/s theoretical peak for Gen 2 x16, up to ~5.5 GB/s observed PCI Express 18

19 Allocating GPU Memory GPU memory explicitly allocated and freed cudamalloc, cudafree Pointers to memory allocated on the GPU are not valid on the CPU and vice versa GPU uses a virtual memory system, but: On Windows Vista systems (and their derivatives, e.g. Windows HPC Server 2008) and up, allocating beyond physical memory will automatically result in paging to CPU memory On all other operating systems allocations will fail Done for performance reasons Allocation has the life of the host CPU process/thread Automatically cleaned up by driver if application doesn t 19

20 cudamalloc cudaerror_t cudamalloc(void **devptr, size_t size) float *a_d; status = cudamalloc((void **) &a_d, 1024*sizeof(float)); assert(status == cudasuccess); No type distinction between CPU and GPU pointers Recommend adopting a standard convention, e.g. _d suffix Be sure to implement some sort of error checking consistent with your application 20

21 cudafree cudaerror_t cudafree(void *devptr) status = cudafree(a_d); assert(status == cudasuccess); 21

22 cudamemcpy cudaerror_t cudamemcpy(void *dst, const void *src, size_t count, enum cudamemcpykind kind) Copy from memory area pointed to by src to memory area pointed to by dst kind specifies the direction of the copy: cudamemcpyhosttohost cudamemcpyhosttodevice cudamemcpydevicetohost cudamemcpydevicetodevice Calls with dst and src pointers inconsistent with the copy direction will result in undefined behavior (typically garbage in the destination, or perhaps even an application crash) cudamemcpy will block until the memory copy has completed Options for asynchronous copies also available 22

23 cudamemcpy Example size_t bytes = 1024*sizeof(float); a = (float *) malloc(bytes); b = (float *) malloc(bytes); cudamalloc((void **) &a_d, bytes); cudamalloc((void **) &b_d, bytes); cudamemcpy(a_d, a, bytes, cudamemcpyhosttodevice); cudamemcpy(b_d, a_d, bytes, cudamemcpydevicetodevice); cudamemcpy(b, b_d, bytes, cudamemcpydevicetohost); for(int n = 0; n < 1024; n++) assert(a[n] == b[n]); 23

24 Parallel Programming Model Parallel portions of the code are initiated from the CPU and run on the GPU Parallelism is based on many threads running in parallel Developer writes one thread program Each instance of the thread will use a unique index to determine which portion of the computation to perform Sometimes referred to as SIMD, SPMD, or SIMT Single Instruction Multiple Data Single Program Multiple Data Single Instruction Multiple Threads 24

25 Parallel Threads... idx nthreads - 1 x = input[idx]; y = func(x); output[idx] = y; 25

26 Thread Cooperation Useful to have threads cooperate with one another Share intermediate results Reduce memory accesses (stencil operations, etc.) Cooperation is difficult to scale Synchronization is expensive Potential for deadlock Kernels launched as grid of thread blocks 26

27 Grid of Thread Blocks Grid Block nblocks Threads in the same block can cooperate More on this later when we discuss shared memory Threads in different blocks cannot cooperate 27

28 Hardware Execution Software Hardware Thread Thread Processor Thread Block Multiprocessor Grid... Device 28

29 Scalability Across GPUs Blocks scheduled across one or more multiprocessors Correctly written program will work for any number of multiprocessors and ordering of blocks Blocks which won t fit are queued and started when other blocks finish Device A Device B Time 29

30 GPU Code Kernel is a C function with restrictions: Must return void Cannot access host memory No variable number of arguments No recursion on older generations of GPUs No static variables Function arguments automatically copied from host to device But not memory that backs pointers 30

31 Function Qualifiers Function qualifiers used to specify where a function will be called from and where it will execute global device Called from the host and executes on the device Called from the device and executes on the device host Called from the host and executes on the host Combine with device for overloading 31

32 Kernel Launch Special syntax for invoking kernels: mykernel<<<dim3 dimgrid, dim3 dimblock>>>( ); <<<, >>> referred to as the execution configuration dimgrid is the number of blocks in the grid One or two dimensional: dimgrid.x, dimgrid.y dimblock is the number of threads in a block One, two, or three dimensional: dimblock.x, dimblock.y, dimblock.z Multidimensional grids and blocks are for programming convenience Unspecified dim3 fields default to 1 32

33 Execution Configuration Examples dim3 grid, block; grid.x = 2; grid.y = 4; block.x = 16; block.y = 16; mykernel<<<grid, block>>>( ); dim3 grid(2, 4), block(16, 16); mykernel<<<grid, block>>>( ); mykernel<<<8, 256>>>( ); 33

34 Built in Variables global and device functions have access to several automatically defined variables dim3 griddim Dimension of the grid in blocks dim3 blockdim Dimension of the block in threads dim3 blockidx Block index within the grid dim3 threadidx Thread index within the block 34

35 Globally Unique Thread Indices Grid blockidx.x nblocks threadidx.x idx idx = blockidx.x*blockdim.x + threadidx.x; 35

36 Vector Addition Example global void addvectors(float *a, float *b, float *c, int N) { int idx = blockidx.x*blockdim.x + threadidx.x; if (idx < N) c[idx] = a[idx] + b[idx]; }... blocksize = 256; dim3 dimgrid(ceil(nvalues/(float)blocksize)); addvectors<<<dimgrid, blocksize>>>(a_d, b_d, c_d, nvalues); 36

37 Reduction Combine the elements of an array using an associative, commutative operator Typical examples include: sum, min, max, product, etc. sum = 0.; for (n = 0; n < nvalues; n++) sum += a[n]; Note that CUDPP and Thrust implement very efficient reductions as library calls:

38 Generic Parallel Reduction Implemented using recursive pairwise reduction

39 Simple Parallel Reduction Kernel Kernel Kernel

40 Simple Parallel Reduction global void sumreductionkernel(float *a, int nthreads){ int idx = blockdim.x*blockidx.x + threadidx.x; if (idx < nthreads) a[idx] += a[idx + nthreads]; }... nthreads = nvalues/2; while (nthreads > 0){ griddim.x = ceil((float)nthreads/blocksize); sumreductionkernel<<<nvalues/256,blocksize>>>(a_d, nthreads); nthreads /= 2; } cudamemcpy(a, a_d, sizeof(float), cudamemcpydevicetohost); printf( sum of a = %f\n, a[0]); 40

41 Memory Model So far we ve seen per thread variables (like idx) which are stored in registers and memory in the offchip DRAM (device/global memory) Registers: Accessible by one thread Life of the thread... Device: Accessible by all threads Life of the application 41

42 Shared Memory Exchanging data through device memory is expensive due to bandwidth and latency and it also requires multiple kernel launches Global synchronization between kernel launches Instead use high performance on-chip memory ~100 times lower latency than device memory ~10 times more bandwidth 16 KB to 48 KB SRAM per multiprocessor 16 KB on compute capability 1.x 16 KB to 48 KB on compute capability 2.x+ Allocated per thread block and can be read and written by any thread in the block Has the lifetime of the thread block 42

43 Expanded Memory Model Registers: Accessible by one thread Life of the thread Shared Memory: Accessible by all threads in a block Life of the thread block... Device: Accessible by all threads Life of the application 43

44 Variable Qualifiers device Located in off-chip DRAM memory Allocated with cudamalloc ( device qualifier implied) Life of the application Accessible from threads and host shared Located in on-chip shared memory Life of the thread block Only accessible from threads within the block constant See the documentation Unqualified variables in device code normally reside in registers 44

45 Example of Shared Memory Declaration #define BLOCKSIZE 256 global void mykernel(float *a, int nvalues) { /* Per thread block shared memory. */ shared float a_s[blocksize]; } /* Local (per thread) variables. */ int idx;... 45

46 More on Shared Memory Declaration global void mykernel(float *a, int nvalues) { /* Per thread block shared memory. */ extern shared float a_s[]; /* Local variables. */ int idx;... Size of a_s specified at kernel launch }... bytes = 256*sizeof(float); mykernel<<<dimgrid, dimblock, bytes>>>(a_d, nvalues); 46

47 Thread Synchronization Threads can cooperate by writing and reading to shared memory but there is potential for race conditions Thread reads from shared memory before another thread has written the data, etc. syncthreads() synchronizes all threads in a block Acts as a barrier No thread in the block can continue until all threads reach it Allowed in conditional code only if the conditional is uniform across the entire thread block! 47

48 Better Parallel Reduction a[0] a[255] a[256] a[511] a[512] a[767] Kernel 1 Block 0 Block 1 Block 2 a[0] a[1] a[2] Kernel 2 Block 0 a[0] Reductions within each thread block significantly reduce the number of kernel invocations and the amount of data written back to memory from each kernel 48

49 Better Parallel Reduction: GPU Code (1) #define BLOCKSIZE 256 global void sumreductionkernel(float *a, int nvalues { int n = BLOCKSIZE/2; int idx = blockidx.x*blockdim.x + threadidx.x; /* Shared memory common to all threads within a block. */ shared float a_s[blocksize]; /* Load data from global memory into shared memory. */ if (idx < nvalues) a_s[threadidx.x] = a[idx]; else a_s[threadidx.x] = 0.f;... syncthreads(); 49

50 Better Parallel Reduction: GPU Code (2)... /* Reduction within this thread block. */ while (n > 0) { if (threadidx.x < n) a_s[threadidx.x] += a_s[threadidx.x + n]; n /= 2; syncthreads(); } /* Thread 0 writes the one value from this block back to global memory. */ if (threadidx.x == 0) a[blockidx.x] = a_s[0]; } 50

51 Better Parallel Reduction: CPU Code... nthreads = nvalues; while (nthreads > 0) { griddim.x = ceil((float)nthreads/blocksize); sumreductionkernel<<<griddim, BLOCKSIZE>>>(a_d, nthreads); nthreads /= BLOCKSIZE; }... 51

52 Processor-Memory Gap From: Computer Architecture: A Quantitative Approach by Hennessy and Patterson 52

53 Thread Warps Thread blocks are made up of groups of threads called warps Warp size on all current hardware is 32, but could change on future hardware (can query through device properties) A warp is executed in lock step SIMD on a multiprocessor Hardware automatically handles divergence due to branching Note that you are free to specify an arbitrary number of threads per block, but the hardware can only work in increments of warps Number of threads is internally rounded up to a multiple of the warp size and extras are masked out in terms of memory accesses Trivia: Warps is a term which comes from weaving. They are threads woven in parallel. 53

54 Warps and Half Warps = Thread block Warp 0 Warp 1 Warp 2 Warp n Warp n = Half warp Half warp 54

55 Compute Capability Compute capability is a versioning scheme for keeping track of multiprocessor capabilities / features Compute capability 1.0 Tesla architecture, first CUDA capable multiprocessor Compute capability 1.1 Adds atomic operations for global memory, etc. Compute capability 1.2 Tesla 2 architecture Doubles the number of registers from 1.0 and 1.1 Adds atomic operations for shared memory, etc. Compute capability 1.3 Adds double precision floating point, etc. Compute capability 2.x Fermi architecture Compute capability 3.x Kepler architecture Compute capability of a GPU can be queried at runtime 55

56 Memory Coalescing Coalescing is the process of combining global memory access (load or store) across threads within a warp or half warp into one or more transactions How coalescing is performed depends on the compute capability 1.0 and 1.1 have the same coalescing characteristics 1.2 and 1.3 have the same coalescing characteristics 1.0 and 1.1 are subsets of 1.2 and and 3.0 adds L1 and L2 caches Global memory divided into segments of size 32, 64, 128, and 256 bytes Pointers from cudamalloc are always at least 256 byte aligned 56

57 Global Memory Segments 57

58 Coalescing on Compute Capability 1.2 and 1.3 Global memory accesses by a half warp are combined to minimize the total number of transactions Eliminates the dependence on the order in which threads access data in compute capability 1.0 and 1.1 In addition, transaction sizes are automatically reduced to avoid wasted bandwidth Recursively reduces the transaction size if only the upper or lower half of the segment is needed See the programming guide for more details of the algorithm Minimum transaction size of 32 bytes and per thread word sizes of 32, 64, and 128 bits Note that the coalescing for Compute Capability 1.2 and 1.3 is a superset of the requirements for Compute Capability 1.0 and 1.1 Code that is efficient on 1.0 and 1.1 will continue to be efficient on 1.2 and 1.3 but not necessarily vice versa 58

59 Examples of Memory Transactions 59

60 Examples of Memory Transactions 60

61 Coalescing and Caching on Compute Capability 2.x+ Each multiprocessor has 64 KB of SRAM for shared memory and L1 cache Can choose split between shared memory and L1 on a per kernel basis GPU as a whole has an L2 cache Memory accesses are coalesced across the full warp of 32 threads The cache line size is 128 bytes, so any misses in L1 will result in one or more 128 bytes transactions from L2 to L1 If the L1 cache is bypassed, either through a compilation flag or an inline assembly instruction, the requests are served from L2 using 32 byte transactions There is no way to bypass L2 cache 61

62 Big Picture on Global Memory Access On a CPU, you want spatial locality of data down a thread On a GPU, you want spatial locality of data across threads True for both NVIDIA and AMD GPUs CPU GPU time 62

Introduction to CUDA CME343 / ME May James Balfour [ NVIDIA Research

Introduction to CUDA CME343 / ME May James Balfour [ NVIDIA Research Introduction to CUDA CME343 / ME339 18 May 2011 James Balfour [ jbalfour@nvidia.com] NVIDIA Research CUDA Programing system for machines with GPUs Programming Language Compilers Runtime Environments Drivers

More information

Register file. A single large register file (ex. 16K registers) is partitioned among the threads of the dispatched blocks.

Register file. A single large register file (ex. 16K registers) is partitioned among the threads of the dispatched blocks. Sharing the resources of an SM Warp 0 Warp 1 Warp 47 Register file A single large register file (ex. 16K registers) is partitioned among the threads of the dispatched blocks Shared A single SRAM (ex. 16KB)

More information

Outline 2011/10/8. Memory Management. Kernels. Matrix multiplication. CIS 565 Fall 2011 Qing Sun

Outline 2011/10/8. Memory Management. Kernels. Matrix multiplication. CIS 565 Fall 2011 Qing Sun Outline Memory Management CIS 565 Fall 2011 Qing Sun sunqing@seas.upenn.edu Kernels Matrix multiplication Managing Memory CPU and GPU have separate memory spaces Host (CPU) code manages device (GPU) memory

More information

Basic Elements of CUDA Algoritmi e Calcolo Parallelo. Daniele Loiacono

Basic Elements of CUDA Algoritmi e Calcolo Parallelo. Daniele Loiacono Basic Elements of CUDA Algoritmi e Calcolo Parallelo References q This set of slides is mainly based on: " CUDA Technical Training, Dr. Antonino Tumeo, Pacific Northwest National Laboratory " Slide of

More information

CUDA PROGRAMMING MODEL. Carlo Nardone Sr. Solution Architect, NVIDIA EMEA

CUDA PROGRAMMING MODEL. Carlo Nardone Sr. Solution Architect, NVIDIA EMEA CUDA PROGRAMMING MODEL Carlo Nardone Sr. Solution Architect, NVIDIA EMEA CUDA: COMMON UNIFIED DEVICE ARCHITECTURE Parallel computing architecture and programming model GPU Computing Application Includes

More information

CUDA Programming. Week 1. Basic Programming Concepts Materials are copied from the reference list

CUDA Programming. Week 1. Basic Programming Concepts Materials are copied from the reference list CUDA Programming Week 1. Basic Programming Concepts Materials are copied from the reference list G80/G92 Device SP: Streaming Processor (Thread Processors) SM: Streaming Multiprocessor 128 SP grouped into

More information

Parallel Computing. Lecture 19: CUDA - I

Parallel Computing. Lecture 19: CUDA - I CSCI-UA.0480-003 Parallel Computing Lecture 19: CUDA - I Mohamed Zahran (aka Z) mzahran@cs.nyu.edu http://www.mzahran.com GPU w/ local DRAM (device) Behind CUDA CPU (host) Source: http://hothardware.com/reviews/intel-core-i5-and-i7-processors-and-p55-chipset/?page=4

More information

GPU Programming. Lecture 2: CUDA C Basics. Miaoqing Huang University of Arkansas 1 / 34

GPU Programming. Lecture 2: CUDA C Basics. Miaoqing Huang University of Arkansas 1 / 34 1 / 34 GPU Programming Lecture 2: CUDA C Basics Miaoqing Huang University of Arkansas 2 / 34 Outline Evolvements of NVIDIA GPU CUDA Basic Detailed Steps Device Memories and Data Transfer Kernel Functions

More information

CUDA Programming (Basics, Cuda Threads, Atomics) Ezio Bartocci

CUDA Programming (Basics, Cuda Threads, Atomics) Ezio Bartocci TECHNISCHE UNIVERSITÄT WIEN Fakultät für Informatik Cyber-Physical Systems Group CUDA Programming (Basics, Cuda Threads, Atomics) Ezio Bartocci Outline of CUDA Basics Basic Kernels and Execution on GPU

More information

Module 2: Introduction to CUDA C. Objective

Module 2: Introduction to CUDA C. Objective ECE 8823A GPU Architectures Module 2: Introduction to CUDA C 1 Objective To understand the major elements of a CUDA program Introduce the basic constructs of the programming model Illustrate the preceding

More information

Introduction to GPU programming. Introduction to GPU programming p. 1/17

Introduction to GPU programming. Introduction to GPU programming p. 1/17 Introduction to GPU programming Introduction to GPU programming p. 1/17 Introduction to GPU programming p. 2/17 Overview GPUs & computing Principles of CUDA programming One good reference: David B. Kirk

More information

Parallel Numerical Algorithms

Parallel Numerical Algorithms Parallel Numerical Algorithms http://sudalab.is.s.u-tokyo.ac.jp/~reiji/pna14/ [ 10 ] GPU and CUDA Parallel Numerical Algorithms / IST / UTokyo 1 PNA16 Lecture Plan General Topics 1. Architecture and Performance

More information

Module 2: Introduction to CUDA C

Module 2: Introduction to CUDA C ECE 8823A GPU Architectures Module 2: Introduction to CUDA C 1 Objective To understand the major elements of a CUDA program Introduce the basic constructs of the programming model Illustrate the preceding

More information

GPU CUDA Programming

GPU CUDA Programming GPU CUDA Programming 이정근 (Jeong-Gun Lee) 한림대학교컴퓨터공학과, 임베디드 SoC 연구실 www.onchip.net Email: Jeonggun.Lee@hallym.ac.kr ALTERA JOINT LAB Introduction 차례 Multicore/Manycore and GPU GPU on Medical Applications

More information

CS 179: GPU Computing. Lecture 2: The Basics

CS 179: GPU Computing. Lecture 2: The Basics CS 179: GPU Computing Lecture 2: The Basics Recap Can use GPU to solve highly parallelizable problems Performance benefits vs. CPU Straightforward extension to C language Disclaimer Goal for Week 1: Fast-paced

More information

Lecture 3: Introduction to CUDA

Lecture 3: Introduction to CUDA CSCI-GA.3033-004 Graphics Processing Units (GPUs): Architecture and Programming Lecture 3: Introduction to CUDA Some slides here are adopted from: NVIDIA teaching kit Mohamed Zahran (aka Z) mzahran@cs.nyu.edu

More information

CSE 160 Lecture 24. Graphical Processing Units

CSE 160 Lecture 24. Graphical Processing Units CSE 160 Lecture 24 Graphical Processing Units Announcements Next week we meet in 1202 on Monday 3/11 only On Weds 3/13 we have a 2 hour session Usual class time at the Rady school final exam review SDSC

More information

Lecture 2: Introduction to CUDA C

Lecture 2: Introduction to CUDA C CS/EE 217 GPU Architecture and Programming Lecture 2: Introduction to CUDA C David Kirk/NVIDIA and Wen-mei W. Hwu, 2007-2013 1 CUDA /OpenCL Execution Model Integrated host+device app C program Serial or

More information

GPU Programming Using CUDA. Samuli Laine NVIDIA Research

GPU Programming Using CUDA. Samuli Laine NVIDIA Research GPU Programming Using CUDA Samuli Laine NVIDIA Research Today GPU vs CPU Different architecture, different workloads Basics of CUDA Executing code on GPU Managing memory between CPU and GPU CUDA API Quick

More information

Tesla Architecture, CUDA and Optimization Strategies

Tesla Architecture, CUDA and Optimization Strategies Tesla Architecture, CUDA and Optimization Strategies Lan Shi, Li Yi & Liyuan Zhang Hauptseminar: Multicore Architectures and Programming Page 1 Outline Tesla Architecture & CUDA CUDA Programming Optimization

More information

Lecture 9. Outline. CUDA : a General-Purpose Parallel Computing Architecture. CUDA Device and Threads CUDA. CUDA Architecture CUDA (I)

Lecture 9. Outline. CUDA : a General-Purpose Parallel Computing Architecture. CUDA Device and Threads CUDA. CUDA Architecture CUDA (I) Lecture 9 CUDA CUDA (I) Compute Unified Device Architecture 1 2 Outline CUDA Architecture CUDA Architecture CUDA programming model CUDA-C 3 4 CUDA : a General-Purpose Parallel Computing Architecture CUDA

More information

Lecture 15: Introduction to GPU programming. Lecture 15: Introduction to GPU programming p. 1

Lecture 15: Introduction to GPU programming. Lecture 15: Introduction to GPU programming p. 1 Lecture 15: Introduction to GPU programming Lecture 15: Introduction to GPU programming p. 1 Overview Hardware features of GPGPU Principles of GPU programming A good reference: David B. Kirk and Wen-mei

More information

An Introduction to GPGPU Pro g ra m m ing - CUDA Arc hitec ture

An Introduction to GPGPU Pro g ra m m ing - CUDA Arc hitec ture An Introduction to GPGPU Pro g ra m m ing - CUDA Arc hitec ture Rafia Inam Mälardalen Real-Time Research Centre Mälardalen University, Västerås, Sweden http://www.mrtc.mdh.se rafia.inam@mdh.se CONTENTS

More information

Introduction to Parallel Computing with CUDA. Oswald Haan

Introduction to Parallel Computing with CUDA. Oswald Haan Introduction to Parallel Computing with CUDA Oswald Haan ohaan@gwdg.de Schedule Introduction to Parallel Computing with CUDA Using CUDA CUDA Application Examples Using Multiple GPUs CUDA Application Libraries

More information

EEM528 GPU COMPUTING

EEM528 GPU COMPUTING EEM528 CS 193G GPU COMPUTING Lecture 2: GPU History & CUDA Programming Basics Slides Credit: Jared Hoberock & David Tarjan CS 193G History of GPUs Graphics in a Nutshell Make great images intricate shapes

More information

HPCSE II. GPU programming and CUDA

HPCSE II. GPU programming and CUDA HPCSE II GPU programming and CUDA What is a GPU? Specialized for compute-intensive, highly-parallel computation, i.e. graphic output Evolution pushed by gaming industry CPU: large die area for control

More information

Scientific discovery, analysis and prediction made possible through high performance computing.

Scientific discovery, analysis and prediction made possible through high performance computing. Scientific discovery, analysis and prediction made possible through high performance computing. An Introduction to GPGPU Programming Bob Torgerson Arctic Region Supercomputing Center November 21 st, 2013

More information

CUDA C Programming Mark Harris NVIDIA Corporation

CUDA C Programming Mark Harris NVIDIA Corporation CUDA C Programming Mark Harris NVIDIA Corporation Agenda Tesla GPU Computing CUDA Fermi What is GPU Computing? Introduction to Tesla CUDA Architecture Programming & Memory Models Programming Environment

More information

An Introduction to GPU Architecture and CUDA C/C++ Programming. Bin Chen April 4, 2018 Research Computing Center

An Introduction to GPU Architecture and CUDA C/C++ Programming. Bin Chen April 4, 2018 Research Computing Center An Introduction to GPU Architecture and CUDA C/C++ Programming Bin Chen April 4, 2018 Research Computing Center Outline Introduction to GPU architecture Introduction to CUDA programming model Using the

More information

CUDA. Schedule API. Language extensions. nvcc. Function type qualifiers (1) CUDA compiler to handle the standard C extensions.

CUDA. Schedule API. Language extensions. nvcc. Function type qualifiers (1) CUDA compiler to handle the standard C extensions. Schedule CUDA Digging further into the programming manual Application Programming Interface (API) text only part, sorry Image utilities (simple CUDA examples) Performace considerations Matrix multiplication

More information

GPU Programming Using CUDA. Samuli Laine NVIDIA Research

GPU Programming Using CUDA. Samuli Laine NVIDIA Research GPU Programming Using CUDA Samuli Laine NVIDIA Research Today GPU vs CPU Different architecture, different workloads Basics of CUDA Executing code on GPU Managing memory between CPU and GPU CUDA API Quick

More information

Parallel Programming Principle and Practice. Lecture 9 Introduction to GPGPUs and CUDA Programming Model

Parallel Programming Principle and Practice. Lecture 9 Introduction to GPGPUs and CUDA Programming Model Parallel Programming Principle and Practice Lecture 9 Introduction to GPGPUs and CUDA Programming Model Outline Introduction to GPGPUs and Cuda Programming Model The Cuda Thread Hierarchy / Memory Hierarchy

More information

CUDA Basics. July 6, 2016

CUDA Basics. July 6, 2016 Mitglied der Helmholtz-Gemeinschaft CUDA Basics July 6, 2016 CUDA Kernels Parallel portion of application: execute as a kernel Entire GPU executes kernel, many threads CUDA threads: Lightweight Fast switching

More information

Introduction to CUDA Programming

Introduction to CUDA Programming Introduction to CUDA Programming Steve Lantz Cornell University Center for Advanced Computing October 30, 2013 Based on materials developed by CAC and TACC Outline Motivation for GPUs and CUDA Overview

More information

CUDA Workshop. High Performance GPU computing EXEBIT Karthikeyan

CUDA Workshop. High Performance GPU computing EXEBIT Karthikeyan CUDA Workshop High Performance GPU computing EXEBIT- 2014 Karthikeyan CPU vs GPU CPU Very fast, serial, Low Latency GPU Slow, massively parallel, High Throughput Play Demonstration Compute Unified Device

More information

Basic Elements of CUDA Algoritmi e Calcolo Parallelo. Daniele Loiacono

Basic Elements of CUDA Algoritmi e Calcolo Parallelo. Daniele Loiacono Basic Elements of CUDA Algoritmi e Calcolo Parallelo References This set of slides is mainly based on: CUDA Technical Training, Dr. Antonino Tumeo, Pacific Northwest National Laboratory Slide of Applied

More information

COSC 6385 Computer Architecture. - Multi-Processors (V) The Intel Larrabee, Nvidia GT200 and Fermi processors

COSC 6385 Computer Architecture. - Multi-Processors (V) The Intel Larrabee, Nvidia GT200 and Fermi processors COSC 6385 Computer Architecture - Multi-Processors (V) The Intel Larrabee, Nvidia GT200 and Fermi processors Fall 2012 References Intel Larrabee: [1] L. Seiler, D. Carmean, E. Sprangle, T. Forsyth, M.

More information

General Purpose GPU programming (GP-GPU) with Nvidia CUDA. Libby Shoop

General Purpose GPU programming (GP-GPU) with Nvidia CUDA. Libby Shoop General Purpose GPU programming (GP-GPU) with Nvidia CUDA Libby Shoop 3 What is (Historical) GPGPU? General Purpose computation using GPU and graphics API in applications other than 3D graphics GPU accelerates

More information

Introduction to Numerical General Purpose GPU Computing with NVIDIA CUDA. Part 1: Hardware design and programming model

Introduction to Numerical General Purpose GPU Computing with NVIDIA CUDA. Part 1: Hardware design and programming model Introduction to Numerical General Purpose GPU Computing with NVIDIA CUDA Part 1: Hardware design and programming model Dirk Ribbrock Faculty of Mathematics, TU dortmund 2016 Table of Contents Why parallel

More information

Introduction to GPGPUs and to CUDA programming model

Introduction to GPGPUs and to CUDA programming model Introduction to GPGPUs and to CUDA programming model www.cineca.it Marzia Rivi m.rivi@cineca.it GPGPU architecture CUDA programming model CUDA efficient programming Debugging & profiling tools CUDA libraries

More information

CS179 GPU Programming Recitation 4: CUDA Particles

CS179 GPU Programming Recitation 4: CUDA Particles Recitation 4: CUDA Particles Lab 4 CUDA Particle systems Two parts Simple repeat of Lab 3 Interacting Flocking simulation 2 Setup Two folders given particles_simple, particles_interact Must install NVIDIA_CUDA_SDK

More information

INTRODUCTION TO GPU COMPUTING WITH CUDA. Topi Siro

INTRODUCTION TO GPU COMPUTING WITH CUDA. Topi Siro INTRODUCTION TO GPU COMPUTING WITH CUDA Topi Siro 19.10.2015 OUTLINE PART I - Tue 20.10 10-12 What is GPU computing? What is CUDA? Running GPU jobs on Triton PART II - Thu 22.10 10-12 Using libraries Different

More information

University of Bielefeld

University of Bielefeld Geistes-, Natur-, Sozial- und Technikwissenschaften gemeinsam unter einem Dach Introduction to GPU Programming using CUDA Olaf Kaczmarek University of Bielefeld STRONGnet Summerschool 2011 ZIF Bielefeld

More information

CUDA Architecture & Programming Model

CUDA Architecture & Programming Model CUDA Architecture & Programming Model Course on Multi-core Architectures & Programming Oliver Taubmann May 9, 2012 Outline Introduction Architecture Generation Fermi A Brief Look Back At Tesla What s New

More information

COMP 322: Fundamentals of Parallel Programming. Flynn s Taxonomy for Parallel Computers

COMP 322: Fundamentals of Parallel Programming. Flynn s Taxonomy for Parallel Computers COMP 322: Fundamentals of Parallel Programming Lecture 37: General-Purpose GPU (GPGPU) Computing Max Grossman, Vivek Sarkar Department of Computer Science, Rice University max.grossman@rice.edu, vsarkar@rice.edu

More information

HPC COMPUTING WITH CUDA AND TESLA HARDWARE. Timothy Lanfear, NVIDIA

HPC COMPUTING WITH CUDA AND TESLA HARDWARE. Timothy Lanfear, NVIDIA HPC COMPUTING WITH CUDA AND TESLA HARDWARE Timothy Lanfear, NVIDIA WHAT IS GPU COMPUTING? What is GPU Computing? x86 PCIe bus GPU Computing with CPU + GPU Heterogeneous Computing Low Latency or High Throughput?

More information

Massively Parallel Algorithms

Massively Parallel Algorithms Massively Parallel Algorithms Introduction to CUDA & Many Fundamental Concepts of Parallel Programming G. Zachmann University of Bremen, Germany cgvr.cs.uni-bremen.de Hybrid/Heterogeneous Computation/Architecture

More information

Memory concept. Grid concept, Synchronization. GPU Programming. Szénási Sándor.

Memory concept. Grid concept, Synchronization. GPU Programming.   Szénási Sándor. Memory concept Grid concept, Synchronization GPU Programming http://cuda.nik.uni-obuda.hu Szénási Sándor szenasi.sandor@nik.uni-obuda.hu GPU Education Center of Óbuda University MEMORY CONCEPT Off-chip

More information

Programming with CUDA, WS09

Programming with CUDA, WS09 Programming with CUDA and Parallel Algorithms Waqar Saleem Jens Müller Lecture 3 Thursday, 29 Nov, 2009 Recap Motivational videos Example kernel Thread IDs Memory overhead CUDA hardware and programming

More information

Information Coding / Computer Graphics, ISY, LiTH. Introduction to CUDA. Ingemar Ragnemalm Information Coding, ISY

Information Coding / Computer Graphics, ISY, LiTH. Introduction to CUDA. Ingemar Ragnemalm Information Coding, ISY Introduction to CUDA Ingemar Ragnemalm Information Coding, ISY This lecture: Programming model and language Introduction to memory spaces and memory access Shared memory Matrix multiplication example Lecture

More information

Technische Universität München. GPU Programming. Rüdiger Westermann Chair for Computer Graphics & Visualization. Faculty of Informatics

Technische Universität München. GPU Programming. Rüdiger Westermann Chair for Computer Graphics & Visualization. Faculty of Informatics GPU Programming Rüdiger Westermann Chair for Computer Graphics & Visualization Faculty of Informatics Overview Programming interfaces and support libraries The CUDA programming abstraction An in-depth

More information

Overview. Lecture 1: an introduction to CUDA. Hardware view. Hardware view. hardware view software view CUDA programming

Overview. Lecture 1: an introduction to CUDA. Hardware view. Hardware view. hardware view software view CUDA programming Overview Lecture 1: an introduction to CUDA Mike Giles mike.giles@maths.ox.ac.uk hardware view software view Oxford University Mathematical Institute Oxford e-research Centre Lecture 1 p. 1 Lecture 1 p.

More information

COSC 6374 Parallel Computations Introduction to CUDA

COSC 6374 Parallel Computations Introduction to CUDA COSC 6374 Parallel Computations Introduction to CUDA Edgar Gabriel Fall 2014 Disclaimer Material for this lecture has been adopted based on various sources Matt Heavener, CS, State Univ. of NY at Buffalo

More information

Tutorial: Parallel programming technologies on hybrid architectures HybriLIT Team

Tutorial: Parallel programming technologies on hybrid architectures HybriLIT Team Tutorial: Parallel programming technologies on hybrid architectures HybriLIT Team Laboratory of Information Technologies Joint Institute for Nuclear Research The Helmholtz International Summer School Lattice

More information

Josef Pelikán, Jan Horáček CGG MFF UK Praha

Josef Pelikán, Jan Horáček CGG MFF UK Praha GPGPU and CUDA 2012-2018 Josef Pelikán, Jan Horáček CGG MFF UK Praha pepca@cgg.mff.cuni.cz http://cgg.mff.cuni.cz/~pepca/ 1 / 41 Content advances in hardware multi-core vs. many-core general computing

More information

Introduction to GPU Computing Using CUDA. Spring 2014 Westgid Seminar Series

Introduction to GPU Computing Using CUDA. Spring 2014 Westgid Seminar Series Introduction to GPU Computing Using CUDA Spring 2014 Westgid Seminar Series Scott Northrup SciNet www.scinethpc.ca (Slides http://support.scinet.utoronto.ca/ northrup/westgrid CUDA.pdf) March 12, 2014

More information

Introduction to GPU Computing Using CUDA. Spring 2014 Westgid Seminar Series

Introduction to GPU Computing Using CUDA. Spring 2014 Westgid Seminar Series Introduction to GPU Computing Using CUDA Spring 2014 Westgid Seminar Series Scott Northrup SciNet www.scinethpc.ca March 13, 2014 Outline 1 Heterogeneous Computing 2 GPGPU - Overview Hardware Software

More information

Introduction to CUDA

Introduction to CUDA Introduction to CUDA Overview HW computational power Graphics API vs. CUDA CUDA glossary Memory model, HW implementation, execution Performance guidelines CUDA compiler C/C++ Language extensions Limitations

More information

CUDA Lecture 2. Manfred Liebmann. Technische Universität München Chair of Optimal Control Center for Mathematical Sciences, M17

CUDA Lecture 2. Manfred Liebmann. Technische Universität München Chair of Optimal Control Center for Mathematical Sciences, M17 CUDA Lecture 2 Manfred Liebmann Technische Universität München Chair of Optimal Control Center for Mathematical Sciences, M17 manfred.liebmann@tum.de December 15, 2015 CUDA Programming Fundamentals CUDA

More information

High Performance Computing and GPU Programming

High Performance Computing and GPU Programming High Performance Computing and GPU Programming Lecture 1: Introduction Objectives C++/CPU Review GPU Intro Programming Model Objectives Objectives Before we begin a little motivation Intel Xeon 2.67GHz

More information

COSC 6339 Accelerators in Big Data

COSC 6339 Accelerators in Big Data COSC 6339 Accelerators in Big Data Edgar Gabriel Fall 2018 Motivation Programming models such as MapReduce and Spark provide a high-level view of parallelism not easy for all problems, e.g. recursive algorithms,

More information

Information Coding / Computer Graphics, ISY, LiTH. Introduction to CUDA. Ingemar Ragnemalm Information Coding, ISY

Information Coding / Computer Graphics, ISY, LiTH. Introduction to CUDA. Ingemar Ragnemalm Information Coding, ISY Introduction to CUDA Ingemar Ragnemalm Information Coding, ISY This lecture: Programming model and language Memory spaces and memory access Shared memory Examples Lecture questions: 1. Suggest two significant

More information

Introduc)on to GPU Programming

Introduc)on to GPU Programming Introduc)on to GPU Programming Mubashir Adnan Qureshi h3p://www.ncsa.illinois.edu/people/kindr/projects/hpca/files/singapore_p1.pdf h3p://developer.download.nvidia.com/cuda/training/nvidia_gpu_compu)ng_webinars_cuda_memory_op)miza)on.pdf

More information

Practical Introduction to CUDA and GPU

Practical Introduction to CUDA and GPU Practical Introduction to CUDA and GPU Charlie Tang Centre for Theoretical Neuroscience October 9, 2009 Overview CUDA - stands for Compute Unified Device Architecture Introduced Nov. 2006, a parallel computing

More information

Lecture 10!! Introduction to CUDA!

Lecture 10!! Introduction to CUDA! 1(50) Lecture 10 Introduction to CUDA Ingemar Ragnemalm Information Coding, ISY 1(50) Laborations Some revisions may happen while making final adjustments for Linux Mint. Last minute changes may occur.

More information

ECE 574 Cluster Computing Lecture 15

ECE 574 Cluster Computing Lecture 15 ECE 574 Cluster Computing Lecture 15 Vince Weaver http://web.eece.maine.edu/~vweaver vincent.weaver@maine.edu 30 March 2017 HW#7 (MPI) posted. Project topics due. Update on the PAPI paper Announcements

More information

Basic unified GPU architecture

Basic unified GPU architecture Basic unified GPU architecture SM=streaming multiprocessor TPC = Texture Processing Cluster SFU = special function unit ROP = raster operations pipeline 78 Note: The following slides are extracted from

More information

Basic CUDA workshop. Outlines. Setting Up Your Machine Architecture Getting Started Programming CUDA. Fine-Tuning. Penporn Koanantakool

Basic CUDA workshop. Outlines. Setting Up Your Machine Architecture Getting Started Programming CUDA. Fine-Tuning. Penporn Koanantakool Basic CUDA workshop Penporn Koanantakool twitter: @kaewgb e-mail: kaewgb@gmail.com Outlines Setting Up Your Machine Architecture Getting Started Programming CUDA Debugging Fine-Tuning Setting Up Your Machine

More information

GPU Programming Using CUDA

GPU Programming Using CUDA GPU Programming Using CUDA Michael J. Schnieders Depts. of Biomedical Engineering & Biochemistry The University of Iowa & Gregory G. Howes Department of Physics and Astronomy The University of Iowa Iowa

More information

Cartoon parallel architectures; CPUs and GPUs

Cartoon parallel architectures; CPUs and GPUs Cartoon parallel architectures; CPUs and GPUs CSE 6230, Fall 2014 Th Sep 11! Thanks to Jee Choi (a senior PhD student) for a big assist 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ~ socket 14 ~ core 14 ~ HWMT+SIMD

More information

Introduction to GPU Computing Junjie Lai, NVIDIA Corporation

Introduction to GPU Computing Junjie Lai, NVIDIA Corporation Introduction to GPU Computing Junjie Lai, NVIDIA Corporation Outline Evolution of GPU Computing Heterogeneous Computing CUDA Execution Model & Walkthrough of Hello World Walkthrough : 1D Stencil Once upon

More information

CUDA Programming. Aiichiro Nakano

CUDA Programming. Aiichiro Nakano CUDA Programming Aiichiro Nakano Collaboratory for Advanced Computing & Simulations Department of Computer Science Department of Physics & Astronomy Department of Chemical Engineering & Materials Science

More information

CS 179: GPU Computing LECTURE 4: GPU MEMORY SYSTEMS

CS 179: GPU Computing LECTURE 4: GPU MEMORY SYSTEMS CS 179: GPU Computing LECTURE 4: GPU MEMORY SYSTEMS 1 Last time Each block is assigned to and executed on a single streaming multiprocessor (SM). Threads execute in groups of 32 called warps. Threads in

More information

Computer Architecture

Computer Architecture Jens Teubner Computer Architecture Summer 2017 1 Computer Architecture Jens Teubner, TU Dortmund jens.teubner@cs.tu-dortmund.de Summer 2017 Jens Teubner Computer Architecture Summer 2017 34 Part II Graphics

More information

COSC 6385 Computer Architecture. - Data Level Parallelism (II)

COSC 6385 Computer Architecture. - Data Level Parallelism (II) COSC 6385 Computer Architecture - Data Level Parallelism (II) Fall 2013 SIMD Instructions Originally developed for Multimedia applications Same operation executed for multiple data items Uses a fixed length

More information

Lecture 3. Programming with GPUs

Lecture 3. Programming with GPUs Lecture 3 Programming with GPUs GPU access Announcements lilliput: Tesla C1060 (4 devices) cseclass0{1,2}: Fermi GTX 570 (1 device each) MPI Trestles @ SDSC Kraken @ NICS 2011 Scott B. Baden / CSE 262

More information

CUDA C/C++ BASICS. NVIDIA Corporation

CUDA C/C++ BASICS. NVIDIA Corporation CUDA C/C++ BASICS NVIDIA Corporation What is CUDA? CUDA Architecture Expose GPU parallelism for general-purpose computing Retain performance CUDA C/C++ Based on industry-standard C/C++ Small set of extensions

More information

GPU Computing: A Quick Start

GPU Computing: A Quick Start GPU Computing: A Quick Start Orest Shardt Department of Chemical and Materials Engineering University of Alberta August 25, 2011 Session Goals Get you started with highly parallel LBM Take a practical

More information

Parallel Programming and Debugging with CUDA C. Geoff Gerfin Sr. System Software Engineer

Parallel Programming and Debugging with CUDA C. Geoff Gerfin Sr. System Software Engineer Parallel Programming and Debugging with CUDA C Geoff Gerfin Sr. System Software Engineer CUDA - NVIDIA s Architecture for GPU Computing Broad Adoption Over 250M installed CUDA-enabled GPUs GPU Computing

More information

GPU Architecture and Programming. Andrei Doncescu inspired by NVIDIA

GPU Architecture and Programming. Andrei Doncescu inspired by NVIDIA GPU Architecture and Programming Andrei Doncescu inspired by NVIDIA Traditional Computing Von Neumann architecture: instructions are sent from memory to the CPU Serial execution: Instructions are executed

More information

GPU COMPUTING. Ana Lucia Varbanescu (UvA)

GPU COMPUTING. Ana Lucia Varbanescu (UvA) GPU COMPUTING Ana Lucia Varbanescu (UvA) 2 Graphics in 1980 3 Graphics in 2000 4 Graphics in 2015 GPUs in movies 5 From Ariel in Little Mermaid to Brave So 6 GPUs are a steady market Gaming CAD-like activities

More information

Parallel Systems Course: Chapter IV. GPU Programming. Jan Lemeire Dept. ETRO November 6th 2008

Parallel Systems Course: Chapter IV. GPU Programming. Jan Lemeire Dept. ETRO November 6th 2008 Parallel Systems Course: Chapter IV GPU Programming Jan Lemeire Dept. ETRO November 6th 2008 GPU Message-passing Programming with Parallel CUDAMessagepassing Parallel Processing Processing Overview 1.

More information

HPC Middle East. KFUPM HPC Workshop April Mohamed Mekias HPC Solutions Consultant. Introduction to CUDA programming

HPC Middle East. KFUPM HPC Workshop April Mohamed Mekias HPC Solutions Consultant. Introduction to CUDA programming KFUPM HPC Workshop April 29-30 2015 Mohamed Mekias HPC Solutions Consultant Introduction to CUDA programming 1 Agenda GPU Architecture Overview Tools of the Trade Introduction to CUDA C Patterns of Parallel

More information

Accelerator cards are typically PCIx cards that supplement a host processor, which they require to operate Today, the most common accelerators include

Accelerator cards are typically PCIx cards that supplement a host processor, which they require to operate Today, the most common accelerators include 3.1 Overview Accelerator cards are typically PCIx cards that supplement a host processor, which they require to operate Today, the most common accelerators include GPUs (Graphics Processing Units) AMD/ATI

More information

CUDA C/C++ BASICS. NVIDIA Corporation

CUDA C/C++ BASICS. NVIDIA Corporation CUDA C/C++ BASICS NVIDIA Corporation What is CUDA? CUDA Architecture Expose GPU parallelism for general-purpose computing Retain performance CUDA C/C++ Based on industry-standard C/C++ Small set of extensions

More information

CUDA programming model. N. Cardoso & P. Bicudo. Física Computacional (FC5)

CUDA programming model. N. Cardoso & P. Bicudo. Física Computacional (FC5) CUDA programming model N. Cardoso & P. Bicudo Física Computacional (FC5) N. Cardoso & P. Bicudo CUDA programming model 1/23 Outline 1 CUDA qualifiers 2 CUDA Kernel Thread hierarchy Kernel, configuration

More information

Lecture 11: GPU programming

Lecture 11: GPU programming Lecture 11: GPU programming David Bindel 4 Oct 2011 Logistics Matrix multiply results are ready Summary on assignments page My version (and writeup) on CMS HW 2 due Thursday Still working on project 2!

More information

Lecture 1: an introduction to CUDA

Lecture 1: an introduction to CUDA Lecture 1: an introduction to CUDA Mike Giles mike.giles@maths.ox.ac.uk Oxford University Mathematical Institute Oxford e-research Centre Lecture 1 p. 1 Overview hardware view software view CUDA programming

More information

Lecture 8: GPU Programming. CSE599G1: Spring 2017

Lecture 8: GPU Programming. CSE599G1: Spring 2017 Lecture 8: GPU Programming CSE599G1: Spring 2017 Announcements Project proposal due on Thursday (4/28) 5pm. Assignment 2 will be out today, due in two weeks. Implement GPU kernels and use cublas library

More information

CUDA Performance Optimization. Patrick Legresley

CUDA Performance Optimization. Patrick Legresley CUDA Performance Optimization Patrick Legresley Optimizations Kernel optimizations Maximizing global memory throughput Efficient use of shared memory Minimizing divergent warps Intrinsic instructions Optimizations

More information

GPU Computing Workshop CSU Getting Started. Garland Durham Quantos Analytics

GPU Computing Workshop CSU Getting Started. Garland Durham Quantos Analytics 1 GPU Computing Workshop CSU 2013 Getting Started Garland Durham Quantos Analytics nvidia-smi 2 At command line, run command nvidia-smi to get/set GPU properties. nvidia-smi Options: -q query -L list attached

More information

Introduction to CELL B.E. and GPU Programming. Agenda

Introduction to CELL B.E. and GPU Programming. Agenda Introduction to CELL B.E. and GPU Programming Department of Electrical & Computer Engineering Rutgers University Agenda Background CELL B.E. Architecture Overview CELL B.E. Programming Environment GPU

More information

Review. Lecture 10. Today s Outline. Review. 03b.cu. 03?.cu CUDA (II) Matrix addition CUDA-C API

Review. Lecture 10. Today s Outline. Review. 03b.cu. 03?.cu CUDA (II) Matrix addition CUDA-C API Review Lecture 10 CUDA (II) host device CUDA many core processor threads thread blocks grid # threads >> # of cores to be efficient Threads within blocks can cooperate Threads between thread blocks cannot

More information

CS377P Programming for Performance GPU Programming - I

CS377P Programming for Performance GPU Programming - I CS377P Programming for Performance GPU Programming - I Sreepathi Pai UTCS November 9, 2015 Outline 1 Introduction to CUDA 2 Basic Performance 3 Memory Performance Outline 1 Introduction to CUDA 2 Basic

More information

Advanced CUDA Optimizations. Umar Arshad ArrayFire

Advanced CUDA Optimizations. Umar Arshad ArrayFire Advanced CUDA Optimizations Umar Arshad (@arshad_umar) ArrayFire (@arrayfire) ArrayFire World s leading GPU experts In the industry since 2007 NVIDIA Partner Deep experience working with thousands of customers

More information

Introduction to GPU hardware and to CUDA

Introduction to GPU hardware and to CUDA Introduction to GPU hardware and to CUDA Philip Blakely Laboratory for Scientific Computing, University of Cambridge Philip Blakely (LSC) GPU introduction 1 / 35 Course outline Introduction to GPU hardware

More information

GPU Computing: Introduction to CUDA. Dr Paul Richmond

GPU Computing: Introduction to CUDA. Dr Paul Richmond GPU Computing: Introduction to CUDA Dr Paul Richmond http://paulrichmond.shef.ac.uk This lecture CUDA Programming Model CUDA Device Code CUDA Host Code and Memory Management CUDA Compilation Programming

More information

GPU programming. Dr. Bernhard Kainz

GPU programming. Dr. Bernhard Kainz GPU programming Dr. Bernhard Kainz Overview About myself Motivation GPU hardware and system architecture GPU programming languages GPU programming paradigms Pitfalls and best practice Reduction and tiling

More information

CUDA Programming Model

CUDA Programming Model CUDA Xing Zeng, Dongyue Mou Introduction Example Pro & Contra Trend Introduction Example Pro & Contra Trend Introduction What is CUDA? - Compute Unified Device Architecture. - A powerful parallel programming

More information

ECE 574 Cluster Computing Lecture 17

ECE 574 Cluster Computing Lecture 17 ECE 574 Cluster Computing Lecture 17 Vince Weaver http://web.eece.maine.edu/~vweaver vincent.weaver@maine.edu 28 March 2019 HW#8 (CUDA) posted. Project topics due. Announcements 1 CUDA installing On Linux

More information