OpenMP and GPU Programming

Size: px
Start display at page:

Download "OpenMP and GPU Programming"

Transcription

1 OpenMP and GPU Programming GPU Intro Emanuele Ruffaldi PERCeptual RObotics Laboratory, TeCIP Scuola Superiore Sant Anna Pisa,Italy April 12,2016

2 GPU Graphic Processing Units (GPU) in the last decade have taken the lead in performance by exploiting specialized architectures with high parallelism. This has allowed to move from pure graphic application to General Processing (GPGPU) providing new possibilities in the area of Machine Learning and Computer Vision running from in the cloud down to embedded GPUs in mobile, robotics and, more recently in cars. Which is the current performance level? GFlop/Watt, Dollar/Watt? Which architectural features have got GPU to such success?

3 GPU vs CPU This is a graph showing the trend in GFLOP/s wrt the time.

4 Some Numbers Nowadays a NVidia GTX Titan X scores 6 TFlop in single precision, while the most powerful NVidia board is the NVidia DGX-1 providing 170 TFlops SP thanks to 8 GP100 GPUs (estimated 130k USD). Each Tesla P100 provides 11 TFlops SP with 15 Billion transistors. In comparison the last AMD GPU board is an Radeon Pro Duo providing 16 TFlops SP with Billion transistors with two GPus. In comparison an Intel Core i7-6700k Processor has a theoretical throughput of 113 GFlops running at 4.2GHz with

5 NVidia Hardware The building block is the Streaming Multiprocessor (SM) containing: cores organized in warps registers for cores number of threads running L1 cache shared memory for threads Chips of the same NVidia generation differ in the number of SMs reported as the total number of cores, available memory and running frequency. For example the GTX Titan Black has 2880 cores. NVidia hardware is organized in generations with different internal layout per-sm Double precision requires additional cores inside each SM

6 NVidia Pascal SM For example Pascal has each SM split in two sharing cache/shared memory, but not registers. The total number of cores is 64, much less than the 192/128 of previous Kepler/Maxwell.

7 GPU Origin and Working Principle A GPU is a heterogeneous chip multi-processor highly tuned for graphics Recall the approach of the graphic pipeline: vertex processing, per-pixel processing with large specialized memory access to textures Per-pixel processing is highly parallel but defined implicitly with specific order managed by the driver Example of units Shader Core Texture Unit (sampling) Input Assembly Rasterizer Output Blend Video Decoding (e.g. h.264) Work Distributor

8 SIMD Working Principle Per-pixel processing follows the approach of Single Instruction Multiple Data (SIMD) In CPUs (e.g. x86 SSE, AVX) SIMD instructions are specified explicitly acting on 4 or 8 data elements In GPUs the vectorized execution is implicitly managed by the compiler while the developer specifies scalar instructions In particular NVidia uses a mix between flexibility and efficiency called Single Instruction Multiple Threads (SIMT) In a SIMT system a group of parallel units (threads) are executed synchronously executing step by step the same instruction but impacting on different register contexts and on different local/global memory locations. Thanks to low-level thread indexing each unit performs the same task on a different part of the problem.

