SlideShare uma empresa Scribd logo
1 de 18
Baixar para ler offline
GPU programming with Java

               Pramuditha Aravinda.
                 Kelum Senanayake.
Outline
   What is GPU.
   CPU vs. GPU Architecture.
   What is Stream processing.
   General Purpose GPU.
   CUDA.
   OpenCL
   Demo
What is GPU
   Graphics processing unit.
       Specialized microprocessor.
   Very efficient at manipulating computer graphics.
   Offloads and accelerates graphics rendering from the
    CPU.
   Dedicated to calculating floating point operations.
   Highly parallel structure.
       More effective for a range of complex algorithms.
   GPU can be present on,
       Video card.
       Motherboard
       CPU die (certain Core Intel CPUs)
CPU vs. GPU Architecture




       The GPU devotes more transistors to data processing.

     GPU : A Highly Parallel, Multithreaded, Manycore Processor
CPU vs. GPU contd…
What is Stream processing
   Is a computer programming paradigm, related to SIMD.
   Allows applications to easily exploit a limited form of
    parallel processing.
   Terminology
       Stream :- A set of data
       Kernel functions :- A series of operations
   Uniform streaming :- One kernel function is applied to all
    elements in the stream.
   Stream processing is driven by a data-centric model
       Image, video and digital signal processing
   Less efficient in general purpose processing with more
    randomized data access (such as databases)
General Purpose GPU
   The GPU is, by design, a stream processing system.
   GPGPU is a programming methodology.
       Modifying algorithms to run on existing GPU hardware
   Capable of performing simple operations on a stream of
    input data with amazing speed.
   Allows software developers to use stream processing on
    non-graphics data.
How hard is it?
   The languages are not very easy to use. Most GPU cards
    still operate on assembly language.
   The process flow is unique. Typically simple branching
    statement, such as if statements, offer such a performance
    penalty that it is often faster to process both conditions.
   The unique Stream-In-Stream-Out design is not typically
    used in CPU programs.
   The need to work with geometric primitives in order to
    push mathematical inputs to the system.
   Rapidly growing community.
Programming GPUs!
   Plenty of interfaces
       Compute Unified Device Architecture (CUDA)
       OpenCL
       OpenGL Shader Language (GLSL)
       DirectX/DirectCompute/HLSL
       ATI Stream
CUDA
   Compute Unified Device Architecture.
   Parallel computing architecture developed by NVIDIA.
   Programmers use C for CUDA.
       C with NVIDIA extensions and certain restrictions.
   Third party wrappers are also available for Python, Perl,
    Fortran, Java, Ruby, Lua, MATLAB and IDL.
   Currently used in,
       SETI@Home
       Distributed Calculations, such as predicting the native
        conformation of proteins
       Accelerated inter conversion of video file formats
       Physical simulations, in particular in fluid dynamics
CUDA Processing Flow
OpenCL
   Open Computing Language.
   Managed by the non-profit technology consortium
    Khronos Group
   Framework for writing programs that execute across
    heterogeneous platforms consisting of CPUs, GPUs, and
    other processors.
   Includes a language (based on C99) for writing kernels.
   APIs to define and then control the platforms.
   Supports both AMD/ATI and NVIDIA.
Programming GPU with Java and
OpenCL
   We need to program using a GPGPU driver
   However most GPGPU drivers are available as a native dll
    only.
   We need another layer to interface to Java runtime.
   Called Java Binding
Java Binding

               UserProgram.class




                    Jocl.jar




                    Jocl.dll




                  OpenCL.dll
Prerequisites - Hardware
   OpenCL capable graphic card.
   nVidea – All CUDA enabled GPU have OpenCL support.
       GeForce 8xxx or higher with 256MB minimum.
       http://www.nvidia.com/object/cuda_gpus.html
   AMD ATI Radeon™ HD 5400 or higher, AMD Radeon™
    HD 6800 series or higher.
       AMD X86 CPU w/ SSE 2.x or later are also supported.
       http://developer.amd.com/gpu/AMDAPPSDK/pages/DriverCom
        patibility.aspx
