SlideShare une entreprise Scribd logo
1  sur  26
Seminar „11                             CUDA

Contents


              1   WHAT IS CUDA ??????

              2   EXECUTION MODEL


              3   IMPLEMENTATION


              4   APPLICATION




3/17/2012                                      2
Seminar „11                                              CUDA


What is CUDA ??????
 CUDA – Compute Unified Device
  Architecture
    Hardware and software architecture

    For computing on the GPU

    Developed by Nvidia in 2007

    GPU

          Do massive amount of task simultaneously and quickly by
              using several ALUs

          ALUs are programmable by Graphics API
3/17/2012                                                            3
Seminar „11                                     CUDA


What is CUDA ??????
 Using CUDA – No need to map GPU towards Graphics APIs

 CUDA provides number crunching very fast

 CUDA is well suited for highly parallel algorithms and
   large datasets

 Consists of heterogeneous programming model and
  software environment
      Hardware and software models
      An Extension of C programming
 Designed to enable heterogeneous computation
      Computation with CPU &GPU
3/17/2012                                                  4
Seminar „11                                        CUDA

  CUDA kernels & threads
 Device = GPU
     Executes parallel portions of an application
      as kernels

 Host = CPU
     Executes serial portions of an application

 Kernel = Functions that runs on device
     One kernel at one time
     Many threads execute each kernel
 Posses host and device memory
 Host and device connected by PCI
  EXPRESS X16
  3/17/2012                                                 5
Seminar „11                                         CUDA

Arrays parallel threads
 A CUDA kernel is executed by an array of threads
      All threads run the same code

      Each thread has ID uses to compute memory addresses




3/17/2012                                                    6
Seminar „11                                          CUDA

Thread batching
 Thread cooperation is valuable
     Share results to avoid redundant computation
     Share memory accesses

 Thread block = Group of threads

     Threads cooperate together using shared memory and
       synchronization

     Thread ID is calculated by

             x+yDx (for 2 dimensional block)

               (x,y) – thread index

               (Dx,Dy) – block size
3/17/2012                                                   7
Seminar „11                                               CUDA

Thread Batching (Contd…)
               (x+yDx+zDxDy) (for 3 dimensional block)

                 (x,y,z) – thread index

                (Dx,Dy,Dz) – block size

 Grid = Group of thread blocks




3/17/2012                                                        8
Seminar „11                                       CUDA

Thread Batching (Contd…)
  There is block ID
      • Calculated as thread ID

  Threads in different blocks cannot cooperate




3/17/2012                                                9
Seminar „11                                              CUDA

Transparent Scalability

 Hardware is free to schedule thread blocks on any
    processor
      A kernel scales across parallel multiprocessors




3/17/2012                                                       10
Seminar „11                                                   CUDA

CUDA architectures

    Architecture’s Codename        G80       GT200            Fermi
          Release Year             2006        2008            2010
      Number of Transistors     681 million 1.4 billion     3.0 billion
   Streaming Multiprocessors
                                    16           30             16
              (SM)
    Streaming Processors (per
                                     8           8              32
               SM)
   Streaming Processors (total)     128         240            512
                                                          Configurable 48
    Shared Memory (per SM)         16 KB      16 KB
                                                           KB or 16 KB
                                                          Configurable 16
         L1 Cache (per SM)         None        None
                                                           KB or 48 KB


3/17/2012                                                                   11
Seminar „11                  CUDA

8 & 10 Series Architecture


                                    G80




                                    GT200



3/17/2012                                 12
Seminar „11              CUDA

Kernel memory access
 Per thread
                Thread



 Per block
              Block

 Per device




3/17/2012                       13
Seminar „11                                           CUDA

Physical Memory Layout
 “Local” memory resides in device DRAM
      Use registers and shared memory to minimize local memory use

 Host can read and write global memory but not shared
    memory




3/17/2012                                                        14
Seminar „11                    CUDA

Execution Model
                   Threads are executed
                    by thread processors



                   Thread blocks are
                    executed by
                    multiprocessors



                   A kernel is launched as
                    a grid of thread blocks


3/17/2012                                  15
Seminar „11                 CUDA

CUDA software development




3/17/2012                          16
Seminar „11                       CUDA

