# Accelerate your Application with CUDA C

Save this PDF as:

Size: px
Start display at page:

## Transcription

1 Accelerate your Application with CUDA C

2 2D Minimum Algorithm Consider applying a 2D window to a 2D array of elements Each output element is the minimum of input elements within the window Window Input Matrix Output Matrix 2D operations like this are found in many fundamental algorithms Interpolation, Convolution, Filtering Applications in seismic processing, weather simulation, image processing, etc

3 2D Minimum: C Version #define WIN_SIZE 16 #define N int main() int size=n*n*sizeof(int); int i, j, x, y, temp; //allocate resources int *cell=(int *)malloc(size); //input int *node=(int *)malloc(size); //output initializearray(cell,n); initializearray(node,n); Allocate Resources Initialize data for(i=0;i<n;i++) for(j=0;j<n;j++) //find minimum in window temp = node[i][j]; for(x=0;x<win_size;x++) for(y=0;y<win_size;y++) if (temp> cell[i+x][j+y]) temp = cell[i+x][j+y]; node[i][j] = temp; Loop over dataset Loop over window Find min //free resources free(cell); free(node); Cleanup

4 2D Minimum: C Version #define WIN_SIZE 16 #define N for(i=0;i<n;i++) for(j=0;j<n;j++) int main() int size=n*n*sizeof(int); //find minimum in window int i, j, x, y, temp; temp = node[i][j]; //allocate resources for(x=0;x<win_size;x++) Algorithm Device Compute Speedup int *cell=(int *)malloc(size); //input for(y=0;y<win_size;y++) int *node=(int *)malloc(size); //output if (temp> cell[i+x][j+y]) C (serial) Xeon X sec -- temp = cell[i+x][j+y]; initializearray(cell,n); node[i][j] = temp; initializearray(node,n); //free resources free(cell); free(node);

5 CPU + GPU = Big Speedup Application Code GPU Compute-Intensive Functions Use CUDA to Parallelize Rest of Sequential CPU Code CPU +

6 Explicit Data Movement CPU (host) GPU (device) CPU Memory in out PCI Bus GPU Memory d_in d_out

7 2D Window: CUDA Main Program C int main() int main() int size=n*n*sizeof(int); int size=n*n*sizeof(int); //allocate resources //allocate resources int *cell=(int*)malloc(size); //input int *cell=(float*)malloc(size); int *node=(int*)malloc(size); //output int *node=(float*)malloc(size); int *d_cell; cudamalloc(&d_cell,size); initializearray(cell,n); int *d_node; cudamalloc(&d_node,size); initializearray(node,n); initializearray(cell,n); initializearray(node,n); // nested for loops for cudamemcpy(d_cell,cell,size,cudamemcpyhosttodevice); for cudamemcpy(d_node,node,size,cudamemcpyhosttodevice); for compute_win2d<<<nblocks, nthreads>>>(d_node,d_cell); for. //free resources //free resources free(cell); free(node); free(in); free(out); cudafree(d_cell); cudafree(d_node); CUDA C

8 2D Window: CUDA Main Program int main() int size=n*n*sizeof(int); //allocate resources int *cell=(int*)malloc(size); //input int *node=(int*)malloc(size); //output initializearray(cell,n); initializearray(node,n); // nested for loops for for for for. //free resources free(in); free(out); C int main() int size=n*n*sizeof(int); //allocate resources int *cell=(float*)malloc(size); int *node=(float*)malloc(size); int *d_cell; cudamalloc(&d_cell,size); int *d_node; cudamalloc(&d_node,size); initializearray(cell,n); initializearray(node,n); cudamemcpy(d_cell,cell,size,cudamemcpyhosttodevice); cudamemcpy(d_node,node,size,cudamemcpyhosttodevice); compute_win2d<<<nblocks, nthreads>>>(d_node,d_cell); //free resources free(cell); free(node); cudafree(d_cell); cudafree(d_node); CUDA C Allocate Device Memory

9 2D Window: CUDA Main Program int main() int size=n*n*sizeof(int); //allocate resources int *cell=(int*)malloc(size); //input int *node=(int*)malloc(size); //output initializearray(cell,n); initializearray(node,n); // nested for loops for for for for. //free resources free(in); free(out); C int main() int size=n*n*sizeof(int); //allocate resources int *cell=(float*)malloc(size); int *node=(float*)malloc(size); int *d_cell; cudamalloc(&d_cell,size); int *d_node; cudamalloc(&d_node,size); initializearray(cell,n); initializearray(node,n); cudamemcpy(d_cell,cell,size,cudamemcpyhosttodevice); cudamemcpy(d_node,node,size,cudamemcpyhosttodevice); compute_win2d<<<nblocks, nthreads>>>(d_node,d_cell); //free resources free(cell); free(node); cudafree(d_cell); cudafree(d_node); CUDA C Copy Data to the Device