Prerequisites - Software
   OpenCL driver. – for nVidia GPUs, Usually OpenCL
    drivers are distributed with graphic card drivers.
       http://developer.nvidia.com/object/opencl-download.html
   Java bindings for OpenCL. – Usually there are two parts
       Platform dependent dll. e.g. jocl-windows-x86.dll
       Platform independent jar file. Jocl.jar
       There are few Implementations.
        http://jogamp.org/deployment/webstart/archive/jocl-0.9-b1-
        20101213-windows-i586.zip
   JDK
       http://www.oracle.com/technetwork/java/javase/downloads/ind
        ex.html
Demo Program
   Based on sample program available at
    http://jogamp.org/wiki/index.php/JOCL_Tutorial
GPU Programming with Java

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

DVD TECHNOLOGY BY SAIKIRAN PANJALA
DVD TECHNOLOGY BY SAIKIRAN PANJALADVD TECHNOLOGY BY SAIKIRAN PANJALA
DVD TECHNOLOGY BY SAIKIRAN PANJALA
 
Cloud Gaming
Cloud GamingCloud Gaming
Cloud Gaming
 
Tic tac toe game with graphics presentation
Tic  tac  toe game with graphics presentationTic  tac  toe game with graphics presentation
Tic tac toe game with graphics presentation
 
Guide lanceur d'alerte
Guide lanceur d'alerteGuide lanceur d'alerte
Guide lanceur d'alerte
 
Presentation on Android operating system
Presentation on Android operating systemPresentation on Android operating system
Presentation on Android operating system
 
Snapdragon Processor
Snapdragon ProcessorSnapdragon Processor
Snapdragon Processor
 
Introduction to GPU Programming
Introduction to GPU ProgrammingIntroduction to GPU Programming
Introduction to GPU Programming
 
Android ppt
Android pptAndroid ppt
Android ppt
 
GPU
GPUGPU
GPU
 
Pong Game using Java awt and swing
Pong Game using Java awt and swingPong Game using Java awt and swing
Pong Game using Java awt and swing
 
Graphics card
Graphics cardGraphics card
Graphics card
 
Cuda
CudaCuda
Cuda
 
android phone ppt
android phone pptandroid phone ppt
android phone ppt
 
Introduction to Android ppt
Introduction to Android pptIntroduction to Android ppt
Introduction to Android ppt
 
Direct X
Direct XDirect X
Direct X
 
AMD Processor
AMD ProcessorAMD Processor
AMD Processor
 
Graphics card ppt
Graphics card pptGraphics card ppt
Graphics card ppt
 
10. GPU - Video Card (Display, Graphics, VGA)
10. GPU - Video Card (Display, Graphics, VGA)10. GPU - Video Card (Display, Graphics, VGA)
10. GPU - Video Card (Display, Graphics, VGA)
 
Graphics processing unit ppt
Graphics processing unit pptGraphics processing unit ppt
Graphics processing unit ppt
 
IODevices.pptx
IODevices.pptxIODevices.pptx
IODevices.pptx
 

Semelhante a GPU Programming with Java

GPGPU programming with CUDA
GPGPU programming with CUDAGPGPU programming with CUDA
GPGPU programming with CUDASavith Satheesh
 
GPU - An Introduction
GPU - An IntroductionGPU - An Introduction
GPU - An IntroductionDhan V Sagar
 
Achieving Improved Performance In Multi-threaded Programming With GPU Computing
Achieving Improved Performance In Multi-threaded Programming With GPU ComputingAchieving Improved Performance In Multi-threaded Programming With GPU Computing
Achieving Improved Performance In Multi-threaded Programming With GPU ComputingMesbah Uddin Khan
 
Stream Processing
Stream ProcessingStream Processing
Stream Processingarnamoy10
 
Gpu computing-webgl
Gpu computing-webglGpu computing-webgl
Gpu computing-webglVisCircle
 
Vpu technology &gpgpu computing
Vpu technology &gpgpu computingVpu technology &gpgpu computing
Vpu technology &gpgpu computingArka Ghosh
 
Vpu technology &gpgpu computing
Vpu technology &gpgpu computingVpu technology &gpgpu computing
Vpu technology &gpgpu computingArka Ghosh
 
Vpu technology &gpgpu computing
Vpu technology &gpgpu computingVpu technology &gpgpu computing
Vpu technology &gpgpu computingArka Ghosh
 
gpuprogram_lecture,architecture_designsn
gpuprogram_lecture,architecture_designsngpuprogram_lecture,architecture_designsn
gpuprogram_lecture,architecture_designsnARUNACHALAM468781
 