Compiling CUDA code



 CUDA nvcc compiler to
    compile the .cu files which
    divides code into NVidia
    assembly and C++ code.




3/17/2012                                17
Seminar „11                                                 CUDA


    Example
int main(void){
         float *a_h, *b_h;          //host data
         float *a_d, *b_d;          //device data        Host      Device
         int N = 15, nBytes, i;
         nBytes = N*sizeof(float);                       a_h           a_d
         a_h = (float*)malloc(nBytes);
         b_h = (float*)malloc(nBytes);
                                                         b_h           b_d
         cudaMalloc((void**)&a_d,nBytes);
         cudaMalloc((void**)&b_d,nBytes);
         for(i=0; i<N; i++) a_h[i]=100.f +i;
         cudaMemcpy(a_d, a_h, nBytes, cudaMemcpyHostToDevice);
         cudaMemcpy(b_d, a_d, nBytes, cudaMemcpyDeviceToDevice);
         cudaMemcpy(b_h, b_d, nByyes, cudaMemcpyDeviceToHost);
         for(i=0; i<N; i++) assert(a_h[i] == b_h[i]);
         free(a_h); free(b_h); cudaFree(a_d); cudaFree(b_d);
         return 0;}
    3/17/2012                                                                18
Seminar „11                                  CUDA

 Applications



Finance                Numeric         Medical




               Oil & Gas       Biophysics




Audio                      Video            Imaging
 3/17/2012                                            19
Seminar „11                                    CUDA

Advantages

 Provides shared memory

 Cost effective

 The gaming industries demand on Graphics cards has
    forced a lot of research and money into the improvement
    of the GPUs

 Transparent Scalability



3/17/2012                                                 20
Seminar „11                                  CUDA

Drawbacks


 Despite having hundreds of “cores” CUDA is not as
    flexible as CPU‟s

 Not as effective for personal computers




3/17/2012                                             21
Seminar „11                                  CUDA

Future Scope


 Implementation of CUDA in several other group of
    companies‟ GPUs.

 More and more streaming processors can be included

 CUDA in wide variety of programming languages.




3/17/2012                                              22
Seminar „11                                        CUDA

Conclusion

 Brought significant innovations to the High Performance
    Computing world.

 CUDA simplified process of development of general
    purpose parallel applications.

 These applications have now enough computational
    power to get proper results in a short time.



3/17/2012                                                 23
Seminar „11                                                       CUDA

  References
1. “CUDA by Example: An Introduction to General-Purpose GPU
    Programming” by Edward kandrot
2. “Programming Massively Parallel Processors: A Hands-on Approach
    (Applications of GPU Computing Series)” By David B kirk & Wen Mei W.
    Hwu.
3. “GPU Computing Gems Emerald Edition (Applications of GPU Computing
    Series)” By Wen-mei W. Hwu .
4. “The Cost To Play: CUDA Programming” , By Douglas Eadline, Ph.D. ,on
    Linux Magazine Wednesday, February 17th, 2010
5. “Nvidia Announces CUDA x86” Written by Cristian, On Tech Connect
    Magazine 21 September 2010
6. CUDA Programming Guide. ver. 1.1,
    http://www.nvidia.com/object/cuda_develop.html
7. TESLA GPU Computing Technical Brief,
    http://www.nvidia.com/object/tesla_product_literature.html
8. G80 architecture reviews and specification,
    http://www.nvidia.com/page/8800_reviews.html,
    http://www.nvidia.com/page/8800_tech_specs.html
9. Beyond3D G80: Architecture and GPU Analysis,
    http://www.beyond3d.com/content/reviews/1
10. Graphics adapters supporting CUDA,
    http://www.nvidia.com/object/cuda_learn_products.html
  3/17/2012                                                                24
Seminar „11                    CUDA


              Questions?????




3/17/2012                             26

Contenu connexe

Tendances (20)

Introduction to OpenCL
Introduction to OpenCLIntroduction to OpenCL
Introduction to OpenCL
 
Introduction to GPU Programming
Introduction to GPU ProgrammingIntroduction to GPU Programming
Introduction to GPU Programming
 