10 2D Window: CUDA Main Program int main() int size=n*n*sizeof(int); //allocate resources int *cell=(int*)malloc(size); //input int *node=(int*)malloc(size); //output initializearray(cell,n); initializearray(node,n); // nested for loops for for for for. //free resources free(in); free(out); C Call Cuda Function int main() int size=n*n*sizeof(int); //allocate resources int *cell=(float*)malloc(size); int *node=(float*)malloc(size); int *d_cell; cudamalloc(&d_cell,size); int *d_node; cudamalloc(&d_node,size); initializearray(cell,n); initializearray(node,n); cudamemcpy(d_cell,cell,size,cudamemcpyhosttodevice); cudamemcpy(d_node,node,size,cudamemcpyhosttodevice); compute_win2d<<<nblocks, nthreads>>>(d_node,d_cell); //free resources free(cell); free(node); Launch cudafree(d_cell); cudafree(d_node); Parameters CUDA C Device Pointers

11 2D Window: CUDA Main Program C int main() int size=n*n*sizeof(int); //allocate resources int *cell=(int*)malloc(size); //input int *node=(int*)malloc(size); //output int main() int size=n*n*sizeof(int); //allocate resources int *cell=(float*)malloc(size); int *node=(float*)malloc(size); int *d_cell; cudamalloc(&d_cell,size); initializearray(cell,n); initializearray(node,n); int *d_node; cudamalloc(&d_node,size); initializearray(cell,n); initializearray(node,n); // nested for loops for for for for. cudamemcpy(d_cell,cell,size,cudamemcpyhosttodevice); cudamemcpy(d_node,node,size,cudamemcpyhosttodevice); compute_win2d<<<nblocks, nthreads>>>(d_node,d_cell); //free resources //free resources free(in); free(out); free(cell); free(node); cudafree(d_cell); cudafree(d_node); Cleanup CUDA C

12 Parallel Execution Model A CUDA C function is executed by many parallel threads Threads are organized as a grid of independent thread blocks Grid Block 0 Block 1 Block N_B-2 Block N_B-1

13 2D Window: CUDA Kernel Function for(i=0;i<n;i++) for(j=0;j<n;j++) //find minimum in window temp = node[i][j]; C for(x=0;x<win_size;x++) for(y=0;y<win_size;y++) if (temp> cell[i+x][j+y]) temp = cell[i+x][j+y]; node[i][j] = temp; global void compute_win2d(int knode[][n], int kcell[][n]) int idx=blockidx.x*blockdim.x+threadidx.x; int idy=blockidx.y*blockdim.y+threadidx.y; int temp, x, y; if((idx<n)&&(idy<n)) //find minimum in window temp = knode[idx][idy]; for(x=0;x<win_size;x++) for(y=0;y<win_size;y++) if (temp> kcell[idx+x][idy+y]) temp = kcell[idx+x][idy+y]; knode[i][j] = temp; CUDA C

14 2D Window: CUDA Kernel Function for(i=0;i<n;i++) for(j=0;j<n;j++) //find minimum in window temp = node[i][j]; C for(x=0;x<win_size;x++) for(y=0;y<win_size;y++) if (temp> cell[i+x][j+y]) temp = cell[i+x][j+y]; node[i][j] = temp; Add global Keyword global void compute_win2d(int knode[][n], int kcell[][n]) int idx=blockidx.x*blockdim.x+threadidx.x; int idy=blockidx.y*blockdim.y+threadidx.y; int temp, x, y; if((idx<n)&&(idy<n)) //find minimum in window temp = knode[idx][idy]; for(x=0;x<win_size;x++) for(y=0;y<win_size;y++) if (temp> kcell[idx+x][idy+y]) temp = kcell[idx+x][idy+y]; knode[i][j] = temp; CUDA C

15 2D Window: CUDA Kernel Function for(i=0;i<n;i++) for(j=0;j<n;j++) //find minimum in window blockidx.x temp = node[i][j]; C for(x=0;x<win_size;x++) for(y=0;y<win_size;y++) if (temp> cell[i+x][j+y]) temp = cell[i+x][j+y]; node[i][j] = temp; Replace Outer Loops With an Index Calculation 0 N_B threadidx.x threadidx.x global void compute_win2d(int knode[][n], int kcell[][n]) int idx=blockidx.x*blockdim.x+threadidx.x; int idy=blockidx.y*blockdim.y+threadidx.y; int temp, x, y; if((idx<n)&&(idy<n)) //find minimum in window temp = knode[idx][idy]; for(x=0;x<win_size;x++) for(y=0;y<win_size;y++) if (temp> kcell[idx+x][idy+y]) temp = kcell[idx+x][idy+y]; knode[i][j] = temp; CUDA C