LCU13: GPGPU on ARM Experience Report
LCU13: GPGPU on ARM Experience ReportLCU13: GPGPU on ARM Experience Report
LCU13: GPGPU on ARM Experience ReportLinaro
 
Vpu technology &gpgpu computing
Vpu technology &gpgpu computingVpu technology &gpgpu computing
Vpu technology &gpgpu computingArka Ghosh
 
GPGPU Accelerates PostgreSQL (English)
GPGPU Accelerates PostgreSQL (English)GPGPU Accelerates PostgreSQL (English)
GPGPU Accelerates PostgreSQL (English)Kohei KaiGai
 
A SURVEY ON GPU SYSTEM CONSIDERING ITS PERFORMANCE ON DIFFERENT APPLICATIONS
A SURVEY ON GPU SYSTEM CONSIDERING ITS PERFORMANCE ON DIFFERENT APPLICATIONSA SURVEY ON GPU SYSTEM CONSIDERING ITS PERFORMANCE ON DIFFERENT APPLICATIONS
A SURVEY ON GPU SYSTEM CONSIDERING ITS PERFORMANCE ON DIFFERENT APPLICATIONScseij
 
Pycon2014 GPU computing
Pycon2014 GPU computingPycon2014 GPU computing
Pycon2014 GPU computingAshwin Ashok
 
Revisiting Co-Processing for Hash Joins on the Coupled Cpu-GPU Architecture
Revisiting Co-Processing for Hash Joins on the CoupledCpu-GPU ArchitectureRevisiting Co-Processing for Hash Joins on the CoupledCpu-GPU Architecture
Revisiting Co-Processing for Hash Joins on the Coupled Cpu-GPU Architecturemohamedragabslideshare
 
Deep Learning on ARM Platforms - SFO17-509
Deep Learning on ARM Platforms - SFO17-509Deep Learning on ARM Platforms - SFO17-509
Deep Learning on ARM Platforms - SFO17-509Linaro
 
The International Journal of Engineering and Science (The IJES)
The International Journal of Engineering and Science (The IJES)The International Journal of Engineering and Science (The IJES)
The International Journal of Engineering and Science (The IJES)theijes
 

Semelhante a GPU Programming with Java (20)

GPGPU programming with CUDA
GPGPU programming with CUDAGPGPU programming with CUDA
GPGPU programming with CUDA
 
GPU - An Introduction
GPU - An IntroductionGPU - An Introduction
GPU - An Introduction
 
Achieving Improved Performance In Multi-threaded Programming With GPU Computing
Achieving Improved Performance In Multi-threaded Programming With GPU ComputingAchieving Improved Performance In Multi-threaded Programming With GPU Computing
Achieving Improved Performance In Multi-threaded Programming With GPU Computing
 
Stream Processing
Stream ProcessingStream Processing
Stream Processing
 
Gpu computing-webgl
Gpu computing-webglGpu computing-webgl
Gpu computing-webgl
 
Cuda
CudaCuda
Cuda
 
Vpu technology &gpgpu computing
Vpu technology &gpgpu computingVpu technology &gpgpu computing
Vpu technology &gpgpu computing
 
Vpu technology &gpgpu computing
Vpu technology &gpgpu computingVpu technology &gpgpu computing
Vpu technology &gpgpu computing
 
Vpu technology &gpgpu computing
Vpu technology &gpgpu computingVpu technology &gpgpu computing
Vpu technology &gpgpu computing
 
gpuprogram_lecture,architecture_designsn
gpuprogram_lecture,architecture_designsngpuprogram_lecture,architecture_designsn
gpuprogram_lecture,architecture_designsn
 
LCU13: GPGPU on ARM Experience Report
LCU13: GPGPU on ARM Experience ReportLCU13: GPGPU on ARM Experience Report
LCU13: GPGPU on ARM Experience Report
 
Vpu technology &gpgpu computing
Vpu technology &gpgpu computingVpu technology &gpgpu computing
Vpu technology &gpgpu computing
 
GPGPU Accelerates PostgreSQL (English)
GPGPU Accelerates PostgreSQL (English)GPGPU Accelerates PostgreSQL (English)
GPGPU Accelerates PostgreSQL (English)
 