GPU - Basic Working
GPU - Basic WorkingGPU - Basic Working
GPU - Basic Working
 
GPU: Understanding CUDA
GPU: Understanding CUDAGPU: Understanding CUDA
GPU: Understanding CUDA
 
It's Time to ROCm!
It's Time to ROCm!It's Time to ROCm!
It's Time to ROCm!
 
Introduction to parallel computing using CUDA
Introduction to parallel computing using CUDAIntroduction to parallel computing using CUDA
Introduction to parallel computing using CUDA
 
OpenCL Programming 101
OpenCL Programming 101OpenCL Programming 101
OpenCL Programming 101
 
Embedded Linux - Building toolchain
Embedded Linux - Building toolchainEmbedded Linux - Building toolchain
Embedded Linux - Building toolchain
 
Gpu
GpuGpu
Gpu
 
Linux kernel modules
Linux kernel modulesLinux kernel modules
Linux kernel modules
 
Kernel Configuration and Compilation
Kernel Configuration and CompilationKernel Configuration and Compilation
Kernel Configuration and Compilation
 
Windows internals
Windows internalsWindows internals
Windows internals
 
Os Threads
Os ThreadsOs Threads
Os Threads
 
Presentation on graphics processing unit (GPU)
Presentation on graphics processing unit (GPU)Presentation on graphics processing unit (GPU)
Presentation on graphics processing unit (GPU)
 
GPU Programming
GPU ProgrammingGPU Programming
GPU Programming
 
Introduction to char device driver
Introduction to char device driverIntroduction to char device driver
Introduction to char device driver
 
CPU vs GPU Comparison
CPU  vs GPU ComparisonCPU  vs GPU Comparison
CPU vs GPU Comparison
 
Linux scheduler
Linux schedulerLinux scheduler
Linux scheduler
 
Multithreading
MultithreadingMultithreading
Multithreading
 
Linux Performance Analysis and Tools
Linux Performance Analysis and ToolsLinux Performance Analysis and Tools
Linux Performance Analysis and Tools
 

Similaire à Cuda

S0333 gtc2012-gmac-programming-cuda
S0333 gtc2012-gmac-programming-cudaS0333 gtc2012-gmac-programming-cuda
S0333 gtc2012-gmac-programming-cudamistercteam
 
An Introduction to CUDA-OpenCL - University.pptx
An Introduction to CUDA-OpenCL - University.pptxAn Introduction to CUDA-OpenCL - University.pptx
An Introduction to CUDA-OpenCL - University.pptxAnirudhGarg35
 
lecture11_GPUArchCUDA01.pptx
lecture11_GPUArchCUDA01.pptxlecture11_GPUArchCUDA01.pptx
lecture11_GPUArchCUDA01.pptxssuser413a98
 
Nvidia cuda tutorial_no_nda_apr08
Nvidia cuda tutorial_no_nda_apr08Nvidia cuda tutorial_no_nda_apr08
Nvidia cuda tutorial_no_nda_apr08Angela Mendoza M.
 
NVidia CUDA Tutorial - June 15, 2009
NVidia CUDA Tutorial - June 15, 2009NVidia CUDA Tutorial - June 15, 2009
NVidia CUDA Tutorial - June 15, 2009Randall Hand
 
A beginner’s guide to programming GPUs with CUDA
A beginner’s guide to programming GPUs with CUDAA beginner’s guide to programming GPUs with CUDA
A beginner’s guide to programming GPUs with CUDAPiyush Mittal
 
Newbie’s guide to_the_gpgpu_universe
Newbie’s guide to_the_gpgpu_universeNewbie’s guide to_the_gpgpu_universe
Newbie’s guide to_the_gpgpu_universeOfer Rosenberg
 
Intro to GPGPU with CUDA (DevLink)
Intro to GPGPU with CUDA (DevLink)Intro to GPGPU with CUDA (DevLink)
Intro to GPGPU with CUDA (DevLink)Rob Gillen
 
Computing using GPUs
Computing using GPUsComputing using GPUs
Computing using GPUsShree Kumar
 
Multi-faceted Microarchitecture Level Reliability Characterization for NVIDIA...
Multi-faceted Microarchitecture Level Reliability Characterization for NVIDIA...Multi-faceted Microarchitecture Level Reliability Characterization for NVIDIA...
Multi-faceted Microarchitecture Level Reliability Characterization for NVIDIA...Stefano Di Carlo
 