16 2D Window: CUDA Kernel Function C global void compute_win2d(int knode[][n], int kcell[][n]) for(i=0;i<n;i++) int idx=blockidx.x*blockdim.x+threadidx.x; for(j=0;j<n;j++) int idy=blockidx.y*blockdim.y+threadidx.y; int temp, x, y; //find minimum Algorithm in window Device if((idx<n)&&(idy<n)) Compute Speedup temp = node[i][j]; //find minimum in window for(x=0;x<win_size;x++) C (serial) X5650 temp 96.1sec = knode[idx][idy]; -- for(y=0;y<win_size;y++) for(x=0;x<win_size;x++) CUDA M sec 11.5x if (temp> cell[i+x][j+y]) for(y=0;y<win_size;y++) temp = cell[i+x][j+y]; if (temp> kcell[idx+x][idy+y]) node[i][j] = temp; temp = kcell[idx+x][idy+y]; knode[i][j] = temp; CUDA C

17 Observation: Data Reuse Thread(i) Thread(i+1) Global Memory Neighboring threads read the same elements.

18 Optimization: Use Shared Memory Global Memory SMEM COPY BLK_SIZE WSIZE Shared Memory

29 Questions?

### An Introduction to GPU Computing and CUDA Architecture

An Introduction to GPU Computing and CUDA Architecture Sarah Tariq, NVIDIA Corporation GPU Computing GPU: Graphics Processing Unit Traditionally used for real-time rendering High computational density

### Hands-on CUDA exercises