A SURVEY ON GPU SYSTEM CONSIDERING ITS PERFORMANCE ON DIFFERENT APPLICATIONS
A SURVEY ON GPU SYSTEM CONSIDERING ITS PERFORMANCE ON DIFFERENT APPLICATIONSA SURVEY ON GPU SYSTEM CONSIDERING ITS PERFORMANCE ON DIFFERENT APPLICATIONS
A SURVEY ON GPU SYSTEM CONSIDERING ITS PERFORMANCE ON DIFFERENT APPLICATIONS
 
CUDA
CUDACUDA
CUDA
 
Pycon2014 GPU computing
Pycon2014 GPU computingPycon2014 GPU computing
Pycon2014 GPU computing
 
Revisiting Co-Processing for Hash Joins on the Coupled Cpu-GPU Architecture
Revisiting Co-Processing for Hash Joins on the CoupledCpu-GPU ArchitectureRevisiting Co-Processing for Hash Joins on the CoupledCpu-GPU Architecture
Revisiting Co-Processing for Hash Joins on the Coupled Cpu-GPU Architecture
 
Cuda
CudaCuda
Cuda
 
Deep Learning on ARM Platforms - SFO17-509
Deep Learning on ARM Platforms - SFO17-509Deep Learning on ARM Platforms - SFO17-509
Deep Learning on ARM Platforms - SFO17-509
 
The International Journal of Engineering and Science (The IJES)
The International Journal of Engineering and Science (The IJES)The International Journal of Engineering and Science (The IJES)
The International Journal of Engineering and Science (The IJES)
 

Mais de Kelum Senanayake

Couchbase - Yet Another Introduction
Couchbase - Yet Another IntroductionCouchbase - Yet Another Introduction
Couchbase - Yet Another IntroductionKelum Senanayake
 
What you need to know about GC
What you need to know about GCWhat you need to know about GC
What you need to know about GCKelum Senanayake
 
A Searchable Symmetric Key Cipher System
A Searchable Symmetric Key Cipher SystemA Searchable Symmetric Key Cipher System
A Searchable Symmetric Key Cipher SystemKelum Senanayake
 
EJB 3.0 - Yet Another Introduction
EJB 3.0 - Yet Another IntroductionEJB 3.0 - Yet Another Introduction
EJB 3.0 - Yet Another IntroductionKelum Senanayake
 
Security Risks & Vulnerabilities in Skype
Security Risks & Vulnerabilities in SkypeSecurity Risks & Vulnerabilities in Skype
Security Risks & Vulnerabilities in SkypeKelum Senanayake
 
The NFS Version 4 Protocol
The NFS Version 4 ProtocolThe NFS Version 4 Protocol
The NFS Version 4 ProtocolKelum Senanayake
 

Mais de Kelum Senanayake (10)

Couchbase - Yet Another Introduction
Couchbase - Yet Another IntroductionCouchbase - Yet Another Introduction
Couchbase - Yet Another Introduction
 
Node.js Introduction
Node.js IntroductionNode.js Introduction
Node.js Introduction
 
What you need to know about GC
What you need to know about GCWhat you need to know about GC
What you need to know about GC
 
A Searchable Symmetric Key Cipher System
A Searchable Symmetric Key Cipher SystemA Searchable Symmetric Key Cipher System
A Searchable Symmetric Key Cipher System
 
Blind Signature Scheme
Blind Signature SchemeBlind Signature Scheme
Blind Signature Scheme
 
EJB 3.0 - Yet Another Introduction
EJB 3.0 - Yet Another IntroductionEJB 3.0 - Yet Another Introduction
EJB 3.0 - Yet Another Introduction
 
Security Risks & Vulnerabilities in Skype
Security Risks & Vulnerabilities in SkypeSecurity Risks & Vulnerabilities in Skype
Security Risks & Vulnerabilities in Skype
 
The NFS Version 4 Protocol
The NFS Version 4 ProtocolThe NFS Version 4 Protocol
The NFS Version 4 Protocol
 
Knight's Tour
Knight's TourKnight's Tour
Knight's Tour
 
How to Share a Secret
How to Share a SecretHow to Share a Secret
How to Share a Secret
 

Último

The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...PsychoTech Services
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 

Último (20)

The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 