GlusterFS CTDB Integration
GlusterFS CTDB IntegrationGlusterFS CTDB Integration
GlusterFS CTDB IntegrationEtsuji Nakai
 
Utilizing AMD GPUs: Tuning, programming models, and roadmap
Utilizing AMD GPUs: Tuning, programming models, and roadmapUtilizing AMD GPUs: Tuning, programming models, and roadmap
Utilizing AMD GPUs: Tuning, programming models, and roadmapGeorge Markomanolis
 
Cuda introduction
Cuda introductionCuda introduction
Cuda introductionHanibei
 
Cloud, Distributed, Embedded: Erlang in the Heterogeneous Computing World
Cloud, Distributed, Embedded: Erlang in the Heterogeneous Computing WorldCloud, Distributed, Embedded: Erlang in the Heterogeneous Computing World
Cloud, Distributed, Embedded: Erlang in the Heterogeneous Computing WorldOmer Kilic
 
Vpu technology &gpgpu computing
Vpu technology &gpgpu computingVpu technology &gpgpu computing
Vpu technology &gpgpu computingArka Ghosh
 

Similaire à Cuda (20)

Tech Talk NVIDIA CUDA
Tech Talk NVIDIA CUDATech Talk NVIDIA CUDA
Tech Talk NVIDIA CUDA
 
S0333 gtc2012-gmac-programming-cuda
S0333 gtc2012-gmac-programming-cudaS0333 gtc2012-gmac-programming-cuda
S0333 gtc2012-gmac-programming-cuda
 
An Introduction to CUDA-OpenCL - University.pptx
An Introduction to CUDA-OpenCL - University.pptxAn Introduction to CUDA-OpenCL - University.pptx
An Introduction to CUDA-OpenCL - University.pptx
 
lecture11_GPUArchCUDA01.pptx
lecture11_GPUArchCUDA01.pptxlecture11_GPUArchCUDA01.pptx
lecture11_GPUArchCUDA01.pptx
 
Nvidia cuda tutorial_no_nda_apr08
Nvidia cuda tutorial_no_nda_apr08Nvidia cuda tutorial_no_nda_apr08
Nvidia cuda tutorial_no_nda_apr08
 
GPU Ecosystem
GPU EcosystemGPU Ecosystem
GPU Ecosystem
 
NVidia CUDA Tutorial - June 15, 2009
NVidia CUDA Tutorial - June 15, 2009NVidia CUDA Tutorial - June 15, 2009
NVidia CUDA Tutorial - June 15, 2009
 
A beginner’s guide to programming GPUs with CUDA
A beginner’s guide to programming GPUs with CUDAA beginner’s guide to programming GPUs with CUDA
A beginner’s guide to programming GPUs with CUDA
 
Hpc4
Hpc4Hpc4
Hpc4
 
Newbie’s guide to_the_gpgpu_universe
Newbie’s guide to_the_gpgpu_universeNewbie’s guide to_the_gpgpu_universe
Newbie’s guide to_the_gpgpu_universe
 
Intro to GPGPU with CUDA (DevLink)
Intro to GPGPU with CUDA (DevLink)Intro to GPGPU with CUDA (DevLink)
Intro to GPGPU with CUDA (DevLink)
 
Lec04 gpu architecture
Lec04 gpu architectureLec04 gpu architecture
Lec04 gpu architecture
 
Computing using GPUs
Computing using GPUsComputing using GPUs
Computing using GPUs
 
GPU Programming with Java
GPU Programming with JavaGPU Programming with Java
GPU Programming with Java
 
Multi-faceted Microarchitecture Level Reliability Characterization for NVIDIA...
Multi-faceted Microarchitecture Level Reliability Characterization for NVIDIA...Multi-faceted Microarchitecture Level Reliability Characterization for NVIDIA...
Multi-faceted Microarchitecture Level Reliability Characterization for NVIDIA...
 
GlusterFS CTDB Integration
GlusterFS CTDB IntegrationGlusterFS CTDB Integration
GlusterFS CTDB Integration
 
