CUDA (Compute Unified Device Dr. Bharathwaj Bharath Muthuswamy - - PowerPoint PPT Presentation

cuda compute unified device
SMART_READER_LITE
LIVE PREVIEW

CUDA (Compute Unified Device Dr. Bharathwaj Bharath Muthuswamy - - PowerPoint PPT Presentation

CUDA (Compute Unified Device Architecture) and OpenCL (Open Compute Language): Programming GPUs CUDA (Compute Unified Device Dr. Bharathwaj Bharath Muthuswamy Architecture) and OpenCL (Open Compute About me... Language):


slide-1
SLIDE 1

CUDA (Compute Unified Device Architecture) and OpenCL (Open Compute Language): Programming GPUs

  • Dr. Bharathwaj

“Bharath” Muthuswamy About me... Goals and Organization Conceptual Overview

  • f the Project

Understanding the Graphics Pipeline Part I: CUDA Part II: OpenCL DTCNN and OpenCL Conclusion and Q/A

CUDA (Compute Unified Device Architecture) and OpenCL (Open Compute Language): Programming GPUs

  • Dr. Bharathwaj “Bharath” Muthuswamy

Visiting Assistant Professor in Computer Science The College of New Jersey bharath.berkeley@gmail.com

February 20th 2018

1

slide-2
SLIDE 2

CUDA (Compute Unified Device Architecture) and OpenCL (Open Compute Language): Programming GPUs

  • Dr. Bharathwaj

“Bharath” Muthuswamy About me... Goals and Organization Conceptual Overview

  • f the Project

Understanding the Graphics Pipeline Part I: CUDA Part II: OpenCL DTCNN and OpenCL Conclusion and Q/A

About me...

◮ BS (2002), MS (2005), PhD (2009) in EECS from the

University of California, Berkeley (advisors: Dr. Leon O. Chua, Dr. Pravin P. Varaiya)

2

slide-3
SLIDE 3

CUDA (Compute Unified Device Architecture) and OpenCL (Open Compute Language): Programming GPUs

  • Dr. Bharathwaj

“Bharath” Muthuswamy About me... Goals and Organization Conceptual Overview

  • f the Project

Understanding the Graphics Pipeline Part I: CUDA Part II: OpenCL DTCNN and OpenCL Conclusion and Q/A

About me...

◮ BS (2002), MS (2005), PhD (2009) in EECS from the

University of California, Berkeley (advisors: Dr. Leon O. Chua, Dr. Pravin P. Varaiya)

◮ For my MS, I worked on biomimetic bipedal robotics

using Central Pattern Generators (I did not work on this after 2006)

◮ For my PhD, my primary contribution was designing,

implementing and rigorously proving the existence of chaos in the Muthuswamy-Chua system (circuit): an inductor-capacitor-memristor circuit in series (parallel)

2

slide-4
SLIDE 4

CUDA (Compute Unified Device Architecture) and OpenCL (Open Compute Language): Programming GPUs

  • Dr. Bharathwaj

“Bharath” Muthuswamy About me... Goals and Organization Conceptual Overview

  • f the Project

Understanding the Graphics Pipeline Part I: CUDA Part II: OpenCL DTCNN and OpenCL Conclusion and Q/A

About me...

◮ BS (2002), MS (2005), PhD (2009) in EECS from the

University of California, Berkeley (advisors: Dr. Leon O. Chua, Dr. Pravin P. Varaiya)

◮ For my MS, I worked on biomimetic bipedal robotics

using Central Pattern Generators (I did not work on this after 2006)

◮ For my PhD, my primary contribution was designing,

implementing and rigorously proving the existence of chaos in the Muthuswamy-Chua system (circuit): an inductor-capacitor-memristor circuit in series (parallel)

◮ Areas of interest:

◮ Computer vision and Quantum Computing ◮ Nonlinear Dynamics (Circuits). Specifically: chaotic

circuits and memristors

◮ Embedded (FPGA) Systems and Education 2

slide-5
SLIDE 5

CUDA (Compute Unified Device Architecture) and OpenCL (Open Compute Language): Programming GPUs

  • Dr. Bharathwaj

“Bharath” Muthuswamy About me... Goals and Organization Conceptual Overview

  • f the Project

Understanding the Graphics Pipeline Part I: CUDA Part II: OpenCL DTCNN and OpenCL Conclusion and Q/A

Project goal, Presentation goal and Organization

◮ Goal of my research: Implement a model for the

mammalian visual pathway on a heterogeneous platform using Discrete Time Cellular Nonlinear Networks (DTCNN).

3

slide-6
SLIDE 6

CUDA (Compute Unified Device Architecture) and OpenCL (Open Compute Language): Programming GPUs

  • Dr. Bharathwaj

“Bharath” Muthuswamy About me... Goals and Organization Conceptual Overview

  • f the Project

Understanding the Graphics Pipeline Part I: CUDA Part II: OpenCL DTCNN and OpenCL Conclusion and Q/A

Project goal, Presentation goal and Organization

◮ Goal of my research: Implement a model for the

mammalian visual pathway on a heterogeneous platform using Discrete Time Cellular Nonlinear Networks (DTCNN).

◮ Application: Robust recognition of hand-drawn

electronic circuit diagrams

◮ Goal of this talk: Discuss GPU programming strategies

(CUDA and OpenCL)

3

slide-7
SLIDE 7

CUDA (Compute Unified Device Architecture) and OpenCL (Open Compute Language): Programming GPUs

  • Dr. Bharathwaj

“Bharath” Muthuswamy About me... Goals and Organization Conceptual Overview

  • f the Project

Understanding the Graphics Pipeline Part I: CUDA Part II: OpenCL DTCNN and OpenCL Conclusion and Q/A

Project goal, Presentation goal and Organization

◮ Goal of my research: Implement a model for the

mammalian visual pathway on a heterogeneous platform using Discrete Time Cellular Nonlinear Networks (DTCNN).

◮ Application: Robust recognition of hand-drawn

electronic circuit diagrams

◮ Goal of this talk: Discuss GPU programming strategies

(CUDA and OpenCL)

◮ Organization:

3

slide-8
SLIDE 8

CUDA (Compute Unified Device Architecture) and OpenCL (Open Compute Language): Programming GPUs

  • Dr. Bharathwaj

“Bharath” Muthuswamy About me... Goals and Organization Conceptual Overview

  • f the Project

Understanding the Graphics Pipeline Part I: CUDA Part II: OpenCL DTCNN and OpenCL Conclusion and Q/A

Project goal, Presentation goal and Organization

◮ Goal of my research: Implement a model for the

mammalian visual pathway on a heterogeneous platform using Discrete Time Cellular Nonlinear Networks (DTCNN).

◮ Application: Robust recognition of hand-drawn

electronic circuit diagrams

◮ Goal of this talk: Discuss GPU programming strategies

(CUDA and OpenCL)

◮ Organization:

◮ Conceptual Overview of the Project 3

slide-9
SLIDE 9

CUDA (Compute Unified Device Architecture) and OpenCL (Open Compute Language): Programming GPUs

  • Dr. Bharathwaj

“Bharath” Muthuswamy About me... Goals and Organization Conceptual Overview

  • f the Project

Understanding the Graphics Pipeline Part I: CUDA Part II: OpenCL DTCNN and OpenCL Conclusion and Q/A

Project goal, Presentation goal and Organization

◮ Goal of my research: Implement a model for the

mammalian visual pathway on a heterogeneous platform using Discrete Time Cellular Nonlinear Networks (DTCNN).

◮ Application: Robust recognition of hand-drawn

electronic circuit diagrams

◮ Goal of this talk: Discuss GPU programming strategies

(CUDA and OpenCL)

◮ Organization:

◮ Conceptual Overview of the Project ◮ Understanding the graphics pipeline 3

slide-10
SLIDE 10

CUDA (Compute Unified Device Architecture) and OpenCL (Open Compute Language): Programming GPUs

  • Dr. Bharathwaj

“Bharath” Muthuswamy About me... Goals and Organization Conceptual Overview

  • f the Project

Understanding the Graphics Pipeline Part I: CUDA Part II: OpenCL DTCNN and OpenCL Conclusion and Q/A

Project goal, Presentation goal and Organization

◮ Goal of my research: Implement a model for the

mammalian visual pathway on a heterogeneous platform using Discrete Time Cellular Nonlinear Networks (DTCNN).

◮ Application: Robust recognition of hand-drawn

electronic circuit diagrams

◮ Goal of this talk: Discuss GPU programming strategies

(CUDA and OpenCL)

◮ Organization:

◮ Conceptual Overview of the Project ◮ Understanding the graphics pipeline ◮ Part I: CUDA - Hello, world; SAXPY 3

slide-11
SLIDE 11

CUDA (Compute Unified Device Architecture) and OpenCL (Open Compute Language): Programming GPUs

  • Dr. Bharathwaj

“Bharath” Muthuswamy About me... Goals and Organization Conceptual Overview

  • f the Project

Understanding the Graphics Pipeline Part I: CUDA Part II: OpenCL DTCNN and OpenCL Conclusion and Q/A

Project goal, Presentation goal and Organization

◮ Goal of my research: Implement a model for the

mammalian visual pathway on a heterogeneous platform using Discrete Time Cellular Nonlinear Networks (DTCNN).

◮ Application: Robust recognition of hand-drawn

electronic circuit diagrams

◮ Goal of this talk: Discuss GPU programming strategies

(CUDA and OpenCL)

◮ Organization:

◮ Conceptual Overview of the Project ◮ Understanding the graphics pipeline ◮ Part I: CUDA - Hello, world; SAXPY ◮ Part II: OpenCL - Hello, world 3

slide-12
SLIDE 12

CUDA (Compute Unified Device Architecture) and OpenCL (Open Compute Language): Programming GPUs

  • Dr. Bharathwaj

“Bharath” Muthuswamy About me... Goals and Organization Conceptual Overview

  • f the Project

Understanding the Graphics Pipeline Part I: CUDA Part II: OpenCL DTCNN and OpenCL Conclusion and Q/A

Project goal, Presentation goal and Organization

◮ Goal of my research: Implement a model for the

mammalian visual pathway on a heterogeneous platform using Discrete Time Cellular Nonlinear Networks (DTCNN).

◮ Application: Robust recognition of hand-drawn

electronic circuit diagrams

◮ Goal of this talk: Discuss GPU programming strategies

(CUDA and OpenCL)

◮ Organization:

◮ Conceptual Overview of the Project ◮ Understanding the graphics pipeline ◮ Part I: CUDA - Hello, world; SAXPY ◮ Part II: OpenCL - Hello, world ◮ Current work: OpenCL specification of DTCNN 3

slide-13
SLIDE 13

CUDA (Compute Unified Device Architecture) and OpenCL (Open Compute Language): Programming GPUs

  • Dr. Bharathwaj

“Bharath” Muthuswamy About me... Goals and Organization Conceptual Overview

  • f the Project

Understanding the Graphics Pipeline Part I: CUDA Part II: OpenCL DTCNN and OpenCL Conclusion and Q/A

Project goal, Presentation goal and Organization

◮ Goal of my research: Implement a model for the

mammalian visual pathway on a heterogeneous platform using Discrete Time Cellular Nonlinear Networks (DTCNN).

◮ Application: Robust recognition of hand-drawn

electronic circuit diagrams

◮ Goal of this talk: Discuss GPU programming strategies

(CUDA and OpenCL)

◮ Organization:

◮ Conceptual Overview of the Project ◮ Understanding the graphics pipeline ◮ Part I: CUDA - Hello, world; SAXPY ◮ Part II: OpenCL - Hello, world ◮ Current work: OpenCL specification of DTCNN ◮ Conclusion and Q/A 3

slide-14
SLIDE 14

CUDA (Compute Unified Device Architecture) and OpenCL (Open Compute Language): Programming GPUs

  • Dr. Bharathwaj

“Bharath” Muthuswamy About me... Goals and Organization Conceptual Overview

  • f the Project

Understanding the Graphics Pipeline Part I: CUDA Part II: OpenCL DTCNN and OpenCL Conclusion and Q/A

Mammalian Retina

4

slide-15
SLIDE 15

CUDA (Compute Unified Device Architecture) and OpenCL (Open Compute Language): Programming GPUs

  • Dr. Bharathwaj

“Bharath” Muthuswamy About me... Goals and Organization Conceptual Overview

  • f the Project

Understanding the Graphics Pipeline Part I: CUDA Part II: OpenCL DTCNN and OpenCL Conclusion and Q/A

Block Diagram of the Project

5

slide-16
SLIDE 16

CUDA (Compute Unified Device Architecture) and OpenCL (Open Compute Language): Programming GPUs

  • Dr. Bharathwaj

“Bharath” Muthuswamy About me... Goals and Organization Conceptual Overview

  • f the Project

Understanding the Graphics Pipeline Part I: CUDA Part II: OpenCL DTCNN and OpenCL Conclusion and Q/A

Simple Raster Graphics Pipeline

6

slide-17
SLIDE 17

CUDA (Compute Unified Device Architecture) and OpenCL (Open Compute Language): Programming GPUs

  • Dr. Bharathwaj

“Bharath” Muthuswamy About me... Goals and Organization Conceptual Overview

  • f the Project

Understanding the Graphics Pipeline Part I: CUDA Part II: OpenCL DTCNN and OpenCL Conclusion and Q/A

Enhanced Graphics Pipeline

7

slide-18
SLIDE 18

CUDA (Compute Unified Device Architecture) and OpenCL (Open Compute Language): Programming GPUs

  • Dr. Bharathwaj

“Bharath” Muthuswamy About me... Goals and Organization Conceptual Overview

  • f the Project

Understanding the Graphics Pipeline Part I: CUDA Part II: OpenCL DTCNN and OpenCL Conclusion and Q/A

General Purpose Pipeline

8

slide-19
SLIDE 19

CUDA (Compute Unified Device Architecture) and OpenCL (Open Compute Language): Programming GPUs

  • Dr. Bharathwaj

“Bharath” Muthuswamy About me... Goals and Organization Conceptual Overview

  • f the Project

Understanding the Graphics Pipeline Part I: CUDA Part II: OpenCL DTCNN and OpenCL Conclusion and Q/A

Shader Pipeline

9

slide-20
SLIDE 20

CUDA (Compute Unified Device Architecture) and OpenCL (Open Compute Language): Programming GPUs

  • Dr. Bharathwaj

“Bharath” Muthuswamy About me... Goals and Organization Conceptual Overview

  • f the Project

Understanding the Graphics Pipeline Part I: CUDA Part II: OpenCL DTCNN and OpenCL Conclusion and Q/A

SIMD Pipeline

10

slide-21
SLIDE 21

CUDA (Compute Unified Device Architecture) and OpenCL (Open Compute Language): Programming GPUs

  • Dr. Bharathwaj

“Bharath” Muthuswamy About me... Goals and Organization Conceptual Overview

  • f the Project

Understanding the Graphics Pipeline Part I: CUDA Part II: OpenCL DTCNN and OpenCL Conclusion and Q/A

SIMD Pipeline

10

slide-22
SLIDE 22

CUDA (Compute Unified Device Architecture) and OpenCL (Open Compute Language): Programming GPUs

  • Dr. Bharathwaj

“Bharath” Muthuswamy About me... Goals and Organization Conceptual Overview

  • f the Project

Understanding the Graphics Pipeline Part I: CUDA Part II: OpenCL DTCNN and OpenCL Conclusion and Q/A

SIMT Pipeline

11

slide-23
SLIDE 23

CUDA (Compute Unified Device Architecture) and OpenCL (Open Compute Language): Programming GPUs

  • Dr. Bharathwaj

“Bharath” Muthuswamy About me... Goals and Organization Conceptual Overview

  • f the Project

Understanding the Graphics Pipeline Part I: CUDA Part II: OpenCL DTCNN and OpenCL Conclusion and Q/A

SIMT Pipeline

11

slide-24
SLIDE 24

CUDA (Compute Unified Device Architecture) and OpenCL (Open Compute Language): Programming GPUs

  • Dr. Bharathwaj

“Bharath” Muthuswamy About me... Goals and Organization Conceptual Overview

  • f the Project

Understanding the Graphics Pipeline Part I: CUDA Part II: OpenCL DTCNN and OpenCL Conclusion and Q/A

CUDA: High-level overview

◮ Traditional serial version of the program...

12

slide-25
SLIDE 25

CUDA (Compute Unified Device Architecture) and OpenCL (Open Compute Language): Programming GPUs

  • Dr. Bharathwaj

“Bharath” Muthuswamy About me... Goals and Organization Conceptual Overview

  • f the Project

Understanding the Graphics Pipeline Part I: CUDA Part II: OpenCL DTCNN and OpenCL Conclusion and Q/A

CUDA: High-level overview

◮ Traditional serial version of the program... ◮ ...that sets up subroutines or kernels that are to be

executed in parallel

12

slide-26
SLIDE 26

CUDA (Compute Unified Device Architecture) and OpenCL (Open Compute Language): Programming GPUs

  • Dr. Bharathwaj

“Bharath” Muthuswamy About me... Goals and Organization Conceptual Overview

  • f the Project

Understanding the Graphics Pipeline Part I: CUDA Part II: OpenCL DTCNN and OpenCL Conclusion and Q/A

CUDA Examples

http://www.harpgroup.org/muthuswamy/computerVision/CUDA/helloWorld 13

slide-27
SLIDE 27

CUDA (Compute Unified Device Architecture) and OpenCL (Open Compute Language): Programming GPUs

  • Dr. Bharathwaj

“Bharath” Muthuswamy About me... Goals and Organization Conceptual Overview

  • f the Project

Understanding the Graphics Pipeline Part I: CUDA Part II: OpenCL DTCNN and OpenCL Conclusion and Q/A

CUDA Examples

http://www.harpgroup.org/muthuswamy/computerVision/CUDA/helloWorld

http://www.harpgroup.org/muthuswamy/computerVision/CUDA/saxpy 13

slide-28
SLIDE 28

CUDA (Compute Unified Device Architecture) and OpenCL (Open Compute Language): Programming GPUs

  • Dr. Bharathwaj

“Bharath” Muthuswamy About me... Goals and Organization Conceptual Overview

  • f the Project

Understanding the Graphics Pipeline Part I: CUDA Part II: OpenCL DTCNN and OpenCL Conclusion and Q/A

OpenCL: High-level overview

◮ Think of OpenCL as a “personal robot army”:

14

slide-29
SLIDE 29

CUDA (Compute Unified Device Architecture) and OpenCL (Open Compute Language): Programming GPUs

  • Dr. Bharathwaj

“Bharath” Muthuswamy About me... Goals and Organization Conceptual Overview

  • f the Project

Understanding the Graphics Pipeline Part I: CUDA Part II: OpenCL DTCNN and OpenCL Conclusion and Q/A

OpenCL: High-level overview

◮ Think of OpenCL as a “personal robot army”:

◮ Each robot or OpenCL work unit works on specific

data independent of other robots

14

slide-30
SLIDE 30

CUDA (Compute Unified Device Architecture) and OpenCL (Open Compute Language): Programming GPUs

  • Dr. Bharathwaj

“Bharath” Muthuswamy About me... Goals and Organization Conceptual Overview

  • f the Project

Understanding the Graphics Pipeline Part I: CUDA Part II: OpenCL DTCNN and OpenCL Conclusion and Q/A

OpenCL: High-level overview

◮ Think of OpenCL as a “personal robot army”:

◮ Each robot or OpenCL work unit works on specific

data independent of other robots

◮ Each robot has a unique id, robots can be grouped 14

slide-31
SLIDE 31

CUDA (Compute Unified Device Architecture) and OpenCL (Open Compute Language): Programming GPUs

  • Dr. Bharathwaj

“Bharath” Muthuswamy About me... Goals and Organization Conceptual Overview

  • f the Project

Understanding the Graphics Pipeline Part I: CUDA Part II: OpenCL DTCNN and OpenCL Conclusion and Q/A

OpenCL: High-level overview

◮ Think of OpenCL as a “personal robot army”:

◮ Each robot or OpenCL work unit works on specific

data independent of other robots

◮ Each robot has a unique id, robots can be grouped

◮ Limitation: data-parallelism (see example of DTCNN

later)

14

slide-32
SLIDE 32

CUDA (Compute Unified Device Architecture) and OpenCL (Open Compute Language): Programming GPUs

  • Dr. Bharathwaj

“Bharath” Muthuswamy About me... Goals and Organization Conceptual Overview

  • f the Project

Understanding the Graphics Pipeline Part I: CUDA Part II: OpenCL DTCNN and OpenCL Conclusion and Q/A

OpenCL: Steps

◮ Get list of available platforms

15

slide-33
SLIDE 33

CUDA (Compute Unified Device Architecture) and OpenCL (Open Compute Language): Programming GPUs

  • Dr. Bharathwaj

“Bharath” Muthuswamy About me... Goals and Organization Conceptual Overview

  • f the Project

Understanding the Graphics Pipeline Part I: CUDA Part II: OpenCL DTCNN and OpenCL Conclusion and Q/A

OpenCL: Steps

◮ Get list of available platforms ◮ Use platforms to select appropriate device(s)

15

slide-34
SLIDE 34

CUDA (Compute Unified Device Architecture) and OpenCL (Open Compute Language): Programming GPUs

  • Dr. Bharathwaj

“Bharath” Muthuswamy About me... Goals and Organization Conceptual Overview

  • f the Project

Understanding the Graphics Pipeline Part I: CUDA Part II: OpenCL DTCNN and OpenCL Conclusion and Q/A

OpenCL: Steps

◮ Get list of available platforms ◮ Use platforms to select appropriate device(s) ◮ Create an OpenCL context

15

slide-35
SLIDE 35

CUDA (Compute Unified Device Architecture) and OpenCL (Open Compute Language): Programming GPUs

  • Dr. Bharathwaj

“Bharath” Muthuswamy About me... Goals and Organization Conceptual Overview

  • f the Project

Understanding the Graphics Pipeline Part I: CUDA Part II: OpenCL DTCNN and OpenCL Conclusion and Q/A

OpenCL: Steps

◮ Get list of available platforms ◮ Use platforms to select appropriate device(s) ◮ Create an OpenCL context ◮ Create command queue

15

slide-36
SLIDE 36

CUDA (Compute Unified Device Architecture) and OpenCL (Open Compute Language): Programming GPUs

  • Dr. Bharathwaj

“Bharath” Muthuswamy About me... Goals and Organization Conceptual Overview

  • f the Project

Understanding the Graphics Pipeline Part I: CUDA Part II: OpenCL DTCNN and OpenCL Conclusion and Q/A

OpenCL: Steps

◮ Get list of available platforms ◮ Use platforms to select appropriate device(s) ◮ Create an OpenCL context ◮ Create command queue ◮ Create memory objects

15

slide-37
SLIDE 37

CUDA (Compute Unified Device Architecture) and OpenCL (Open Compute Language): Programming GPUs

  • Dr. Bharathwaj

“Bharath” Muthuswamy About me... Goals and Organization Conceptual Overview

  • f the Project

Understanding the Graphics Pipeline Part I: CUDA Part II: OpenCL DTCNN and OpenCL Conclusion and Q/A

OpenCL: Steps

◮ Get list of available platforms ◮ Use platforms to select appropriate device(s) ◮ Create an OpenCL context ◮ Create command queue ◮ Create memory objects ◮ Create kernel

15

slide-38
SLIDE 38

CUDA (Compute Unified Device Architecture) and OpenCL (Open Compute Language): Programming GPUs

  • Dr. Bharathwaj

“Bharath” Muthuswamy About me... Goals and Organization Conceptual Overview

  • f the Project

Understanding the Graphics Pipeline Part I: CUDA Part II: OpenCL DTCNN and OpenCL Conclusion and Q/A

OpenCL: Steps

◮ Get list of available platforms ◮ Use platforms to select appropriate device(s) ◮ Create an OpenCL context ◮ Create command queue ◮ Create memory objects ◮ Create kernel

◮ Load kernel specified via OpenCL C-extension(s) 15

slide-39
SLIDE 39

CUDA (Compute Unified Device Architecture) and OpenCL (Open Compute Language): Programming GPUs

  • Dr. Bharathwaj

“Bharath” Muthuswamy About me... Goals and Organization Conceptual Overview

  • f the Project

Understanding the Graphics Pipeline Part I: CUDA Part II: OpenCL DTCNN and OpenCL Conclusion and Q/A

OpenCL: Steps

◮ Get list of available platforms ◮ Use platforms to select appropriate device(s) ◮ Create an OpenCL context ◮ Create command queue ◮ Create memory objects ◮ Create kernel

◮ Load kernel specified via OpenCL C-extension(s) ◮ Compile kernel to obtain kernel object 15

slide-40
SLIDE 40

CUDA (Compute Unified Device Architecture) and OpenCL (Open Compute Language): Programming GPUs

  • Dr. Bharathwaj

“Bharath” Muthuswamy About me... Goals and Organization Conceptual Overview

  • f the Project

Understanding the Graphics Pipeline Part I: CUDA Part II: OpenCL DTCNN and OpenCL Conclusion and Q/A

OpenCL: Steps

◮ Get list of available platforms ◮ Use platforms to select appropriate device(s) ◮ Create an OpenCL context ◮ Create command queue ◮ Create memory objects ◮ Create kernel

◮ Load kernel specified via OpenCL C-extension(s) ◮ Compile kernel to obtain kernel object ◮ Set any kernel parameters 15

slide-41
SLIDE 41

CUDA (Compute Unified Device Architecture) and OpenCL (Open Compute Language): Programming GPUs

  • Dr. Bharathwaj

“Bharath” Muthuswamy About me... Goals and Organization Conceptual Overview

  • f the Project

Understanding the Graphics Pipeline Part I: CUDA Part II: OpenCL DTCNN and OpenCL Conclusion and Q/A

OpenCL: Steps

◮ Get list of available platforms ◮ Use platforms to select appropriate device(s) ◮ Create an OpenCL context ◮ Create command queue ◮ Create memory objects ◮ Create kernel

◮ Load kernel specified via OpenCL C-extension(s) ◮ Compile kernel to obtain kernel object ◮ Set any kernel parameters

◮ Execute the kernel

15

slide-42
SLIDE 42

CUDA (Compute Unified Device Architecture) and OpenCL (Open Compute Language): Programming GPUs

  • Dr. Bharathwaj

“Bharath” Muthuswamy About me... Goals and Organization Conceptual Overview

  • f the Project

Understanding the Graphics Pipeline Part I: CUDA Part II: OpenCL DTCNN and OpenCL Conclusion and Q/A

OpenCL: Steps

◮ Get list of available platforms ◮ Use platforms to select appropriate device(s) ◮ Create an OpenCL context ◮ Create command queue ◮ Create memory objects ◮ Create kernel

◮ Load kernel specified via OpenCL C-extension(s) ◮ Compile kernel to obtain kernel object ◮ Set any kernel parameters

◮ Execute the kernel ◮ Read result from previously created memory object

15

slide-43
SLIDE 43

CUDA (Compute Unified Device Architecture) and OpenCL (Open Compute Language): Programming GPUs

  • Dr. Bharathwaj

“Bharath” Muthuswamy About me... Goals and Organization Conceptual Overview

  • f the Project

Understanding the Graphics Pipeline Part I: CUDA Part II: OpenCL DTCNN and OpenCL Conclusion and Q/A

OpenCL: Steps

◮ Get list of available platforms ◮ Use platforms to select appropriate device(s) ◮ Create an OpenCL context ◮ Create command queue ◮ Create memory objects ◮ Create kernel

◮ Load kernel specified via OpenCL C-extension(s) ◮ Compile kernel to obtain kernel object ◮ Set any kernel parameters

◮ Execute the kernel ◮ Read result from previously created memory object ◮ Free memory

15

slide-44
SLIDE 44

CUDA (Compute Unified Device Architecture) and OpenCL (Open Compute Language): Programming GPUs

  • Dr. Bharathwaj

“Bharath” Muthuswamy About me... Goals and Organization Conceptual Overview

  • f the Project

Understanding the Graphics Pipeline Part I: CUDA Part II: OpenCL DTCNN and OpenCL Conclusion and Q/A

OpenCL: Example

http://www.harpgroup.org/muthuswamy/computerVision/OpenCL/helloWorld 16

slide-45
SLIDE 45

CUDA (Compute Unified Device Architecture) and OpenCL (Open Compute Language): Programming GPUs

  • Dr. Bharathwaj

“Bharath” Muthuswamy About me... Goals and Organization Conceptual Overview

  • f the Project

Understanding the Graphics Pipeline Part I: CUDA Part II: OpenCL DTCNN and OpenCL Conclusion and Q/A

(DT)CNN: Concept(s)

◮ M × N CNN architecture:

17

slide-46
SLIDE 46

CUDA (Compute Unified Device Architecture) and OpenCL (Open Compute Language): Programming GPUs

  • Dr. Bharathwaj

“Bharath” Muthuswamy About me... Goals and Organization Conceptual Overview

  • f the Project

Understanding the Graphics Pipeline Part I: CUDA Part II: OpenCL DTCNN and OpenCL Conclusion and Q/A

(DT)CNN: Concept(s)

◮ M × N CNN architecture: ◮ State equation and output equation (nonlinear):

17

slide-47
SLIDE 47

CUDA (Compute Unified Device Architecture) and OpenCL (Open Compute Language): Programming GPUs

  • Dr. Bharathwaj

“Bharath” Muthuswamy About me... Goals and Organization Conceptual Overview

  • f the Project

Understanding the Graphics Pipeline Part I: CUDA Part II: OpenCL DTCNN and OpenCL Conclusion and Q/A

(DT)CNN: Concept(s)

◮ M × N CNN architecture: ◮ State equation and output equation (nonlinear): ◮ DTCNN:

17

slide-48
SLIDE 48

CUDA (Compute Unified Device Architecture) and OpenCL (Open Compute Language): Programming GPUs

  • Dr. Bharathwaj

“Bharath” Muthuswamy About me... Goals and Organization Conceptual Overview

  • f the Project

Understanding the Graphics Pipeline Part I: CUDA Part II: OpenCL DTCNN and OpenCL Conclusion and Q/A

OpenCL flow

◮ DTCNN state equation can be written as:

18

slide-49
SLIDE 49

CUDA (Compute Unified Device Architecture) and OpenCL (Open Compute Language): Programming GPUs

  • Dr. Bharathwaj

“Bharath” Muthuswamy About me... Goals and Organization Conceptual Overview

  • f the Project

Understanding the Graphics Pipeline Part I: CUDA Part II: OpenCL DTCNN and OpenCL Conclusion and Q/A

OpenCL flow

◮ DTCNN state equation can be written as: ◮ Proposed OpenCL implementation:

18

slide-50
SLIDE 50

CUDA (Compute Unified Device Architecture) and OpenCL (Open Compute Language): Programming GPUs

  • Dr. Bharathwaj

“Bharath” Muthuswamy About me... Goals and Organization Conceptual Overview

  • f the Project

Understanding the Graphics Pipeline Part I: CUDA Part II: OpenCL DTCNN and OpenCL Conclusion and Q/A

Conclusion and Q/A

◮ Current work: Implementing various retinal “filters” via

DTCNN using OpenCL

◮ Future work: post-processing of images obtained from

hand-drawn electronic circuit diagrams:

◮ Deep learning (?): Learn data representations, but use

images obtained from retinal “filters”. Note: it is known the visual cortex processes in parallel the images

  • btained from the retina

◮ *Potential* funding:

https://www.grants.gov/web/grants/view-

  • pportunity.html?oppId=300721

◮ Reference: Detailed howto and code is online:

http://www.harpgroup.org/muthuswamy/computerVision

19