GPU Programming with Java

  • 1. GPU programming with Java Pramuditha Aravinda. Kelum Senanayake.
  • 2. Outline  What is GPU.  CPU vs. GPU Architecture.  What is Stream processing.  General Purpose GPU.  CUDA.  OpenCL  Demo
  • 3. What is GPU  Graphics processing unit.  Specialized microprocessor.  Very efficient at manipulating computer graphics.  Offloads and accelerates graphics rendering from the CPU.  Dedicated to calculating floating point operations.  Highly parallel structure.  More effective for a range of complex algorithms.  GPU can be present on,  Video card.  Motherboard  CPU die (certain Core Intel CPUs)
  • 4. CPU vs. GPU Architecture The GPU devotes more transistors to data processing. GPU : A Highly Parallel, Multithreaded, Manycore Processor
  • 5. CPU vs. GPU contd…
  • 6. What is Stream processing  Is a computer programming paradigm, related to SIMD.  Allows applications to easily exploit a limited form of parallel processing.  Terminology  Stream :- A set of data  Kernel functions :- A series of operations  Uniform streaming :- One kernel function is applied to all elements in the stream.  Stream processing is driven by a data-centric model  Image, video and digital signal processing  Less efficient in general purpose processing with more randomized data access (such as databases)
  • 7. General Purpose GPU  The GPU is, by design, a stream processing system.  GPGPU is a programming methodology.  Modifying algorithms to run on existing GPU hardware  Capable of performing simple operations on a stream of input data with amazing speed.  Allows software developers to use stream processing on non-graphics data.
  • 8. How hard is it?  The languages are not very easy to use. Most GPU cards still operate on assembly language.  The process flow is unique. Typically simple branching statement, such as if statements, offer such a performance penalty that it is often faster to process both conditions.  The unique Stream-In-Stream-Out design is not typically used in CPU programs.  The need to work with geometric primitives in order to push mathematical inputs to the system.  Rapidly growing community.
  • 9. Programming GPUs!  Plenty of interfaces  Compute Unified Device Architecture (CUDA)  OpenCL  OpenGL Shader Language (GLSL)  DirectX/DirectCompute/HLSL  ATI Stream
  • 10. CUDA  Compute Unified Device Architecture.  Parallel computing architecture developed by NVIDIA.  Programmers use C for CUDA.  C with NVIDIA extensions and certain restrictions.  Third party wrappers are also available for Python, Perl, Fortran, Java, Ruby, Lua, MATLAB and IDL.  Currently used in,  SETI@Home  Distributed Calculations, such as predicting the native conformation of proteins  Accelerated inter conversion of video file formats  Physical simulations, in particular in fluid dynamics
  • 12. OpenCL  Open Computing Language.  Managed by the non-profit technology consortium Khronos Group  Framework for writing programs that execute across heterogeneous platforms consisting of CPUs, GPUs, and other processors.  Includes a language (based on C99) for writing kernels.  APIs to define and then control the platforms.  Supports both AMD/ATI and NVIDIA.
  • 13. Programming GPU with Java and OpenCL  We need to program using a GPGPU driver  However most GPGPU drivers are available as a native dll only.  We need another layer to interface to Java runtime.  Called Java Binding
  • 14. Java Binding UserProgram.class Jocl.jar Jocl.dll OpenCL.dll
  • 15. Prerequisites - Hardware  OpenCL capable graphic card.  nVidea – All CUDA enabled GPU have OpenCL support.  GeForce 8xxx or higher with 256MB minimum.  http://www.nvidia.com/object/cuda_gpus.html  AMD ATI Radeon™ HD 5400 or higher, AMD Radeon™ HD 6800 series or higher.  AMD X86 CPU w/ SSE 2.x or later are also supported.  http://developer.amd.com/gpu/AMDAPPSDK/pages/DriverCom patibility.aspx
  • 16. Prerequisites - Software  OpenCL driver. – for nVidia GPUs, Usually OpenCL drivers are distributed with graphic card drivers.  http://developer.nvidia.com/object/opencl-download.html  Java bindings for OpenCL. – Usually there are two parts  Platform dependent dll. e.g. jocl-windows-x86.dll  Platform independent jar file. Jocl.jar  There are few Implementations. http://jogamp.org/deployment/webstart/archive/jocl-0.9-b1- 20101213-windows-i586.zip  JDK  http://www.oracle.com/technetwork/java/javase/downloads/ind ex.html
  • 17. Demo Program  Based on sample program available at http://jogamp.org/wiki/index.php/JOCL_Tutorial