9 Explicit vs Implicit Vectorization Example of explicit vectorization wit ARM Neon void add ( u i n t 3 2 t a, u i n t 3 2 t b, u i n t 3 2 t c, int n ) { for ( int i =0; i<n ; i +=4) { // compute c[i], c[i+1], c[i+2], c[i +3] uint32x4 t a<4 = vld1q u32 ( a+i ) ; uint32x4 t b4 = vld1q u32 ( b+i ) ; uint32x4 t c4 = vaddq u32 ( a4, b4 ) ; v s t 1 q u 3 2 ( c+i, c4 ) ; } } CUDA scalar version g l o b a l void add ( float a, float b, float c ) { int i = b l o c k I d x. x blockdim. x + t h r e a d I d x. x ; a [ i ]=b [ i ]+ c [ i ] ; // no loop! } Note also that CUDA supports float2 and float4. Code taken from here.

10 NVidia SIMT Features In an NVidia machine this group of synchronous threads is called a warp containing 32 threads (up to Maxell architecture). Warps are then allocated in a structure. Branching in NVidia SIMT is typically handled using instruction level predicates that mark if a single instruction is active due to some previous branching state Threads in the warp can communicate with three types of memory: const memory warp local memory global memory The objective of the sync parallel execution is to achieve throughput by aligned memory access and shared dependencies

11 AMD Graphics Core Next GCN is the last iteration of AMD technology. It moved from a VLIW structure to RISC SIMD Conceptually similar to the NVIDIA SIMT approach Differently from the NVIDIA approach each GCN Compute Unit has 4 by 16 different low level units and it can deal with multiple instructions assigned at

12 CUDA Basics CUDA is a toolkit that allows the development of NVidia GPU from the perspective of General Processing with GPUs. Here some terminology: Host: the computer Device: the GPU unit (more than one possible) CUDA provides two approaches corresponding to two different API runtime: easy pre-compiled driver: complex, run-time compilation The working principle of CUDA C/C++ compiler (nvcc) is a dual-path compilation: the C/C++ code contains special attributes that mark the fact that some code will be run on the Device, while the rest runs on the Host. The Host invokes the execution of the code on the Device with a novel syntax and the compiler hides the invocation of run-time functions that perform this operation.

13 CUDA Hello World The tool nvcc takes regular C/C++ code (files with extension.cu) identifies the Device part, compiles both on CPU and on GPU and then assembles the executable in which the two elements are integrated. Take for example the following minimal hello world: g l o b a l void k e r n e l ( void ) { } int main ( void ) { k e r n e l <<<1,1>>>(); p r i n t f ( " Hello, World!\ n" ) ; return 0 ; } 1. The kernel function is marked global to be executed on the Device and invoked by the CPU. 2. The triple bracket operator means to run the function kernel on the GPU with a parallelism specification, in this case it is executed once.

14 CUDA Summation The previous example is a bit empty so we want to make it more practical by using the summation of elements. But before the execution we need to allocate memory. Memory space of Host and Device are separate, so there is the need to allocate memory on GPU, transfer content back and forth the GPU before and after the execution. cudamalloc, cudafree,cudamemcpy equivalent to malloc,free,memcpy, except that cudamemcpy allows to specify the location of the transfer (Host/Device)

15 CUDA Summation - main g l o b a l void add ( int a, int b, int c ) { c = a + b ; } int main ( void ) { int a=2, b=7, c ; // host copies of a, b, c int dev a, dev b, dev c ; // device copies of a, b, c int s i z e = sizeof ( int ) ; // we need space for an integer cudamalloc ( ( void )&dev a, s i z e ) ; cudamalloc ( ( void )&dev b, s i z e ) ; cudamalloc ( ( void )& dev c, s i z e ) ; cudamemcpy ( dev a, &a, s i z e, cudamemcpyhosttodevice ) ; cudamemcpy ( dev b, &b, size, cudamemcpyhosttodevice ) ; add<<< 1, 1 >>>( dev a, dev b, dev c ) ; cudamemcpy ( &c, dev c, s i z e, cudamemcpydevicetohost ) ; cudafree ( dev a ) ; cudafree ( dev b ) ; cudafree ( dev c ) ; return 0 ; }

16 CUDA Semantics of Kernel Invocation The kernel invocation syntax allows to specify the 2D or 3D scheduling of the kernel execution, that depends on the semantics of the CUDA architecture: kernel<<<blocks, threads>>>(args ) ; The syntax allows to specify the number of blocks and the number of threads that make up a block In the code blocks are identified by blockidx.x while threads by threadidx.x The SIMT approach is based on the fact that every kernel execution in parallel accesses data that depends on the combination of blokcidx and threadidx. Inside the kernel it is possible to use blockdim. With the resulting indexing as follows int i n d e x = t h r e a d I d x. x + b l o c k I d x. x blockdim. x

17 CUDA Why Threads Blocks and Threads are a logical organization of the parallel task with the assumption that, much like Processes and Threads there is not easy memory sharing between Threads belonging to different Processes (Blocks). The scheduler maps Blocks/Threads to SM/Cores and in particular to SM/Warps: Blocks cannot span multiple SM meaning that there is a limited amount of possible Threads in a Block (typically 1024) and also shared memory is limited. The case of dot product is very good for explaining the role of Threads Each thread computes the product part and result is stored in shared (block-level cache) memory The master thread of the block performs the summation Compare it against the SIMD approach

18 CUDA Why Threads (cont) g l o b a l void dot ( int a, int b, int c ) { s h a r e d int temp [N ] ; temp [ t h r e a d I d x. x ] = a [ t h r e a d I d x. x ] b [ t h r e a d I d x. x ] ; s y n c t h r e a d s ( ) ; if ( 0 == threadidx. x ) { int sum = 0 ; for ( int i = 0 ; i < N; i++ ) sum += temp [ i ] ; c = sum ; } }

19 CUDA Dot Main The main of the dot product operation invokes by obtaining one single result, and simply we could have one result per block. Alternatively we could have one single result by combining the results from each block BUT there is not guarantee so there the need of some form of atomic access.

20 CUDA invocation and SM The block and thread invocation is a logical view that has to be mapped to physical threads running inside the SM. Shared memory is available per-sm meaning that logical threads of a block can be allocate only inside the same SM. Limits Know the limits of the invocation, in particular number of threads per block ( maximum) Non Aligned ops add<<<(n + M 1) / M,M>>>(d a, d b, d c, N ) ;

21 CUDA Memory Types There are different types of memory in a CUDA application: Constant memory: the little values that remains constant across invocation (e.g. this corresponds to Uniforms in GLSL) Shared memory: the memory that threads of a block do share. Global memory: the memory allocated via cudamalloc for performing the task Texture memory: a special type of memory, typically read-only, with interesting locality properties

22 CUDA Diagnostics Classic printf can be called inside kernel and it is managed in a special (limited) buffer printed after kernel invocation. Error printing is provided as follows: { } cudaerror t cudaerr = cudapeekatlasterror ( ) ; if ( c u d a e r r!= 0) p r i n t f ( " kernel launch failed with error \"% s \".\ n", c u d a G e t E r r o r S t r i n g ( c u d a e r r ) ) ;

23 CUDA CMake CMake supports easily CUDA with the addition of new commands for invoking nvcc with the correct parameters. The following is a minimal usage: f i n d p a c k a g e (CUDA QUIET REQUIRED) cuda add executable ( helloadd helloadd. cu ) c u d a a d d e x e c u t a b l e ( h e l l o d o t h e l l o d o t. cu ) cuda add executable ( mandel mandel. cu )

24 CUDA Timing Timing of operations is straightforward using an Event-based API. cudaevent t s t a r t, stop ; float time ; c u d a E v e n t C r e a t e (& s t a r t ) ; cudaeventcreate (& stop ) ; cudaeventrecord ( s t a r t, 0 ) ; cudaeventrecord ( stop, 0 ) ; c u d a E v e n t S y n c h r o n i z e ( s t o p ) ; cudaeventelapsedtime (&time, s t a rt, stop ) ;

25 CUDA OpenGL Interoperability (Extra) OpenGL allows for hardware accelerated 3D graphics and it comes natural to think display GPGPU from CUDA to OpenGL or process OpenGL results in CUDA. The solution is to map and unmap an OpenGL memory buffer into CUDA space. Assuming to have both a GPU and CUDA context Create OpenGL buffer Register the buffer in CUDA: cudaglregisterbufferobject Map the buffer to CUDA and use it: cudaglmapbufferobject

26 CUDA Review We can recap what we have understood from the CUDA toolkit: Tool: nvcc Attributes: global, shared Attributes: host, device Kernel Builtin Function: syncthreads() printf() Kernel Builtin Variables: threadidx,blockidx,blockdim Builtin Functions: cudamalloc cudamemcpy cudafree Builtin Type: dim3 Invocation Syntax: kernel<<<blocks, threads>>>(args ) ; dim3 blocks, threads ; kernel<<<blocks, threads>>>(args ) ;

27 CUDA References Sanders, J. and Kandrot, E. CUDA by Example CUDA C Programming Guide CUDA C Best Practices Guide Programming Massively Parallel Processors: A Hands-on Approach, Kirk and Hwu, 2012, Morgan Kaufmann

28 CUDA Not covered topics Unified Memory Asynchrnous Invocation Occupancy calculation Multiple GPUs Dynamic Invocation

29 High-level Libraries and Tools for Heterogeneous CPU/GPU computing CUDA and OpenCL provide the bulding blogs for the GPU computing with a reasonable level of abstraction, but something better can be done in particular to avoid vendor-lock-in. We distinguish between custom language / directive approaches wrt API approaches. First the former: OpenMP 4.x+ OpenACC And then the APIs, in particular for C++: NVidia Thrust ViennaCL We are interested in particular in the first one because it is a powerful C++ template library.

30 OpenCL Open Computing Language is the standard-based alternative to CUDA. It is an independent C-like language with a corresponding API runtime. It provides many services for loading, parsing, compiling OpenCL and executing. Each computer can have multiple OpenCL runtime by different vendors (e.g. Intel based on Multicore) The syntax is more low-level than CUDA and due to the need of supporting multiple architecture (even FPGA) and it is somewhat more conservative, like in the sharing of pointers. Some concepts in the C++ wrap of OpenCL: cl::platform specifies the target platform cl::context an access to a platform cl::program a kernel cl::commandqueue an entity of a platform where to put commands (memory transfer vs execution) cl::buffer a slab of memory much like cudamemalloc cl::kernelfunction a simplification of invocation

31 OpenMP 4.x+ With OpenMP 4.0 it is possible to offload computations from the CPU to a Target accelerator being it a GPU or a custom external accelerator. The compilation principle is very similar to the one of CUDA but the offloading is provided via pragma directives. The master thread of CPU invokes the GPU (e.g. via CUDA) taking care of memory allocation and transfer The following nested pragmas allows the offloading: omp target: specifies a GPU code omp teams: controls the parallelism of the GPU code omp distribute: specifies the behavior by block omp parallel for: specifies the finer thread level action

32 OpenACC This standard takes a similar approach to OpenMP 4.0 by using #pragma acc with a mixture of C code and directives that specify kernels and loops with automatic data transfer. # pragma acc data copy (A) create ( Anew ) while ( error > tol && i t e r < iter max ) { e r r o r = 0. 0 ; #pragma acc k e r n e l s { #pragma acc l o o p for ( int j = 1 ; j < n 1; j++ ) { for ( int i = 1 ; i < m 1; i++ ) { Anew [ j ] [ i ] = ( A [ j ] [ i +1] + A [ j ] [ i 1] + A [ j 1] [ i ] + A [ j +1] [ i ] ; e r r o r = fmax ( e r r o r, f a b s ( Anew [ j ] [ i ] A [ j ] [ i ] ; } } } #pragma acc l o o p for ( int j = 1 ; j < n 1; j ++) { for ( int = i ; i < m 1; i++ ) { A [ j ] [ i ] = Anew [ j ] [ i ] ; } } } if ( i t e r % 100 == 0) p r i n t f ( "%5d, %0.6 f\n", i t e r, e r r o r ) ; i t e r ++; This standard is less common than OpenMP but it is still being updated and used in large paralell systems.

33 ViennaCL ViennaCL (Linear Algebra) is a template C++ library specialized for matrix manipulation (also sparse) that was initially conceived to support CPU and OpenCL development and then it was ported to CUDA. Internally it supports OpenCL, CUDA and OpenMP with switches that control the behavior.

34 Thrust Thrust is a C++ template library that allows for high-level access to CUDA providing an easy to use interface to complex operations such as reductions and sort. The library is always up to date, made available with all CUDA SDKs. Principle thrust::host_vector<t> thrust::device_vector<t> Also mapped from pure ptr: thrust::device_ptr<int> dev_ptr(raw_ptr); To ptr: thrust::raw_pointer_cast(v); Requires some includes # include <t h r u s t / h o s t v e c t o r. h> # include <t h r u s t / d e v i c e v e c t o r. h>

35 Thrust Backends While originally it was only CUDA based Thrust supports also CPU backends such as OpenMP and Intel TBB. They are selected via compilation time flags that typedef host vector and device vector.

36 Thrust Operations All operations are based on C++ iterators with the possibility of using predicate or functors implemented using device-enabled functions. Basic Operations Creation with constant value thrust::fill(b,e,value) thrust::sequence(b,e) thrust::copy(b,e,d) thrust::replace(b,e,bad,good)

37 Thrust Transformations Transformations of data allows to perform basic unary and binary operations: thrust::transform(b,e,d,thrust::negate<int>()); Various operators are available and they can be customized as follows: struct s a x p y f u n c t o r { const float a ; saxpy functor ( float a ) : a ( a ) {} h o s t d e v i c e float operator ( ) ( const float& x, const float& y ) const { return a x + y ; } };

38 Thrust Reduction As discussed in the general CUDA discussion reductions are complex operations but in Thrust they are quite simple and decomposed in the memberwise-operation (*) and reduction operation (+): s t d : : s q r t ( t h r u s t : : t r a n s f o r m r e d u c e ( b, e, unary op, i n i t, b i n a r y o p ) ) Note The functional flexibility of reduction allows to make a single-pass minmax.

39 Thrust Conclusions Other operations are possible with sort and union, for example. Examples here Limitations: Focused on 1D algorithms Learning curve

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

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

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

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

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

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

Real-time Graphics 9. GPGPU

Real-time Graphics 9. GPGPU Real-time Graphics 9. GPGPU GPGPU GPU (Graphics Processing Unit) Flexible and powerful processor Programmability, precision, power Parallel processing CPU Increasing number of cores Parallel processing

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

Introduction to CUDA C

Introduction to CUDA C NVIDIA GPU Technology Introduction to CUDA C Samuel Gateau Seoul December 16, 2010 Who should you thank for this talk? Jason Sanders Senior Software Engineer, NVIDIA Co-author of CUDA by Example What is

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

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

Real-time Graphics 9. GPGPU

Real-time Graphics 9. GPGPU 9. GPGPU GPGPU GPU (Graphics Processing Unit) Flexible and powerful processor Programmability, precision, power Parallel processing CPU Increasing number of cores Parallel processing GPGPU general-purpose

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

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

Introduction to CUDA C

Introduction to CUDA C Introduction to CUDA C What will you learn today? Start from Hello, World! Write and launch CUDA C kernels Manage GPU memory Run parallel kernels in CUDA C Parallel communication and synchronization Race

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

Overview: Graphics Processing Units

Overview: Graphics Processing Units advent of GPUs GPU architecture Overview: Graphics Processing Units the NVIDIA Fermi processor the CUDA programming model simple example, threads organization, memory model case study: matrix multiply

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

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 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

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

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

GPU Programming. Alan Gray, James Perry EPCC The University of Edinburgh

GPU Programming. Alan Gray, James Perry EPCC The University of Edinburgh GPU Programming EPCC The University of Edinburgh Contents NVIDIA CUDA C Proprietary interface to NVIDIA architecture CUDA Fortran Provided by PGI OpenCL Cross platform API 2 NVIDIA CUDA CUDA allows NVIDIA

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

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

High Performance Linear Algebra on Data Parallel Co-Processors I

High Performance Linear Algebra on Data Parallel Co-Processors I 926535897932384626433832795028841971693993754918980183 592653589793238462643383279502884197169399375491898018 415926535897932384626433832795028841971693993754918980 592653589793238462643383279502884197169399375491898018

More information

Introduction to CUDA (1 of n*)

Introduction to CUDA (1 of n*) Administrivia Introduction to CUDA (1 of n*) Patrick Cozzi University of Pennsylvania CIS 565 - Spring 2011 Paper presentation due Wednesday, 02/23 Topics first come, first serve Assignment 4 handed today

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

CUDA Kenjiro Taura 1 / 36

CUDA Kenjiro Taura 1 / 36 CUDA Kenjiro Taura 1 / 36 Contents 1 Overview 2 CUDA Basics 3 Kernels 4 Threads and thread blocks 5 Moving data between host and device 6 Data sharing among threads in the device 2 / 36 Contents 1 Overview

More information

GPGPU/CUDA/C Workshop 2012

GPGPU/CUDA/C Workshop 2012 GPGPU/CUDA/C Workshop 2012 Day-2: Intro to CUDA/C Programming Presenter(s): Abu Asaduzzaman Chok Yip Wichita State University July 11, 2012 GPGPU/CUDA/C Workshop 2012 Outline Review: Day-1 Brief history

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

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

What is GPU? CS 590: High Performance Computing. GPU Architectures and CUDA Concepts/Terms

What is GPU? CS 590: High Performance Computing. GPU Architectures and CUDA Concepts/Terms CS 590: High Performance Computing GPU Architectures and CUDA Concepts/Terms Fengguang Song Department of Computer & Information Science IUPUI What is GPU? Conventional GPUs are used to generate 2D, 3D

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

Graph Partitioning. Standard problem in parallelization, partitioning sparse matrix in nearly independent blocks or discretization grids in FEM.

Graph Partitioning. Standard problem in parallelization, partitioning sparse matrix in nearly independent blocks or discretization grids in FEM. Graph Partitioning Standard problem in parallelization, partitioning sparse matrix in nearly independent blocks or discretization grids in FEM. Partition given graph G=(V,E) in k subgraphs of nearly equal

More information

CSCI 402: Computer Architectures. Parallel Processors (2) Fengguang Song Department of Computer & Information Science IUPUI.

CSCI 402: Computer Architectures. Parallel Processors (2) Fengguang Song Department of Computer & Information Science IUPUI. CSCI 402: Computer Architectures Parallel Processors (2) Fengguang Song Department of Computer & Information Science IUPUI 6.6 - End Today s Contents GPU Cluster and its network topology The Roofline performance

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

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 Parallel Programming Model Michael Garland

CUDA Parallel Programming Model Michael Garland CUDA Parallel Programming Model Michael Garland NVIDIA Research Some Design Goals Scale to 100s of cores, 1000s of parallel threads Let programmers focus on parallel algorithms not mechanics of a parallel

More information

GPU Computing: Development and Analysis. Part 1. Anton Wijs Muhammad Osama. Marieke Huisman Sebastiaan Joosten

GPU Computing: Development and Analysis. Part 1. Anton Wijs Muhammad Osama. Marieke Huisman Sebastiaan Joosten GPU Computing: Development and Analysis Part 1 Anton Wijs Muhammad Osama Marieke Huisman Sebastiaan Joosten NLeSC GPU Course Rob van Nieuwpoort & Ben van Werkhoven Who are we? Anton Wijs Assistant professor,

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

CUDA Parallel Programming Model. Scalable Parallel Programming with CUDA

CUDA Parallel Programming Model. Scalable Parallel Programming with CUDA CUDA Parallel Programming Model Scalable Parallel Programming with CUDA Some Design Goals Scale to 100s of cores, 1000s of parallel threads Let programmers focus on parallel algorithms not mechanics of

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

OpenACC. Introduction and Evolutions Sebastien Deldon, GPU Compiler engineer

OpenACC. Introduction and Evolutions Sebastien Deldon, GPU Compiler engineer OpenACC Introduction and Evolutions Sebastien Deldon, GPU Compiler engineer 3 WAYS TO ACCELERATE APPLICATIONS Applications Libraries Compiler Directives Programming Languages Easy to use Most Performance

More information

Accelerating image registration on GPUs

Accelerating image registration on GPUs Accelerating image registration on GPUs Harald Köstler, Sunil Ramgopal Tatavarty SIAM Conference on Imaging Science (IS10) 13.4.2010 Contents Motivation: Image registration with FAIR GPU Programming Combining

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. 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 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

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

Massively Parallel Architectures

Massively Parallel Architectures Massively Parallel Architectures A Take on Cell Processor and GPU programming Joel Falcou - LRI joel.falcou@lri.fr Bat. 490 - Bureau 104 20 janvier 2009 Motivation The CELL processor Harder,Better,Faster,Stronger

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

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

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

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

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

Introduction to CUDA Algoritmi e Calcolo Parallelo. Daniele Loiacono

Introduction to CUDA Algoritmi e Calcolo Parallelo. Daniele Loiacono Introduction to 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

GPU programming: CUDA basics. Sylvain Collange Inria Rennes Bretagne Atlantique

GPU programming: CUDA basics. Sylvain Collange Inria Rennes Bretagne Atlantique GPU programming: CUDA basics Sylvain Collange Inria Rennes Bretagne Atlantique sylvain.collange@inria.fr This lecture: CUDA programming We have seen some GPU architecture Now how to program it? 2 Outline

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

NVIDIA GTX200: TeraFLOPS Visual Computing. August 26, 2008 John Tynefield

NVIDIA GTX200: TeraFLOPS Visual Computing. August 26, 2008 John Tynefield NVIDIA GTX200: TeraFLOPS Visual Computing August 26, 2008 John Tynefield 2 Outline Execution Model Architecture Demo 3 Execution Model 4 Software Architecture Applications DX10 OpenGL OpenCL CUDA C Host

More information

PROGRAMOVÁNÍ V C++ CVIČENÍ. Michal Brabec

PROGRAMOVÁNÍ V C++ CVIČENÍ. Michal Brabec PROGRAMOVÁNÍ V C++ CVIČENÍ Michal Brabec PARALLELISM CATEGORIES CPU? SSE Multiprocessor SIMT - GPU 2 / 17 PARALLELISM V C++ Weak support in the language itself, powerful libraries Many different parallelization

More information

Parallel Accelerators

Parallel Accelerators Parallel Accelerators Přemysl Šůcha ``Parallel algorithms'', 2017/2018 CTU/FEL 1 Topic Overview Graphical Processing Units (GPU) and CUDA Vector addition on CUDA Intel Xeon Phi Matrix equations on Xeon

More information

Finite Element Integration and Assembly on Modern Multi and Many-core Processors

Finite Element Integration and Assembly on Modern Multi and Many-core Processors Finite Element Integration and Assembly on Modern Multi and Many-core Processors Krzysztof Banaś, Jan Bielański, Kazimierz Chłoń AGH University of Science and Technology, Mickiewicza 30, 30-059 Kraków,

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

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

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

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

GPGPU. Alan Gray/James Perry EPCC The University of Edinburgh.

GPGPU. Alan Gray/James Perry EPCC The University of Edinburgh. GPGPU Alan Gray/James Perry EPCC The University of Edinburgh a.gray@ed.ac.uk Contents Introduction GPU Technology Programming GPUs GPU Performance Optimisation 2 Introduction 3 Introduction Central Processing

More information

Introduction to CUDA Algoritmi e Calcolo Parallelo. Daniele Loiacono

Introduction to CUDA Algoritmi e Calcolo Parallelo. Daniele Loiacono Introduction to 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 Applied

More information

GPU Fundamentals Jeff Larkin November 14, 2016

GPU Fundamentals Jeff Larkin November 14, 2016 GPU Fundamentals Jeff Larkin , November 4, 206 Who Am I? 2002 B.S. Computer Science Furman University 2005 M.S. Computer Science UT Knoxville 2002 Graduate Teaching Assistant 2005 Graduate

More information

Paralization on GPU using CUDA An Introduction

Paralization on GPU using CUDA An Introduction Paralization on GPU using CUDA An Introduction Ehsan Nedaaee Oskoee 1 1 Department of Physics IASBS IPM Grid and HPC workshop IV, 2011 Outline 1 Introduction to GPU 2 Introduction to CUDA Graphics Processing

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

Today s Content. Lecture 7. Trends. Factors contributed to the growth of Beowulf class computers. Introduction. CUDA Programming CUDA (I)

Today s Content. Lecture 7. Trends. Factors contributed to the growth of Beowulf class computers. Introduction. CUDA Programming CUDA (I) Today s Content Lecture 7 CUDA (I) Introduction Trends in HPC GPGPU CUDA Programming 1 Trends Trends in High-Performance Computing HPC is never a commodity until 199 In 1990 s Performances of PCs are getting

More information

By: Tomer Morad Based on: Erik Lindholm, John Nickolls, Stuart Oberman, John Montrym. NVIDIA TESLA: A UNIFIED GRAPHICS AND COMPUTING ARCHITECTURE In IEEE Micro 28(2), 2008 } } Erik Lindholm, John Nickolls,

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

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

CS 470 Spring Other Architectures. Mike Lam, Professor. (with an aside on linear algebra)

CS 470 Spring Other Architectures. Mike Lam, Professor. (with an aside on linear algebra) CS 470 Spring 2016 Mike Lam, Professor Other Architectures (with an aside on linear algebra) Parallel Systems Shared memory (uniform global address space) Primary story: make faster computers Programming

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. 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

GPGPU Offloading with OpenMP 4.5 In the IBM XL Compiler

GPGPU Offloading with OpenMP 4.5 In the IBM XL Compiler GPGPU Offloading with OpenMP 4.5 In the IBM XL Compiler Taylor Lloyd Jose Nelson Amaral Ettore Tiotto University of Alberta University of Alberta IBM Canada 1 Why? 2 Supercomputer Power/Performance GPUs

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

High Performance Computing on GPUs using NVIDIA CUDA

High Performance Computing on GPUs using NVIDIA CUDA High Performance Computing on GPUs using NVIDIA CUDA Slides include some material from GPGPU tutorial at SIGGRAPH2007: http://www.gpgpu.org/s2007 1 Outline Motivation Stream programming Simplified HW and

More information

Parallel Accelerators

Parallel Accelerators Parallel Accelerators Přemysl Šůcha ``Parallel algorithms'', 2017/2018 CTU/FEL 1 Topic Overview Graphical Processing Units (GPU) and CUDA Vector addition on CUDA Intel Xeon Phi Matrix equations on Xeon

More information

CME 213 S PRING Eric Darve

CME 213 S PRING Eric Darve CME 213 S PRING 2017 Eric Darve Summary of previous lectures Pthreads: low-level multi-threaded programming OpenMP: simplified interface based on #pragma, adapted to scientific computing OpenMP for and

More information

Speed Up Your Codes Using GPU

Speed Up Your Codes Using GPU Speed Up Your Codes Using GPU Wu Di and Yeo Khoon Seng (Department of Mechanical Engineering) The use of Graphics Processing Units (GPU) for rendering is well known, but their power for general parallel

More information

DIFFERENTIAL. Tomáš Oberhuber, Atsushi Suzuki, Jan Vacata, Vítězslav Žabka

DIFFERENTIAL. Tomáš Oberhuber, Atsushi Suzuki, Jan Vacata, Vítězslav Žabka USE OF FOR Tomáš Oberhuber, Atsushi Suzuki, Jan Vacata, Vítězslav Žabka Faculty of Nuclear Sciences and Physical Engineering Czech Technical University in Prague Mini workshop on advanced numerical methods

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

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

GPU Programming Introduction

GPU Programming Introduction GPU Programming Introduction DR. CHRISTOPH ANGERER, NVIDIA AGENDA Introduction to Heterogeneous Computing Using Accelerated Libraries GPU Programming Languages Introduction to CUDA Lunch What is Heterogeneous

More information

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

GPU & High Performance Computing (by NVIDIA) CUDA. Compute Unified Device Architecture Florian Schornbaum

GPU & High Performance Computing (by NVIDIA) CUDA. Compute Unified Device Architecture Florian Schornbaum GPU & High Performance Computing (by NVIDIA) CUDA Compute Unified Device Architecture 29.02.2008 Florian Schornbaum GPU Computing Performance In the last few years the GPU has evolved into an absolute

More information

CSC266 Introduction to Parallel Computing using GPUs Introduction to CUDA

CSC266 Introduction to Parallel Computing using GPUs Introduction to CUDA CSC266 Introduction to Parallel Computing using GPUs Introduction to CUDA Sreepathi Pai October 18, 2017 URCS Outline Background Memory Code Execution Model Outline Background Memory Code Execution Model

More information

NVIDIA Think about Computing as Heterogeneous One Leo Liao, 1/29/2106, NTU

NVIDIA Think about Computing as Heterogeneous One Leo Liao, 1/29/2106, NTU NVIDIA Think about Computing as Heterogeneous One Leo Liao, 1/29/2106, NTU GPGPU opens the door for co-design HPC, moreover middleware-support embedded system designs to harness the power of GPUaccelerated

More information

GPU Computing with CUDA. Part 2: CUDA Introduction

GPU Computing with CUDA. Part 2: CUDA Introduction GPU Computing with CUDA Part 2: CUDA Introduction Dortmund, June 4, 2009 SFB 708, AK "Modellierung und Simulation" Dominik Göddeke Angewandte Mathematik und Numerik TU Dortmund dominik.goeddeke@math.tu-dortmund.de

More information

CUDA and GPU Performance Tuning Fundamentals: A hands-on introduction. Francesco Rossi University of Bologna and INFN

CUDA and GPU Performance Tuning Fundamentals: A hands-on introduction. Francesco Rossi University of Bologna and INFN CUDA and GPU Performance Tuning Fundamentals: A hands-on introduction Francesco Rossi University of Bologna and INFN * Using this terminology since you ve already heard of SIMD and SPMD at this school

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

HPC trends (Myths about) accelerator cards & more. June 24, Martin Schreiber,

HPC trends (Myths about) accelerator cards & more. June 24, Martin Schreiber, HPC trends (Myths about) accelerator cards & more June 24, 2015 - Martin Schreiber, M.Schreiber@exeter.ac.uk Outline HPC & current architectures Performance: Programming models: OpenCL & OpenMP Some applications:

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

Martin Kruliš, v

Martin Kruliš, v Martin Kruliš 1 GPGPU History Current GPU Architecture OpenCL Framework Example Optimizing Previous Example Alternative Architectures 2 1996: 3Dfx Voodoo 1 First graphical (3D) accelerator for desktop

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