Utilizing AMD GPUs: Tuning, programming models, and roadmap
Utilizing AMD GPUs: Tuning, programming models, and roadmapUtilizing AMD GPUs: Tuning, programming models, and roadmap
Utilizing AMD GPUs: Tuning, programming models, and roadmap
 
Cuda introduction
Cuda introductionCuda introduction
Cuda introduction
 
Cloud, Distributed, Embedded: Erlang in the Heterogeneous Computing World
Cloud, Distributed, Embedded: Erlang in the Heterogeneous Computing WorldCloud, Distributed, Embedded: Erlang in the Heterogeneous Computing World
Cloud, Distributed, Embedded: Erlang in the Heterogeneous Computing World
 
Vpu technology &gpgpu computing
Vpu technology &gpgpu computingVpu technology &gpgpu computing
Vpu technology &gpgpu computing
 

Dernier

ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomnelietumpap1
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptxSherlyMaeNeri
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 

Dernier (20)

ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choom
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptx
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 

Cuda

  • 1.
  • 2. Seminar „11 CUDA Contents 1 WHAT IS CUDA ?????? 2 EXECUTION MODEL 3 IMPLEMENTATION 4 APPLICATION 3/17/2012 2
  • 3. Seminar „11 CUDA What is CUDA ??????  CUDA – Compute Unified Device Architecture  Hardware and software architecture  For computing on the GPU  Developed by Nvidia in 2007  GPU  Do massive amount of task simultaneously and quickly by using several ALUs  ALUs are programmable by Graphics API 3/17/2012 3
  • 4. Seminar „11 CUDA What is CUDA ??????  Using CUDA – No need to map GPU towards Graphics APIs  CUDA provides number crunching very fast  CUDA is well suited for highly parallel algorithms and large datasets  Consists of heterogeneous programming model and software environment  Hardware and software models  An Extension of C programming  Designed to enable heterogeneous computation  Computation with CPU &GPU 3/17/2012 4
  • 5. Seminar „11 CUDA CUDA kernels & threads  Device = GPU  Executes parallel portions of an application as kernels  Host = CPU  Executes serial portions of an application  Kernel = Functions that runs on device  One kernel at one time  Many threads execute each kernel  Posses host and device memory  Host and device connected by PCI EXPRESS X16 3/17/2012 5
  • 6. Seminar „11 CUDA Arrays parallel threads  A CUDA kernel is executed by an array of threads  All threads run the same code  Each thread has ID uses to compute memory addresses 3/17/2012 6
  • 7. Seminar „11 CUDA Thread batching  Thread cooperation is valuable  Share results to avoid redundant computation  Share memory accesses  Thread block = Group of threads  Threads cooperate together using shared memory and synchronization  Thread ID is calculated by  x+yDx (for 2 dimensional block) (x,y) – thread index (Dx,Dy) – block size 3/17/2012 7
  • 8. Seminar „11 CUDA Thread Batching (Contd…)  (x+yDx+zDxDy) (for 3 dimensional block) (x,y,z) – thread index (Dx,Dy,Dz) – block size  Grid = Group of thread blocks 3/17/2012 8
  • 9. Seminar „11 CUDA Thread Batching (Contd…)  There is block ID • Calculated as thread ID  Threads in different blocks cannot cooperate 3/17/2012 9
  • 10. Seminar „11 CUDA Transparent Scalability  Hardware is free to schedule thread blocks on any processor  A kernel scales across parallel multiprocessors 3/17/2012 10
  • 11. Seminar „11 CUDA CUDA architectures Architecture’s Codename G80 GT200 Fermi Release Year 2006 2008 2010 Number of Transistors 681 million 1.4 billion 3.0 billion Streaming Multiprocessors 16 30 16 (SM) Streaming Processors (per 8 8 32 SM) Streaming Processors (total) 128 240 512 Configurable 48 Shared Memory (per SM) 16 KB 16 KB KB or 16 KB Configurable 16 L1 Cache (per SM) None None KB or 48 KB 3/17/2012 11
  • 12. Seminar „11 CUDA 8 & 10 Series Architecture G80 GT200 3/17/2012 12
  • 13. Seminar „11 CUDA Kernel memory access  Per thread Thread  Per block Block  Per device 3/17/2012 13
  • 14. Seminar „11 CUDA Physical Memory Layout  “Local” memory resides in device DRAM  Use registers and shared memory to minimize local memory use  Host can read and write global memory but not shared memory 3/17/2012 14
  • 15. Seminar „11 CUDA Execution Model  Threads are executed by thread processors  Thread blocks are executed by multiprocessors  A kernel is launched as a grid of thread blocks 3/17/2012 15
  • 16. Seminar „11 CUDA CUDA software development 3/17/2012 16
  • 17. Seminar „11 CUDA Compiling CUDA code  CUDA nvcc compiler to compile the .cu files which divides code into NVidia assembly and C++ code. 3/17/2012 17
  • 18. Seminar „11 CUDA Example int main(void){ float *a_h, *b_h; //host data float *a_d, *b_d; //device data Host Device int N = 15, nBytes, i; nBytes = N*sizeof(float); a_h a_d a_h = (float*)malloc(nBytes); b_h = (float*)malloc(nBytes); b_h b_d cudaMalloc((void**)&a_d,nBytes); cudaMalloc((void**)&b_d,nBytes); for(i=0; i<N; i++) a_h[i]=100.f +i; cudaMemcpy(a_d, a_h, nBytes, cudaMemcpyHostToDevice); cudaMemcpy(b_d, a_d, nBytes, cudaMemcpyDeviceToDevice); cudaMemcpy(b_h, b_d, nByyes, cudaMemcpyDeviceToHost); for(i=0; i<N; i++) assert(a_h[i] == b_h[i]); free(a_h); free(b_h); cudaFree(a_d); cudaFree(b_d); return 0;} 3/17/2012 18
  • 19. Seminar „11 CUDA Applications Finance Numeric Medical Oil & Gas Biophysics Audio Video Imaging 3/17/2012 19
  • 20. Seminar „11 CUDA Advantages  Provides shared memory  Cost effective  The gaming industries demand on Graphics cards has forced a lot of research and money into the improvement of the GPUs  Transparent Scalability 3/17/2012 20
  • 21. Seminar „11 CUDA Drawbacks  Despite having hundreds of “cores” CUDA is not as flexible as CPU‟s  Not as effective for personal computers 3/17/2012 21
  • 22. Seminar „11 CUDA Future Scope  Implementation of CUDA in several other group of companies‟ GPUs.  More and more streaming processors can be included  CUDA in wide variety of programming languages. 3/17/2012 22
  • 23. Seminar „11 CUDA Conclusion  Brought significant innovations to the High Performance Computing world.  CUDA simplified process of development of general purpose parallel applications.  These applications have now enough computational power to get proper results in a short time. 3/17/2012 23
  • 24. Seminar „11 CUDA References 1. “CUDA by Example: An Introduction to General-Purpose GPU Programming” by Edward kandrot 2. “Programming Massively Parallel Processors: A Hands-on Approach (Applications of GPU Computing Series)” By David B kirk & Wen Mei W. Hwu. 3. “GPU Computing Gems Emerald Edition (Applications of GPU Computing Series)” By Wen-mei W. Hwu . 4. “The Cost To Play: CUDA Programming” , By Douglas Eadline, Ph.D. ,on Linux Magazine Wednesday, February 17th, 2010 5. “Nvidia Announces CUDA x86” Written by Cristian, On Tech Connect Magazine 21 September 2010 6. CUDA Programming Guide. ver. 1.1, http://www.nvidia.com/object/cuda_develop.html 7. TESLA GPU Computing Technical Brief, http://www.nvidia.com/object/tesla_product_literature.html 8. G80 architecture reviews and specification, http://www.nvidia.com/page/8800_reviews.html, http://www.nvidia.com/page/8800_tech_specs.html 9. Beyond3D G80: Architecture and GPU Analysis, http://www.beyond3d.com/content/reviews/1 10. Graphics adapters supporting CUDA, http://www.nvidia.com/object/cuda_learn_products.html 3/17/2012 24
  • 25.
  • 26. Seminar „11 CUDA Questions????? 3/17/2012 26

Notes de l'éditeur

  1. Host code