Hands-on CUDA exercises CUDA Exercises We have provided skeletons and solutions for 6 hands-on CUDA exercises In each exercise (except for #5), you have to implement the missing portions of the code Finished

### GPU Computing with CUDA Lecture 3 - Efficient Shared Memory Use. Christopher Cooper Boston University August, 2011 UTFSM, Valparaíso, Chile

GPU Computing with CUDA Lecture 3 - Efficient Shared Memory Use Christopher Cooper Boston University August, 2011 UTFSM, Valparaíso, Chile 1 Outline of lecture Recap of Lecture 2 Shared memory in detail

### CUDA C/C++ Basics Supercomputing 2011 Tutorial Cyril Zeller, NVIDIA Corporation

CUDA C/C++ Basics Supercomputing 2011 Tutorial Cyril Zeller, NVIDIA Corporation What is CUDA? CUDA Architecture Expose GPU computing for general purpose Retain performance CUDA C/C++ Based on industry-standard

### CUDA Programming. Week 4. Shared memory and register

CUDA Programming Week 4. Shared memory and register Outline Shared memory and bank confliction Memory padding Register allocation Example of matrix-matrix multiplication Homework SHARED MEMORY AND BANK

### Learn CUDA in an Afternoon: Hands-on Practical Exercises

Learn CUDA in an Afternoon: Hands-on Practical Exercises Alan Gray and James Perry, EPCC, The University of Edinburgh Introduction This document forms the hands-on practical component of the Learn CUDA

### Introduction to CUDA C

Introduction to CUDA C What is CUDA? CUDA Architecture Expose general-purpose GPU computing as first-class capability Retain traditional DirectX/OpenGL graphics performance CUDA C Based on industry-standard

### CUDA C/C++ BASICS. NVIDIA Corporation

CUDA C/C++ BASICS NVIDIA Corporation CUDA PROGRAMMING MODEL Anatomy of a CUDA C/C++ Application Serial code executes in a Host (CPU) thread Parallel code executes in many Device (GPU) threads across multiple

### 1. If we need to use each thread to calculate one output element of a vector addition, what would

Quiz questions Lecture 2: 1. If we need to use each thread to calculate one output element of a vector addition, what would be the expression for mapping the thread/block indices to data index: (A) i=threadidx.x

### HPC with Multicore and GPUs

HPC with Multicore and GPUs Stan Tomov Electrical Engineering and Computer Science Department University of Tennessee, Knoxville CS 594 Lecture Notes March 4, 2015 1/18 Outline! Introduction - Hardware

### GPU Computing with CUDA Lecture 4 - Optimizations. Christopher Cooper Boston University August, 2011 UTFSM, Valparaíso, Chile

GPU Computing with CUDA Lecture 4 - Optimizations Christopher Cooper Boston University August, 2011 UTFSM, Valparaíso, Chile 1 Outline of lecture Recap of Lecture 3 Control flow Coalescing Latency hiding

### CS 179 Lecture 6. Synchronization, Matrix Transpose, Profiling, AWS Cluster

CS 179 Lecture 6 Synchronization, Matrix Transpose, Profiling, AWS Cluster Synchronization Ideal case for parallelism: no resources shared between threads no communication between threads Many algorithms

### 8 GPU & Cuda. Quellen: ents.pdf

8 GPU & Cuda Quellen: http://courses.cs.washington.edu/courses/cse471/13sp/lectures/gpusstud ents.pdf http://on-demand.gputechconf.com/gtcexpress/2011/presentations/gtc_express_sarah_tariq_june2011.pdf

### Optimizing Parallel Reduction in CUDA. Mark Harris NVIDIA Developer Technology

Optimizing Parallel Reduction in CUDA Mark Harris NVIDIA Developer Technology Parallel Reduction Common and important data parallel primitive Easy to implement in CUDA Harder to get it right Serves as

### GPU Hardware and Programming Models. Jeremy Appleyard, September 2015

GPU Hardware and Programming Models Jeremy Appleyard, September 2015 A brief history of GPUs In this talk Hardware Overview Programming Models Ask questions at any point! 2 A Brief History of GPUs 3 Once

### Parallel Prefix Sum (Scan) with CUDA. Mark Harris mharris@nvidia.com

Parallel Prefix Sum (Scan) with CUDA Mark Harris mharris@nvidia.com April 2007 Document Change History Version Date Responsible Reason for Change February 14, 2007 Mark Harris Initial release April 2007

### GPU Parallel Computing Architecture and CUDA Programming Model

GPU Parallel Computing Architecture and CUDA Programming Model John Nickolls Outline Why GPU Computing? GPU Computing Architecture Multithreading and Arrays Data Parallel Problem Decomposition Parallel

### OpenACC 2.0 and the PGI Accelerator Compilers

OpenACC 2.0 and the PGI Accelerator Compilers Michael Wolfe The Portland Group michael.wolfe@pgroup.com This presentation discusses the additions made to the OpenACC API in Version 2.0. I will also present

### Accelerating Intensity Layer Based Pencil Filter Algorithm using CUDA

Accelerating Intensity Layer Based Pencil Filter Algorithm using CUDA Dissertation submitted in partial fulfillment of the requirements for the degree of Master of Technology, Computer Engineering by Amol

### Rootbeer: Seamlessly using GPUs from Java

Rootbeer: Seamlessly using GPUs from Java Phil Pratt-Szeliga. Dr. Jim Fawcett. Dr. Roy Welch. Syracuse University. Rootbeer Overview and Motivation Rootbeer allows a developer to program a GPU in Java

### Efficient mapping of the training of Convolutional Neural Networks to a CUDA-based cluster

Efficient mapping of the training of Convolutional Neural Networks to a CUDA-based cluster Jonatan Ward Sergey Andreev Francisco Heredia Bogdan Lazar Zlatka Manevska Eindhoven University of Technology,

### Das Ising-Modell auf Grafikkarten

Das Ising-Modell auf Grafikkarten Institute of Physics, Johannes Gutenberg-University of Mainz Center for Polymer Studies, Department of Physics, Boston University Artemis Capital Asset Management GmbH

### MONTE-CARLO SIMULATION OF AMERICAN OPTIONS WITH GPUS. Julien Demouth, NVIDIA

MONTE-CARLO SIMULATION OF AMERICAN OPTIONS WITH GPUS Julien Demouth, NVIDIA STAC-A2 BENCHMARK STAC-A2 Benchmark Developed by banks Macro and micro, performance and accuracy Pricing and Greeks for American

### U N C L A S S I F I E D

CUDA and Java GPU Computing in a Cross Platform Application Scot Halverson sah@lanl.gov LA-UR-13-20719 Slide 1 What s the goal? Run GPU code alongside Java code Take advantage of high parallelization Utilize

### Intro to GPU computing. Spring 2015 Mark Silberstein, 048661, Technion 1

Intro to GPU computing Spring 2015 Mark Silberstein, 048661, Technion 1 Serial vs. parallel program One instruction at a time Multiple instructions in parallel Spring 2015 Mark Silberstein, 048661, Technion

### Image Processing & Video Algorithms with CUDA

Image Processing & Video Algorithms with CUDA Eric Young & Frank Jargstorff 8 NVIDIA Corporation. introduction Image processing is a natural fit for data parallel processing Pixels can be mapped directly

### 15-418 Final Project Report. Trading Platform Server

15-418 Final Project Report Yinghao Wang yinghaow@andrew.cmu.edu May 8, 214 Trading Platform Server Executive Summary The final project will implement a trading platform server that provides back-end support

### CUDA Basics. Murphy Stein New York University

CUDA Basics Murphy Stein New York University Overview Device Architecture CUDA Programming Model Matrix Transpose in CUDA Further Reading What is CUDA? CUDA stands for: Compute Unified Device Architecture

### 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 / 37 Course outline Introduction to GPU hardware

### APPLICATIONS OF LINUX-BASED QT-CUDA PARALLEL ARCHITECTURE

APPLICATIONS OF LINUX-BASED QT-CUDA PARALLEL ARCHITECTURE Tuyou Peng 1, Jun Peng 2 1 Electronics and information Technology Department Jiangmen Polytechnic, Jiangmen, Guangdong, China, typeng2001@yahoo.com

### 12 Tips for Maximum Performance with PGI Directives in C

12 Tips for Maximum Performance with PGI Directives in C List of Tricks 1. Eliminate Pointer Arithmetic 2. Privatize Arrays 3. Make While Loops Parallelizable 4. Rectangles are Better Than Triangles 5.

### CUDA SKILLS. Yu-Hang Tang. June 23-26, 2015 CSRC, Beijing

CUDA SKILLS Yu-Hang Tang June 23-26, 2015 CSRC, Beijing day1.pdf at /home/ytang/slides Referece solutions coming soon Online CUDA API documentation http://docs.nvidia.com/cuda/index.html Yu-Hang Tang @

### GPU Accelerated Monte Carlo Simulations and Time Series Analysis

GPU Accelerated Monte Carlo Simulations and Time Series Analysis Institute of Physics, Johannes Gutenberg-University of Mainz Center for Polymer Studies, Department of Physics, Boston University Artemis

### Designing the Future: How Successful Codesign Helps Shape Hardware and Software Development

Official Use Only Designing the Future: How Successful Codesign Helps Shape Hardware and Software Development Christian Trott Unclassified, Unlimited release Sandia National Laboratories is a multi-program

### CUDA Optimization with NVIDIA Tools. Julien Demouth, NVIDIA

CUDA Optimization with NVIDIA Tools Julien Demouth, NVIDIA What Will You Learn? An iterative method to optimize your GPU code A way to conduct that method with Nvidia Tools 2 What Does the Application

### CUDA Debugging. GPGPU Workshop, August 2012. Sandra Wienke Center for Computing and Communication, RWTH Aachen University

CUDA Debugging GPGPU Workshop, August 2012 Sandra Wienke Center for Computing and Communication, RWTH Aachen University Nikolay Piskun, Chris Gottbrath Rogue Wave Software Rechen- und Kommunikationszentrum

### Debugging CUDA Applications Przetwarzanie Równoległe CUDA/CELL

Debugging CUDA Applications Przetwarzanie Równoległe CUDA/CELL Michał Wójcik, Tomasz Boiński Katedra Architektury Systemów Komputerowych Wydział Elektroniki, Telekomunikacji i Informatyki Politechnika

### Multi-GPU Load Balancing for Simulation and Rendering

Multi- Load Balancing for Simulation and Rendering Yong Cao Computer Science Department, Virginia Tech, USA In-situ ualization and ual Analytics Instant visualization and interaction of computing tasks

### Optimizing Application Performance with CUDA Profiling Tools

Optimizing Application Performance with CUDA Profiling Tools Why Profile? Application Code GPU Compute-Intensive Functions Rest of Sequential CPU Code CPU 100 s of cores 10,000 s of threads Great memory

### OpenACC Basics Directive-based GPGPU Programming

OpenACC Basics Directive-based GPGPU Programming Sandra Wienke, M.Sc. wienke@rz.rwth-aachen.de Center for Computing and Communication RWTH Aachen University Rechen- und Kommunikationszentrum (RZ) PPCES,

### Applications to Computational Financial and GPU Computing. May 16th. Dr. Daniel Egloff +41 44 520 01 17 +41 79 430 03 61

F# Applications to Computational Financial and GPU Computing May 16th Dr. Daniel Egloff +41 44 520 01 17 +41 79 430 03 61 Today! Why care about F#? Just another fashion?! Three success stories! How Alea.cuBase

### Computer Vision on GPU with OpenCV Anatoly Baksheev, Itseez

Computer Vision on GPU with OpenCV Anatoly Baksheev, Itseez (anatoly.baksheev@itseez.com) Outline Introduction into OpenCV Overview of OpenCV GPU module Pedestrian detection on GPU 2 Lure into 3 OpenCV

### CudaDMA: Optimizing GPU Memory Bandwidth via Warp Specialization

CudaDMA: Optimizing GPU Memory Bandwidth via Warp Specialization Michael Bauer Stanford University mebauer@cs.stanford.edu Henry Cook UC Berkeley hcook@cs.berkeley.edu Brucek Khailany NVIDIA Research bkhailany@nvidia.com

### Deficiencies of.net CLR JIT compilers

Deficiencies of.net CLR JIT compilers Another reason to use a GPU Dr. Daniel Egloff Managing Director QuantAlea Microsoft MVP June 9, 2016 Who are We Software and solution provider for high performance

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

### PARALLEL JAVASCRIPT. Norm Rubin (NVIDIA) Jin Wang (Georgia School of Technology)

PARALLEL JAVASCRIPT Norm Rubin (NVIDIA) Jin Wang (Georgia School of Technology) JAVASCRIPT Not connected with Java Scheme and self (dressed in c clothing) Lots of design errors (like automatic semicolon

### GPU File System Encryption Kartik Kulkarni and Eugene Linkov

GPU File System Encryption Kartik Kulkarni and Eugene Linkov 5/10/2012 SUMMARY. We implemented a file system that encrypts and decrypts files. The implementation uses the AES algorithm computed through

### Adaptive GPU-Accelerated Software Beacon Processing for Geospace Sensing

Adaptive GPU-Accelerated Software Beacon Processing for Geospace Sensing John Grasel Harvey Mudd College MIT Haystack REU Summer 2010 Abstract Radio beacons on satellites can be used in conjunction with

### Retour d expérience : portage d une application haute-performance vers un langage de haut niveau

Retour d expérience : portage d une application haute-performance vers un langage de haut niveau ComPAS/RenPar 2013 Mathias Bourgoin - Emmanuel Chailloux - Jean-Luc Lamotte 16 Janvier 2013 Our Goals Globally

### GPU Tools Sandra Wienke

Sandra Wienke Center for Computing and Communication, RWTH Aachen University MATSE HPC Battle 2012/13 Rechen- und Kommunikationszentrum (RZ) Agenda IDE Eclipse Debugging (CUDA) TotalView Profiling (CUDA

### Overview on Modern Accelerators and Programming Paradigms Ivan Giro7o igiro7o@ictp.it

Overview on Modern Accelerators and Programming Paradigms Ivan Giro7o igiro7o@ictp.it Informa(on & Communica(on Technology Sec(on (ICTS) Interna(onal Centre for Theore(cal Physics (ICTP) Mul(ple Socket

### ACCELERATING SELECT WHERE AND SELECT JOIN QUERIES ON A GPU

Computer Science 14 (2) 2013 http://dx.doi.org/10.7494/csci.2013.14.2.243 Marcin Pietroń Pawe l Russek Kazimierz Wiatr ACCELERATING SELECT WHERE AND SELECT JOIN QUERIES ON A GPU Abstract This paper presents

### High Performance Cloud: a MapReduce and GPGPU Based Hybrid Approach

High Performance Cloud: a MapReduce and GPGPU Based Hybrid Approach Beniamino Di Martino, Antonio Esposito and Andrea Barbato Department of Industrial and Information Engineering Second University of Naples

### Optimization of CUDA- based Monte Carlo Simulation for EM Radiation

Optimization of CUDA- based Monte Carlo Simulation for EM Radiation 10th Geant4 Space User Workshop Main authors: N. Henderson (ICME- Stanford U) & K. Murakami (KEK) Presented by: A. Dotti (SLAC) adotti@slac.stanford.edu

### 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 Amin Safi Faculty of Mathematics, TU dortmund January 22, 2016 Table of Contents Set

### Porting the Plasma Simulation PIConGPU to Heterogeneous Architectures with Alpaka

Porting the Plasma Simulation PIConGPU to Heterogeneous Architectures with Alpaka René Widera1, Erik Zenker1,2, Guido Juckeland1, Benjamin Worpitz1,2, Axel Huebl1,2, Andreas Knüpfer2, Wolfgang E. Nagel2,

### GPU Memory. Memory access:100 times more time to access local/global memory. Maximize shared/ register memory.

GPU Memory Local registers per thread. A parallel data cache or shared memory that is shared by all the threads. A read-only constant cache that is shared by all the threads. A read-only texture cache

### Advanced CUDA Webinar. Memory Optimizations

Advanced CUDA Webinar Memory Optimizations Outline Overview Hardware Memory Optimizations Data transfers between host and device Device memory optimizations Summary Measuring performance effective bandwidth

### Designing the Future: How Successful Codesign Helps Shape Hardware and Software Development

Official Use Only Designing the Future: How Successful Codesign Helps Shape Hardware and Software Development Christian Trott Unclassified, Unlimited release SAND2014-19833 C Sandia National Laboratories

### A Pattern-Based Comparison of OpenACC & OpenMP for Accelerators

A Pattern-Based Comparison of OpenACC & OpenMP for Accelerators Sandra Wienke 1,2, Christian Terboven 1,2, James C. Beyer 3, Matthias S. Müller 1,2 1 IT Center, RWTH Aachen University 2 JARA-HPC, Aachen

### Introduction to OpenACC Directives. Duncan Poole, NVIDIA Thomas Bradley, NVIDIA

Introduction to OpenACC Directives Duncan Poole, NVIDIA Thomas Bradley, NVIDIA GPUs Reaching Broader Set of Developers 1,000,000 s 100,000 s Early Adopters Research Universities Supercomputing Centers

### CUDA programming on NVIDIA GPUs

p. 1/21 on NVIDIA GPUs Mike Giles mike.giles@maths.ox.ac.uk Oxford University Mathematical Institute Oxford-Man Institute for Quantitative Finance Oxford eresearch Centre p. 2/21 Overview hardware view

### Inter-Block GPU Communication via Fast Barrier Synchronization

Inter-Block GPU ommunication via Fast Barrier Synchronization Shucai Xiao and Wu-chun Feng Department of omputer Science Virginia Tech {shucai, wfeng}@vt.edu Abstract The graphics processing unit (GPU)

### Sélection adaptative de codes polyédriques pour GPU/CPU

Sélection adaptative de codes polyédriques pour GPU/CPU Jean-François DOLLINGER, Vincent LOECHNER, Philippe CLAUSS INRIA - Équipe CAMUS Université de Strasbourg Saint-Hippolyte - Le 6 décembre 2011 1 Sommaire

### GPU Accelerated Pathfinding

GPU Accelerated Pathfinding By: Avi Bleiweiss NVIDIA Corporation Graphics Hardware (2008) Editors: David Luebke and John D. Owens NTNU, TDT24 Presentation by Lars Espen Nordhus http://delivery.acm.org/10.1145/1420000/1413968/p65-bleiweiss.pdf?ip=129.241.138.231&acc=active

### Case Study on Productivity and Performance of GPGPUs

Case Study on Productivity and Performance of GPGPUs Sandra Wienke wienke@rz.rwth-aachen.de ZKI Arbeitskreis Supercomputing April 2012 Rechen- und Kommunikationszentrum (RZ) RWTH GPU-Cluster 56 Nvidia

### AUDIO ON THE GPU: REAL-TIME TIME DOMAIN CONVOLUTION ON GRAPHICS CARDS. A Thesis by ANDREW KEITH LACHANCE May 2011

AUDIO ON THE GPU: REAL-TIME TIME DOMAIN CONVOLUTION ON GRAPHICS CARDS A Thesis by ANDREW KEITH LACHANCE May 2011 Submitted to the Graduate School Appalachian State University in partial fulfillment of

### HP ProLiant SL270s Gen8 Server. Evaluation Report

HP ProLiant SL270s Gen8 Server Evaluation Report Thomas Schoenemeyer, Hussein Harake and Daniel Peter Swiss National Supercomputing Centre (CSCS), Lugano Institute of Geophysics, ETH Zürich schoenemeyer@cscs.ch

### NVIDIA CUDA Software and GPU Parallel Computing Architecture. David B. Kirk, Chief Scientist

NVIDIA CUDA Software and GPU Parallel Computing Architecture David B. Kirk, Chief Scientist Outline Applications of GPU Computing CUDA Programming Model Overview Programming in CUDA The Basics How to Get

### Scalable and High Performance Computing for Big Data Analytics in Understanding the Human Dynamics in the Mobile Age

Scalable and High Performance Computing for Big Data Analytics in Understanding the Human Dynamics in the Mobile Age Xuan Shi GRA: Bowei Xue University of Arkansas Spatiotemporal Modeling of Human Dynamics

### E6895 Advanced Big Data Analytics Lecture 14:! NVIDIA GPU Examples and GPU on ios devices

E6895 Advanced Big Data Analytics Lecture 14: NVIDIA GPU Examples and GPU on ios devices Ching-Yung Lin, Ph.D. Adjunct Professor, Dept. of Electrical Engineering and Computer Science IBM Chief Scientist,

### CSCI-GA Graphics Processing Units (GPUs): Architecture and Programming Lecture 11: OpenCL

CSCI-GA.3033-012 Graphics Processing Units (GPUs): Architecture and Programming Lecture 11: OpenCL Mohamed Zahran (aka Z) mzahran@cs.nyu.edu http://www.mzahran.com Open Computing Language Design Goals

### ANALYSIS OF RSA ALGORITHM USING GPU PROGRAMMING

ANALYSIS OF RSA ALGORITHM USING GPU PROGRAMMING Sonam Mahajan 1 and Maninder Singh 2 1 Department of Computer Science Engineering, Thapar University, Patiala, India 2 Department of Computer Science Engineering,

### Application Note 120 Communicating Through the 1-Wire Master

www.dalsemi.com Application Note 120 Communicating Through the 1-Wire Master INTRODUCTION The DS1WM 1-Wire Master was created to facilitate host CPU communication with devices over a 1-Wire bus without

### Parallel & Distributed Optimization. Based on Mark Schmidt s slides

Parallel & Distributed Optimization Based on Mark Schmidt s slides Motivation behind using parallel & Distributed optimization Performance Computational throughput have increased exponentially in linear

### OpenACC Programming on GPUs

OpenACC Programming on GPUs Directive-based GPGPU Programming Sandra Wienke, M.Sc. wienke@rz.rwth-aachen.de Center for Computing and Communication RWTH Aachen University Rechen- und Kommunikationszentrum

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

### ultra fast SOM using CUDA

ultra fast SOM using CUDA SOM (Self-Organizing Map) is one of the most popular artificial neural network algorithms in the unsupervised learning category. Sijo Mathew Preetha Joy Sibi Rajendra Manoj A

### Performance Characteristics of Large SMP Machines

Performance Characteristics of Large SMP Machines Dirk Schmidl, Dieter an Mey, Matthias S. Müller schmidl@rz.rwth-aachen.de Rechen- und Kommunikationszentrum (RZ) Agenda Investigated Hardware Kernel Benchmark

### Outline Overview The CUDA architecture Memory optimization Execution configuration optimization Instruction optimization Summary

OpenCL Optimization Outline Overview The CUDA architecture Memory optimization Execution configuration optimization Instruction optimization Summary 2 Overall Optimization Strategies Maximize parallel

### Programming and Scheduling Model for Supporting Heterogeneous Architectures in Linux

Programming and Scheduling Model for Supporting Heterogeneous Architectures in Linux Third Workshop on Computer Architecture and Operating System co-design Paris, 25.01.2012 Tobias Beisel, Tobias Wiersema,

### Embedded Systems: map to FPGA, GPU, CPU?

Embedded Systems: map to FPGA, GPU, CPU? Jos van Eijndhoven jos@vectorfabrics.com Bits&Chips Embedded systems Nov 7, 2013 # of transistors Moore s law versus Amdahl s law Computational Capacity Hardware

### GPU Performance Analysis and Optimisation

GPU Performance Analysis and Optimisation Thomas Bradley, NVIDIA Corporation Outline What limits performance? Analysing performance: GPU profiling Exposing sufficient parallelism Optimising for Kepler

### Tamás Budavári / The Johns Hopkins University

PRACTICAL SCIENTIFIC ANALYSIS OF BIG DATA RUNNING IN PARALLEL / The Johns Hopkins University 2 Parallelism Data parallel Same processing on different pieces of data Task parallel Simultaneous processing

### IMAGE PROCESSING WITH CUDA

IMAGE PROCESSING WITH CUDA by Jia Tse Bachelor of Science, University of Nevada, Las Vegas 2006 A thesis submitted in partial fulfillment of the requirements for the Master of Science Degree in Computer

### GTC 2014 San Jose, California

GTC 2014 San Jose, California An Approach to Parallel Processing of Big Data in Finance for Alpha Generation and Risk Management Yigal Jhirad and Blay Tarnoff March 26, 2014 GTC 2014: Table of Contents

### OpenCL Do s and Don ts

OpenCL Do s and Don ts Ofer Rosenberg PMTS, OpenCL SW Dev. 19/12/2011 Dispatch Dispatch Application code do s and don ts Use OpenCL where its right Analyze the application code to find hotspots The hotspot

### IUmd. Performance Analysis of a Molecular Dynamics Code. Thomas William. Dresden, 5/27/13

Center for Information Services and High Performance Computing (ZIH) IUmd Performance Analysis of a Molecular Dynamics Code Thomas William Dresden, 5/27/13 Overview IUmd Introduction First Look with Vampir

### OpenCL. Administrivia. From Monday. Patrick Cozzi University of Pennsylvania CIS 565 - Spring 2011. Assignment 5 Posted. Project

Administrivia OpenCL Patrick Cozzi University of Pennsylvania CIS 565 - Spring 2011 Assignment 5 Posted Due Friday, 03/25, at 11:59pm Project One page pitch due Sunday, 03/20, at 11:59pm 10 minute pitch

### OpenACC Parallelization and Optimization of NAS Parallel Benchmarks

OpenACC Parallelization and Optimization of NAS Parallel Benchmarks Presented by Rengan Xu GTC 2014, S4340 03/26/2014 Rengan Xu, Xiaonan Tian, Sunita Chandrasekaran, Yonghong Yan, Barbara Chapman HPC Tools

### Design and Optimization of a Portable Lattice Boltzmann Code for Heterogeneous Architectures

Design and Optimization of a Portable Lattice Boltzmann Code for Heterogeneous Architectures E Calore, S F Schifano, R Tripiccione Enrico Calore INFN Ferrara, Italy Perspectives of GPU Computing in Physics

### INTEL PARALLEL STUDIO EVALUATION GUIDE. Intel Cilk Plus: A Simple Path to Parallelism

Intel Cilk Plus: A Simple Path to Parallelism Compiler extensions to simplify task and data parallelism Intel Cilk Plus adds simple language extensions to express data and task parallelism to the C and

### HPC Wales Skills Academy Course Catalogue 2015

HPC Wales Skills Academy Course Catalogue 2015 Overview The HPC Wales Skills Academy provides a variety of courses and workshops aimed at building skills in High Performance Computing (HPC). Our courses

### The Feasibility of Using OpenCL Instead of OpenMP for Parallel CPU Programming

The Feasibility of Using OpenCL Instead of OpenMP for Parallel CPU Programming Kamran Karimi Neak Solutions Calgary, Alberta, Canada kamran@neak-solutions.com Abstract OpenCL, along with CUDA, is one of

### NVIDIA CUDA GETTING STARTED GUIDE FOR MAC OS X

NVIDIA CUDA GETTING STARTED GUIDE FOR MAC OS X DU-05348-001_v6.5 August 2014 Installation and Verification on Mac OS X TABLE OF CONTENTS Chapter 1. Introduction...1 1.1. System Requirements... 1 1.2. About

### Benchmark Hadoop and Mars: MapReduce on cluster versus on GPU

Benchmark Hadoop and Mars: MapReduce on cluster versus on GPU Heshan Li, Shaopeng Wang The Johns Hopkins University 3400 N. Charles Street Baltimore, Maryland 21218 {heshanli, shaopeng}@cs.jhu.edu 1 Overview

### GMP implementation on CUDA - A Backward Compatible Design With Performance Tuning

1 GMP implementation on CUDA - A Backward Compatible Design With Performance Tuning Hao Jun Liu, Chu Tong Edward S. Rogers Sr. Department of Electrical and Computer Engineering University of Toronto haojun.liu@utoronto.ca,

### High-level Abstractions for Performance, Portability and Continuity of Scientific Software on Future Computing Systems

High-level Abstractions for Performance, Portability and Continuity of Scientific Software on Future Computing Systems G.R. Mudalige, I.Z. Reguly, M.B. Giles, W. Gaudin, A. Mallinson and O. Perks Oxford