SlideShare a Scribd company logo
1 of 43
Download to read offline
Introduction      Generative Programming                NT2   Quaff         Conclusion




                  Generative and Meta-Programming
               Modern C++ Design for Parallel Computing

                                       Joel Falcou
                                           05/02/2011
                               LRI, University Paris Sud XI




                                                                      LSU Seminar
                                                                                    1 / 23
Introduction           Generative Programming    NT2   Quaff         Conclusion


                                           Context
       In Scientiļ¬c Computing ...
               there is Scientiļ¬c




                                                               LSU Seminar
                                                                             2 / 23
Introduction           Generative Programming        NT2   Quaff         Conclusion


                                           Context
       In Scientiļ¬c Computing ...
               there is Scientiļ¬c
                    Applications are domain driven
                    Users = Developers
                    Users are reluctant to changes




                                                                   LSU Seminar
                                                                                 2 / 23
Introduction           Generative Programming        NT2   Quaff         Conclusion


                                           Context
       In Scientiļ¬c Computing ...
               there is Scientiļ¬c
                    Applications are domain driven
                    Users = Developers
                    Users are reluctant to changes
               there is Computing




                                                                   LSU Seminar
                                                                                 2 / 23
Introduction           Generative Programming        NT2             Quaff         Conclusion


                                           Context
       In Scientiļ¬c Computing ...
               there is Scientiļ¬c
                    Applications are domain driven
                    Users = Developers
                    Users are reluctant to changes
               there is Computing
                    Computing requires performance ...
                    ... which implies architectures speciļ¬c tuning
                    ... which requires expertise
                    ... which may or may not be available




                                                                             LSU Seminar
                                                                                           2 / 23
Introduction           Generative Programming        NT2             Quaff         Conclusion


                                           Context
       In Scientiļ¬c Computing ...
               there is Scientiļ¬c
                    Applications are domain driven
                    Users = Developers
                    Users are reluctant to changes
               there is Computing
                    Computing requires performance ...
                    ... which implies architectures speciļ¬c tuning
                    ... which requires expertise
                    ... which may or may not be available

       The Problem
       People using computers to do science want to do science ļ¬rst.


                                                                             LSU Seminar
                                                                                           2 / 23
Introduction             Generative Programming            NT2              Quaff            Conclusion


        The Problem ā€“ and how we want to solve it

       The Facts
               The ā€Library to bind them allā€ doesnā€™t exist (or we should have it already )
               All those users want to take advantage of new architectures
               Few of them want to actually handle all the dirty work

       The Ends
               Provide a ā€familiarā€ interface that let users beneļ¬t from parallelism
               Helps compilers to generate better parallel code
               Increase sustainability by decreasing amount of code to write

       The Means
               Generative Programming
               Template Meta-Programming
               Embedded Domain Speciļ¬c Languages




                                                                                       LSU Seminar
                                                                                                     3 / 23
Introduction       Generative Programming   NT2   Quaff         Conclusion


                                   Talk Layout


       1   Introduction

       2   Generative Programming

       3   NT2

       4   Quaff

       5   Conclusion




                                                          LSU Seminar
                                                                        4 / 23
Introduction      Generative Programming                    NT2              Quaff             Conclusion


                     Generative Programming


                  Domain Speciļ¬c         Generative Component     Concrete Application
               Application Description



                                             Translator



                                             Parametric
                                           Sub-components




                                                                                         LSU Seminar
                                                                                                       5 / 23
Introduction          Generative Programming   NT2     Quaff         Conclusion


                 Generative Programming as a Tool


       Available techniques
               Dedicated compilers
               External pre-processing tools
               Languages supporting meta-programming




                                                               LSU Seminar
                                                                             6 / 23
Introduction          Generative Programming   NT2     Quaff         Conclusion


                 Generative Programming as a Tool


       Available techniques
               Dedicated compilers
               External pre-processing tools
               Languages supporting meta-programming




                                                               LSU Seminar
                                                                             6 / 23
Introduction          Generative Programming   NT2     Quaff         Conclusion


                 Generative Programming as a Tool


       Available techniques
               Dedicated compilers
               External pre-processing tools
               Languages supporting meta-programming
       Deļ¬nition of Meta-programming
       Meta-programming is the writing of computer programs that
       analyse, transform and generate other programs (or them-
       selves) as their data.




                                                               LSU Seminar
                                                                             6 / 23
Introduction         Generative Programming   NT2   Quaff         Conclusion


               From Generative to Meta-programming


       Meta-programmable languages
               template H ASKELL
               metaOcaml
               C++




                                                            LSU Seminar
                                                                          7 / 23
Introduction         Generative Programming   NT2   Quaff         Conclusion


               From Generative to Meta-programming


       Meta-programmable languages
               template H ASKELL
               metaOcaml
               C++




                                                            LSU Seminar
                                                                          7 / 23
Introduction          Generative Programming    NT2         Quaff           Conclusion


               From Generative to Meta-programming


       Meta-programmable languages
               template H ASKELL
               metaOcaml
               C++
       C++ meta-programming
               Relies on the C++ template sub-language
               Handles types and integral constants at compile-time
               Proved to be Turing-complete




                                                                      LSU Seminar
                                                                                    7 / 23
Introduction            Generative Programming        NT2             Quaff         Conclusion


               Embedded Domain Speciļ¬c Languages

       Whatā€™s an EDSL ?
               DSL = Domain Speciļ¬c Language
               Declarative language, easy-to-use, ļ¬tting the domain
               EDSL = DSL within a general purpose language

       EDSL in C++
               Relies on operator overload abuse (Expression Templates)
               Carry semantic information around code fragment
               Generic implementation become self-aware of optimizations

       Exploiting static AST
               At the expression level: code generation
               At the function level: inter-procedural optimization



                                                                              LSU Seminar
                                                                                            8 / 23
Introduction         Generative Programming      NT2                 Quaff             Conclusion


                          Expression Templates

               matrix x(h,w),a(h,w),b(h,w);            =
               x = cos(a) + (b*a);
                                                  x          +
               expr<assign
                   ,expr<matrix&>
                   ,expr<plus                          cos            *
                        , expr<cos
                              ,expr<matrix&>
                              >
                                                       a         b           a
                        , expr<multiplies
                              ,expr<matrix&>
                              ,expr<matrix&>
                              >                #pragma omp parallel for
                        >(x,a,b);              for(int j=0;j<h;++j)
                                               {
                                                 for(int i=0;i<w;++i)
                                                 {
               Arbitrary Transforms applied
                                                   x(j,i) = cos(a(j,i))
                     on the meta-AST
                                                          + ( b(j,i)
                                                             * a(j,i)
                                                          );
                                                 }
                                               }




                                                                                 LSU Seminar
                                                                                               9 / 23
Introduction            Generative Programming       NT2            Quaff         Conclusion


                                     What is NT 2 ?


       A Scientiļ¬c Computing Library
               Provide a simple, M ATLAB-like interface for users
               Provide high-performance computing entities and primitives
               Easily extendable




                                                                            LSU Seminar
                                                                                          10 / 23
Introduction            Generative Programming       NT2            Quaff         Conclusion


                                     What is NT 2 ?


       A Scientiļ¬c Computing Library
               Provide a simple, M ATLAB-like interface for users
               Provide high-performance computing entities and primitives
               Easily extendable

       Principles
               Take a .m ļ¬le, copy to a .cpp ļ¬le




                                                                            LSU Seminar
                                                                                          10 / 23
Introduction            Generative Programming       NT2            Quaff         Conclusion


                                     What is NT 2 ?


       A Scientiļ¬c Computing Library
               Provide a simple, M ATLAB-like interface for users
               Provide high-performance computing entities and primitives
               Easily extendable

       Principles
               Take a .m ļ¬le, copy to a .cpp ļ¬le
               Add #include <nt2/nt2.hpp> and do cosmetic changes




                                                                            LSU Seminar
                                                                                          10 / 23
Introduction            Generative Programming       NT2            Quaff         Conclusion


                                     What is NT 2 ?


       A Scientiļ¬c Computing Library
               Provide a simple, M ATLAB-like interface for users
               Provide high-performance computing entities and primitives
               Easily extendable

       Principles
               Take a .m ļ¬le, copy to a .cpp ļ¬le
               Add #include <nt2/nt2.hpp> and do cosmetic changes
               Compile the ļ¬le and link with libnt2.a




                                                                            LSU Seminar
                                                                                          10 / 23
Introduction      Generative Programming   NT2        Quaff         Conclusion


                          M ATLAB you said ?



      R = I(:,:,1);
      G = I(:,:,2);
      B = I(:,:,3);

      Y = min(abs(0.299.*R+0.587.*G+0.114.*B),235);
      U = min(abs(-0.169.*R-0.331.*G+0.5.*B),240);
      V = min(abs(0.5.*R-0.419.*G-0.081.*B),240);




                                                              LSU Seminar
                                                                            11 / 23
Introduction      Generative Programming   NT2     Quaff         Conclusion


                                Now with NT 2



      table<double>   R = I(_,_,1);
      table<double>   G = I(_,_,2);
      table<double>   B = I(_,_,3);
      table<double>   Y, U, V;

      Y = min(abs(0.299*R+0.587*G+0.114*B),235);
      U = min(abs(-0.169*R-0.331*G+0.5*B),240);
      V = min(abs(0.5*R-0.419*G-0.081*B),240);




                                                           LSU Seminar
                                                                         12 / 23
Introduction      Generative Programming   NT2        Quaff         Conclusion


                                Now with NT 2



      table<float,settings(shallow,of_size_<640,480>)> R = I(_,_,1);
      table<float,settings(shallow,of_size_<640,480>)> G = I(_,_,2);
      table<float,settings(shallow,of_size_<640,480>)> B = I(_,_,3);
      table<float,settings(of_size_<640,480>)> Y, U, V;

      Y = min(abs(0.299*R+0.587*G+0.114*B),235),
      U = min(abs(-0.169*R-0.331*G+0.5*B),240),
      V = min(abs(0.5*R-0.419*G-0.081*B),240);




                                                              LSU Seminar
                                                                            12 / 23
Introduction           Generative Programming        NT2            Quaff            Conclusion


                              Some Performances

       RGB2YUV timing (in cycles/pixels)

           Size                         128x128   256x256   512x512     1024x1024
           M ATLAB 2010a (2 cores)         85        89        97          102
           C (1 core)                     23.6      23.8      23.9         24.0
           NT2 (1 core)                   22.3      22.4      22.2         24.1
           NT2 OpenMP (2 cores)           11.4      11.4      11.5         12.2
           NT2 SIMD                       5.5        5.6       5.6         5.9
           NT2 SIMD+OpenMP                2.9        2.9       2.9         3.0
           NT2 SIMD speed-up              3.9       3.9       3.9           4.0
           NT2 OpenMP speed-up            1.92     1.96      1.98           1.95
           NT2 vs M ATLAB speed-up        29.3     30.7      33.5            34




                                                                               LSU Seminar
                                                                                             13 / 23
Introduction   Generative Programming   NT2   Quaff         Conclusion


               Some real life applications




                                                      LSU Seminar
                                                                    14 / 23
Introduction            Generative Programming        NT2       Quaff             Conclusion


                    Parallel Skeletons in a nutshell


       Basic Principles [COLE 89]
               There are patterns in parallel applications
               Those patterns can be generalized in Skeletons
               Applications are assembled as combination of such patterns




                                                                            LSU Seminar
                                                                                          15 / 23
Introduction            Generative Programming        NT2        Quaff            Conclusion


                    Parallel Skeletons in a nutshell


       Basic Principles [COLE 89]
               There are patterns in parallel applications
               Those patterns can be generalized in Skeletons
               Applications are assembled as combination of such patterns

       Functionnal point of view
               Skeletons are Higher-Order Functions
               Skeletons support a compositionnal semantic
               Applications become composition of state-less functions




                                                                            LSU Seminar
                                                                                          15 / 23
Introduction             Generative Programming                 NT2                 Quaff              Conclusion


               Spotting skeletons when you see one


               Pipeline
                              Farm
                                                  Processus 3


                                                     F2
                Processus 1     Processus 2       Processus 4         Processus 6      Processus 7


                   F1           Distrib.             F2               Collect.              F3

                                                  Processus 5


                                                     F2




                                                                                                 LSU Seminar
                                                                                                               16 / 23
Introduction           Generative Programming      NT2       Quaff         Conclusion


                                        Objectives




       Proposing a C++ skeletons library
               Limit runtime overhead
               Use the formal model skeleton as guidelines




                                                                     LSU Seminar
                                                                                   17 / 23
Introduction           Generative Programming      NT2       Quaff         Conclusion


                                        Objectives



       Proposing a C++ skeletons library
               Limit runtime overhead
               Use the formal model skeleton as guidelines

       What we want to write
       run( pipeline( seq(F1), seq(F2), seq(F3) ) )




                                                                     LSU Seminar
                                                                                   17 / 23
Introduction           Generative Programming         NT2      Quaff         Conclusion


                                        Objectives

       Proposing a C++ skeletons library
               Limit runtime overhead
               Use the formal model skeleton as guidelines

       What we want to run
       if( rank == 0 )
         do { out = F1();
              MPI_Send(&out,1,MPI_INT,1,0,MPI_COMM_WORLD);
            } while( isValid(out) );

       if( rank == 1 )
         do { MPI_Recv(&in,1,MPI_INT,0,0,MPI_COMM_WORLD,&s);
              out = F2(in);
              MPI_Send(&in,1,MPI_INT,2,0,MPI_COMM_WORLD);
            } while ( isValid(out) )

       if( rank == 2 )
         do { MPI_Recv(&in,1,MPI_INT,1,0,MPI_COMM_WORLD,&s);
              F2(in);
            } while ( isValid(in) )




                                                                       LSU Seminar
                                                                                     17 / 23
Introduction                Generative Programming                       NT2                              Quaff                 Conclusion


                                        Design Rationale


       Code generation process
                Generating the skeleton tree at compile-time
                Turning this tree into a process network using MPL
                Producing the C + MPI target code using Fusion

                                       PIPE
                     GĆ©nĆ©ration                     Production                   Ļ†   2
                                                                                                           GƩnƩration
                       AST                           du RPSC             Ļ†   2           Ļ†   2           de code C+MPI
                                                                                                                           C
               C++
                                  Ļ†1   FARM3   Ļ†3                                                                         MPI
                                                                 Ļ†   1           f               Ļ†   3




                                        Ļ†2




                                                                                                                         LSU Seminar
                                                                                                                                       18 / 23
Introduction   Generative Programming           NT2           Quaff           Conclusion


                      Quaff over the CELL


                                  The OCELLE project
                                        IEF/CEA/TRT
                                        Tools for heterog. proc.
                                        MPI and skeleton for the Cell


                                  Developing for the CELL
                                  How to ļ¬nd a good mapping for an application ?




                                                                        LSU Seminar
                                                                                      19 / 23
Introduction       Generative Programming                  NT2                Quaff             Conclusion


                        Harris Corner Detector




                                   Mul      Ixx=Ix*Ix   Gauss    Sxx

                    Grad X   Ix
                                                                         coarsity
               I                   Mul      Ixy=Ix*Iy   Gauss    Sxy   Sxx*Syy-SxyĀ²
                                                                                      K

                    Grad Y   Iy

                                   Mul      Iyy=Iy*Iy   Gauss    Syy




                                                                                          LSU Seminar
                                                                                                        20 / 23
Introduction           Generative Programming                  NT2                Quaff             Conclusion


                            Harris Corner Detector


                                       Mul      Ixx=Ix*Ix   Gauss    Sxx

                        Grad X   Ix
                                                                             coarsity
                   I                   Mul      Ixy=Ix*Iy   Gauss    Sxy   Sxx*Syy-SxyĀ²
                                                                                          K

                        Grad Y   Iy

                                       Mul      Iyy=Iy*Iy   Gauss    Syy




       Skeleton Code and Benchmarks
       void full_chain_harris(tile const&,tile&)
       {
        run( pardo<8>((seq(grad),seq(mul),seq(gauss),seq(coarsity)));
       }




                                                                                              LSU Seminar
                                                                                                            20 / 23
Introduction           Generative Programming                  NT2                Quaff             Conclusion


                            Harris Corner Detector


                                       Mul      Ixx=Ix*Ix   Gauss    Sxx

                        Grad X   Ix
                                                                             coarsity
                   I                   Mul      Ixy=Ix*Iy   Gauss    Sxy   Sxx*Syy-SxyĀ²
                                                                                          K

                        Grad Y   Iy

                                       Mul      Iyy=Iy*Iy   Gauss    Syy




       Skeleton Code and Benchmarks
       void half_chain_harris(tile const&,tile&)
       {
        run( pardo<4>((seq(grad),seq(mul)) | (seq(gauss),seq(coarsity)));
       }




                                                                                              LSU Seminar
                                                                                                            20 / 23
Introduction           Generative Programming                  NT2                Quaff             Conclusion


                            Harris Corner Detector



                                       Mul      Ixx=Ix*Ix   Gauss    Sxx

                        Grad X   Ix
                                                                             coarsity
                   I                   Mul      Ixy=Ix*Iy   Gauss    Sxy   Sxx*Syy-SxyĀ²
                                                                                          K

                        Grad Y   Iy

                                       Mul      Iyy=Iy*Iy   Gauss    Syy




       Skeleton Code and Benchmarks
       void no_chain_harris(tile const&,tile&)
       {
        run( pardo<2>( seq(grad) | seq(mul) | seq(gauss) | seq(coarsity));
       }




                                                                                              LSU Seminar
                                                                                                            20 / 23
Introduction        Generative Programming                    NT2                 Quaff             Conclusion


                         Harris Corner Detector


                                     Mul     Ixx=Ix*Ix     Gauss    Sxx

                     Grad X   Ix
                                                                             coarsity
               I                     Mul     Ixy=Ix*Iy     Gauss    Sxy    Sxx*Syy-SxyĀ²
                                                                                          K

                     Grad Y   Iy

                                     Mul     Iyy=Iy*Iy     Gauss    Syy




       Results (PACT 09)

                    Version        Full-chain            Half-chain       No-chain
                    Manual           11.26                 8.36             9.97
                     Skell           11.86                 8.64            10.43
                   Overhead         5.33%                 3.35%            4.61%



                                                                                              LSU Seminar
                                                                                                            20 / 23
Introduction            Generative Programming        NT2     Quaff         Conclusion


                                Letā€™s round this up!


       Parallel Computing for Scientist
               Parallel programmign tools are required BUT:
               ... They need to cater to usersā€™ needs !
               ... Users should feel Ā«at homeĀ»




                                                                      LSU Seminar
                                                                                    21 / 23
Introduction            Generative Programming        NT2          Quaff             Conclusion


                                Letā€™s round this up!


       Parallel Computing for Scientist
               Parallel programmign tools are required BUT:
               ... They need to cater to usersā€™ needs !
               ... Users should feel Ā«at homeĀ»
       Our claims
               Software Libraries built as Generic and Generative components can
               solve a large chunk of parallelism related problems while being
               easy to use.
               EDSL are an efļ¬cient way to design such libraries
               C++ provides a wide selection of idioms to achieve this goal.




                                                                               LSU Seminar
                                                                                             21 / 23
Introduction           Generative Programming       NT2           Quaff            Conclusion


                                     Prospectives


       What weā€™re cooking at the moment
               Get a public release of NT 2 and Quaff
               NT 2 : Automatic matlab conversion with source to source compiler
               Quaff: Simplify new skeletons design by providing a Semantic
               Rules EDSL
       What weā€™ll be cooking in the future
               Multi-stage programming for skeleton over the Grid/Cloud
               NT 2 supports for embedded architectures




                                                                           LSU Seminar
                                                                                         22 / 23
Thanks for your attention

More Related Content

Viewers also liked

cara membuat kalkulator dengan C#
cara membuat kalkulator dengan C#cara membuat kalkulator dengan C#
cara membuat kalkulator dengan C#Hibaten Wafiroh
Ā 
Seri Belajar Mandiri - Pemrograman C# Untuk Pemula
Seri Belajar Mandiri - Pemrograman C# Untuk PemulaSeri Belajar Mandiri - Pemrograman C# Untuk Pemula
Seri Belajar Mandiri - Pemrograman C# Untuk PemulaAgus Kurniawan
Ā 
Pemrograman Game Tetris Dengan C#
Pemrograman Game Tetris Dengan C#Pemrograman Game Tetris Dengan C#
Pemrograman Game Tetris Dengan C#Robby Angryawan
Ā 
Tutorial csharp
Tutorial csharpTutorial csharp
Tutorial csharpSatish Verma
Ā 
Pemrograman Dasar Pengenalan C#
Pemrograman Dasar Pengenalan C#Pemrograman Dasar Pengenalan C#
Pemrograman Dasar Pengenalan C#SMKN 24 Jakarta Timur
Ā 
Belajar koding c#
Belajar koding c#Belajar koding c#
Belajar koding c#Ali Ikhsan
Ā 
Introduction to csharp
Introduction to csharpIntroduction to csharp
Introduction to csharpSatish Verma
Ā 
Pengenalan bahasa c#
Pengenalan bahasa c#Pengenalan bahasa c#
Pengenalan bahasa c#Heru Khoir
Ā 

Viewers also liked (8)

cara membuat kalkulator dengan C#
cara membuat kalkulator dengan C#cara membuat kalkulator dengan C#
cara membuat kalkulator dengan C#
Ā 
Seri Belajar Mandiri - Pemrograman C# Untuk Pemula
Seri Belajar Mandiri - Pemrograman C# Untuk PemulaSeri Belajar Mandiri - Pemrograman C# Untuk Pemula
Seri Belajar Mandiri - Pemrograman C# Untuk Pemula
Ā 
Pemrograman Game Tetris Dengan C#
Pemrograman Game Tetris Dengan C#Pemrograman Game Tetris Dengan C#
Pemrograman Game Tetris Dengan C#
Ā 
Tutorial csharp
Tutorial csharpTutorial csharp
Tutorial csharp
Ā 
Pemrograman Dasar Pengenalan C#
Pemrograman Dasar Pengenalan C#Pemrograman Dasar Pengenalan C#
Pemrograman Dasar Pengenalan C#
Ā 
Belajar koding c#
Belajar koding c#Belajar koding c#
Belajar koding c#
Ā 
Introduction to csharp
Introduction to csharpIntroduction to csharp
Introduction to csharp
Ā 
Pengenalan bahasa c#
Pengenalan bahasa c#Pengenalan bahasa c#
Pengenalan bahasa c#
Ā 

Similar to Generative and Meta-Programming - Modern C++ Design for Parallel Computing

Deep Learning libraries and ļ¬rst experiments with Theano
Deep Learning libraries and ļ¬rst experiments with TheanoDeep Learning libraries and ļ¬rst experiments with Theano
Deep Learning libraries and ļ¬rst experiments with TheanoVincenzo Lomonaco
Ā 
A Java-Compatible Multi-Thread Middleware for an Experimental Wireless Sensor...
A Java-Compatible Multi-Thread Middleware for an Experimental Wireless Sensor...A Java-Compatible Multi-Thread Middleware for an Experimental Wireless Sensor...
A Java-Compatible Multi-Thread Middleware for an Experimental Wireless Sensor...paperpublications3
Ā 
A Java-Compatible Multi-Thread Middleware for an Experimental Wireless Sensor...
A Java-Compatible Multi-Thread Middleware for an Experimental Wireless Sensor...A Java-Compatible Multi-Thread Middleware for an Experimental Wireless Sensor...
A Java-Compatible Multi-Thread Middleware for an Experimental Wireless Sensor...paperpublications3
Ā 
Compiler Engineering Lab#1
Compiler Engineering Lab#1Compiler Engineering Lab#1
Compiler Engineering Lab#1MashaelQ
Ā 
Literate computing for reproducible infrastructure - our basic practices in a...
Literate computing for reproducible infrastructure - our basic practices in a...Literate computing for reproducible infrastructure - our basic practices in a...
Literate computing for reproducible infrastructure - our basic practices in a...No Bu
Ā 
Seminar Report - Managing the Cloud with Open Source Tools
Seminar Report - Managing the Cloud with Open Source ToolsSeminar Report - Managing the Cloud with Open Source Tools
Seminar Report - Managing the Cloud with Open Source ToolsNakul Ezhuthupally
Ā 
Distributed Deployment Model Driven Development
Distributed Deployment Model Driven DevelopmentDistributed Deployment Model Driven Development
Distributed Deployment Model Driven DevelopmentPathfinder Solutions
Ā 
229 Convergence In Device Software
229   Convergence In Device Software229   Convergence In Device Software
229 Convergence In Device SoftwareEric Cloninger
Ā 
FA 10 Poster
FA 10 PosterFA 10 Poster
FA 10 PosterJmccloskey4
Ā 
Jtag Tools For Linux
Jtag Tools For LinuxJtag Tools For Linux
Jtag Tools For Linuxsheilamia
Ā 
RTL Design Engineer - Vinothkumar Murugesan - 3.3Yrs - Microchip
RTL Design Engineer - Vinothkumar Murugesan - 3.3Yrs - MicrochipRTL Design Engineer - Vinothkumar Murugesan - 3.3Yrs - Microchip
RTL Design Engineer - Vinothkumar Murugesan - 3.3Yrs - Microchipvinothkumar M
Ā 
Directive-based approach to Heterogeneous Computing
Directive-based approach to Heterogeneous ComputingDirective-based approach to Heterogeneous Computing
Directive-based approach to Heterogeneous ComputingRuymƔn Reyes
Ā 
Ppt on fft
Ppt on fftPpt on fft
Ppt on fftkiranrockz
Ā 
Master Thesis of Computer Engineering: OpenTranslator
Master Thesis of Computer Engineering: OpenTranslatorMaster Thesis of Computer Engineering: OpenTranslator
Master Thesis of Computer Engineering: OpenTranslatorGiuseppe D'Onofrio
Ā 
Hadoop Summit EU 2013: Parallel Linear Regression, IterativeReduce, and YARN
Hadoop Summit EU 2013: Parallel Linear Regression, IterativeReduce, and YARNHadoop Summit EU 2013: Parallel Linear Regression, IterativeReduce, and YARN
Hadoop Summit EU 2013: Parallel Linear Regression, IterativeReduce, and YARNJosh Patterson
Ā 
Tokyo Webmining Talk1
Tokyo Webmining Talk1Tokyo Webmining Talk1
Tokyo Webmining Talk1Kenta Oono
Ā 
Cag corporate dossier may 2012
Cag corporate dossier may 2012Cag corporate dossier may 2012
Cag corporate dossier may 2012javafastsockets
Ā 

Similar to Generative and Meta-Programming - Modern C++ Design for Parallel Computing (20)

Deep Learning libraries and ļ¬rst experiments with Theano
Deep Learning libraries and ļ¬rst experiments with TheanoDeep Learning libraries and ļ¬rst experiments with Theano
Deep Learning libraries and ļ¬rst experiments with Theano
Ā 
A Java-Compatible Multi-Thread Middleware for an Experimental Wireless Sensor...
A Java-Compatible Multi-Thread Middleware for an Experimental Wireless Sensor...A Java-Compatible Multi-Thread Middleware for an Experimental Wireless Sensor...
A Java-Compatible Multi-Thread Middleware for an Experimental Wireless Sensor...
Ā 
A Java-Compatible Multi-Thread Middleware for an Experimental Wireless Sensor...
A Java-Compatible Multi-Thread Middleware for an Experimental Wireless Sensor...A Java-Compatible Multi-Thread Middleware for an Experimental Wireless Sensor...
A Java-Compatible Multi-Thread Middleware for an Experimental Wireless Sensor...
Ā 
Compiler Engineering Lab#1
Compiler Engineering Lab#1Compiler Engineering Lab#1
Compiler Engineering Lab#1
Ā 
Literate computing for reproducible infrastructure - our basic practices in a...
Literate computing for reproducible infrastructure - our basic practices in a...Literate computing for reproducible infrastructure - our basic practices in a...
Literate computing for reproducible infrastructure - our basic practices in a...
Ā 
Seminar Report - Managing the Cloud with Open Source Tools
Seminar Report - Managing the Cloud with Open Source ToolsSeminar Report - Managing the Cloud with Open Source Tools
Seminar Report - Managing the Cloud with Open Source Tools
Ā 
Mpi4py
Mpi4pyMpi4py
Mpi4py
Ā 
Distributed Deployment Model Driven Development
Distributed Deployment Model Driven DevelopmentDistributed Deployment Model Driven Development
Distributed Deployment Model Driven Development
Ā 
229 Convergence In Device Software
229   Convergence In Device Software229   Convergence In Device Software
229 Convergence In Device Software
Ā 
Thesis Defense
Thesis DefenseThesis Defense
Thesis Defense
Ā 
FA 10 Poster
FA 10 PosterFA 10 Poster
FA 10 Poster
Ā 
Jtag Tools For Linux
Jtag Tools For LinuxJtag Tools For Linux
Jtag Tools For Linux
Ā 
RTL Design Engineer - Vinothkumar Murugesan - 3.3Yrs - Microchip
RTL Design Engineer - Vinothkumar Murugesan - 3.3Yrs - MicrochipRTL Design Engineer - Vinothkumar Murugesan - 3.3Yrs - Microchip
RTL Design Engineer - Vinothkumar Murugesan - 3.3Yrs - Microchip
Ā 
Thesis
ThesisThesis
Thesis
Ā 
Directive-based approach to Heterogeneous Computing
Directive-based approach to Heterogeneous ComputingDirective-based approach to Heterogeneous Computing
Directive-based approach to Heterogeneous Computing
Ā 
Ppt on fft
Ppt on fftPpt on fft
Ppt on fft
Ā 
Master Thesis of Computer Engineering: OpenTranslator
Master Thesis of Computer Engineering: OpenTranslatorMaster Thesis of Computer Engineering: OpenTranslator
Master Thesis of Computer Engineering: OpenTranslator
Ā 
Hadoop Summit EU 2013: Parallel Linear Regression, IterativeReduce, and YARN
Hadoop Summit EU 2013: Parallel Linear Regression, IterativeReduce, and YARNHadoop Summit EU 2013: Parallel Linear Regression, IterativeReduce, and YARN
Hadoop Summit EU 2013: Parallel Linear Regression, IterativeReduce, and YARN
Ā 
Tokyo Webmining Talk1
Tokyo Webmining Talk1Tokyo Webmining Talk1
Tokyo Webmining Talk1
Ā 
Cag corporate dossier may 2012
Cag corporate dossier may 2012Cag corporate dossier may 2012
Cag corporate dossier may 2012
Ā 

More from Joel Falcou

Designing C++ portable SIMD support
Designing C++ portable SIMD supportDesigning C++ portable SIMD support
Designing C++ portable SIMD supportJoel Falcou
Ā 
The Goal and The Journey - Turning back on one year of C++14 Migration
The Goal and The Journey - Turning back on one year of C++14 MigrationThe Goal and The Journey - Turning back on one year of C++14 Migration
The Goal and The Journey - Turning back on one year of C++14 MigrationJoel Falcou
Ā 
HDR Defence - Software Abstractions for Parallel Architectures
HDR Defence - Software Abstractions for Parallel ArchitecturesHDR Defence - Software Abstractions for Parallel Architectures
HDR Defence - Software Abstractions for Parallel ArchitecturesJoel Falcou
Ā 
Lattice Boltzmann sur architecture multicoeurs vectorielle - Une approche de ...
Lattice Boltzmann sur architecture multicoeurs vectorielle - Une approche de ...Lattice Boltzmann sur architecture multicoeurs vectorielle - Une approche de ...
Lattice Boltzmann sur architecture multicoeurs vectorielle - Une approche de ...Joel Falcou
Ā 
Boost.SIMD
Boost.SIMDBoost.SIMD
Boost.SIMDJoel Falcou
Ā 
Automatic Task-based Code Generation for High Performance DSEL
Automatic Task-based Code Generation for High Performance DSELAutomatic Task-based Code Generation for High Performance DSEL
Automatic Task-based Code Generation for High Performance DSELJoel Falcou
Ā 
Software Abstractions for Parallel Hardware
Software Abstractions for Parallel HardwareSoftware Abstractions for Parallel Hardware
Software Abstractions for Parallel HardwareJoel Falcou
Ā 
(Costless) Software Abstractions for Parallel Architectures
(Costless) Software Abstractions for Parallel Architectures(Costless) Software Abstractions for Parallel Architectures
(Costless) Software Abstractions for Parallel ArchitecturesJoel Falcou
Ā 
Boost.Dispatch
Boost.DispatchBoost.Dispatch
Boost.DispatchJoel Falcou
Ā 
Designing Architecture-aware Library using Boost.Proto
Designing Architecture-aware Library using Boost.ProtoDesigning Architecture-aware Library using Boost.Proto
Designing Architecture-aware Library using Boost.ProtoJoel Falcou
Ā 

More from Joel Falcou (10)

Designing C++ portable SIMD support
Designing C++ portable SIMD supportDesigning C++ portable SIMD support
Designing C++ portable SIMD support
Ā 
The Goal and The Journey - Turning back on one year of C++14 Migration
The Goal and The Journey - Turning back on one year of C++14 MigrationThe Goal and The Journey - Turning back on one year of C++14 Migration
The Goal and The Journey - Turning back on one year of C++14 Migration
Ā 
HDR Defence - Software Abstractions for Parallel Architectures
HDR Defence - Software Abstractions for Parallel ArchitecturesHDR Defence - Software Abstractions for Parallel Architectures
HDR Defence - Software Abstractions for Parallel Architectures
Ā 
Lattice Boltzmann sur architecture multicoeurs vectorielle - Une approche de ...
Lattice Boltzmann sur architecture multicoeurs vectorielle - Une approche de ...Lattice Boltzmann sur architecture multicoeurs vectorielle - Une approche de ...
Lattice Boltzmann sur architecture multicoeurs vectorielle - Une approche de ...
Ā 
Boost.SIMD
Boost.SIMDBoost.SIMD
Boost.SIMD
Ā 
Automatic Task-based Code Generation for High Performance DSEL
Automatic Task-based Code Generation for High Performance DSELAutomatic Task-based Code Generation for High Performance DSEL
Automatic Task-based Code Generation for High Performance DSEL
Ā 
Software Abstractions for Parallel Hardware
Software Abstractions for Parallel HardwareSoftware Abstractions for Parallel Hardware
Software Abstractions for Parallel Hardware
Ā 
(Costless) Software Abstractions for Parallel Architectures
(Costless) Software Abstractions for Parallel Architectures(Costless) Software Abstractions for Parallel Architectures
(Costless) Software Abstractions for Parallel Architectures
Ā 
Boost.Dispatch
Boost.DispatchBoost.Dispatch
Boost.Dispatch
Ā 
Designing Architecture-aware Library using Boost.Proto
Designing Architecture-aware Library using Boost.ProtoDesigning Architecture-aware Library using Boost.Proto
Designing Architecture-aware Library using Boost.Proto
Ā 

Recently uploaded

Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
Ā 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
Ā 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
Ā 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
Ā 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
Ā 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
Ā 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
Ā 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
Ā 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
Ā 
Mcleodganj Call Girls šŸ„° 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls šŸ„° 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls šŸ„° 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls šŸ„° 8617370543 Service Offer VIP Hot ModelDeepika Singh
Ā 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Christopher Logan Kennedy
Ā 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMKumar Satyam
Ā 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
Ā 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard37
Ā 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
Ā 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)Samir Dash
Ā 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
Ā 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
Ā 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
Ā 

Recently uploaded (20)

Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
Ā 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Ā 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
Ā 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Ā 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
Ā 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
Ā 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
Ā 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
Ā 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
Ā 
Mcleodganj Call Girls šŸ„° 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls šŸ„° 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls šŸ„° 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls šŸ„° 8617370543 Service Offer VIP Hot Model
Ā 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
Ā 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
Ā 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Ā 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
Ā 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Ā 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
Ā 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
Ā 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Ā 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
Ā 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Ā 

Generative and Meta-Programming - Modern C++ Design for Parallel Computing

  • 1. Introduction Generative Programming NT2 Quaff Conclusion Generative and Meta-Programming Modern C++ Design for Parallel Computing Joel Falcou 05/02/2011 LRI, University Paris Sud XI LSU Seminar 1 / 23
  • 2. Introduction Generative Programming NT2 Quaff Conclusion Context In Scientiļ¬c Computing ... there is Scientiļ¬c LSU Seminar 2 / 23
  • 3. Introduction Generative Programming NT2 Quaff Conclusion Context In Scientiļ¬c Computing ... there is Scientiļ¬c Applications are domain driven Users = Developers Users are reluctant to changes LSU Seminar 2 / 23
  • 4. Introduction Generative Programming NT2 Quaff Conclusion Context In Scientiļ¬c Computing ... there is Scientiļ¬c Applications are domain driven Users = Developers Users are reluctant to changes there is Computing LSU Seminar 2 / 23
  • 5. Introduction Generative Programming NT2 Quaff Conclusion Context In Scientiļ¬c Computing ... there is Scientiļ¬c Applications are domain driven Users = Developers Users are reluctant to changes there is Computing Computing requires performance ... ... which implies architectures speciļ¬c tuning ... which requires expertise ... which may or may not be available LSU Seminar 2 / 23
  • 6. Introduction Generative Programming NT2 Quaff Conclusion Context In Scientiļ¬c Computing ... there is Scientiļ¬c Applications are domain driven Users = Developers Users are reluctant to changes there is Computing Computing requires performance ... ... which implies architectures speciļ¬c tuning ... which requires expertise ... which may or may not be available The Problem People using computers to do science want to do science ļ¬rst. LSU Seminar 2 / 23
  • 7. Introduction Generative Programming NT2 Quaff Conclusion The Problem ā€“ and how we want to solve it The Facts The ā€Library to bind them allā€ doesnā€™t exist (or we should have it already ) All those users want to take advantage of new architectures Few of them want to actually handle all the dirty work The Ends Provide a ā€familiarā€ interface that let users beneļ¬t from parallelism Helps compilers to generate better parallel code Increase sustainability by decreasing amount of code to write The Means Generative Programming Template Meta-Programming Embedded Domain Speciļ¬c Languages LSU Seminar 3 / 23
  • 8. Introduction Generative Programming NT2 Quaff Conclusion Talk Layout 1 Introduction 2 Generative Programming 3 NT2 4 Quaff 5 Conclusion LSU Seminar 4 / 23
  • 9. Introduction Generative Programming NT2 Quaff Conclusion Generative Programming Domain Speciļ¬c Generative Component Concrete Application Application Description Translator Parametric Sub-components LSU Seminar 5 / 23
  • 10. Introduction Generative Programming NT2 Quaff Conclusion Generative Programming as a Tool Available techniques Dedicated compilers External pre-processing tools Languages supporting meta-programming LSU Seminar 6 / 23
  • 11. Introduction Generative Programming NT2 Quaff Conclusion Generative Programming as a Tool Available techniques Dedicated compilers External pre-processing tools Languages supporting meta-programming LSU Seminar 6 / 23
  • 12. Introduction Generative Programming NT2 Quaff Conclusion Generative Programming as a Tool Available techniques Dedicated compilers External pre-processing tools Languages supporting meta-programming Deļ¬nition of Meta-programming Meta-programming is the writing of computer programs that analyse, transform and generate other programs (or them- selves) as their data. LSU Seminar 6 / 23
  • 13. Introduction Generative Programming NT2 Quaff Conclusion From Generative to Meta-programming Meta-programmable languages template H ASKELL metaOcaml C++ LSU Seminar 7 / 23
  • 14. Introduction Generative Programming NT2 Quaff Conclusion From Generative to Meta-programming Meta-programmable languages template H ASKELL metaOcaml C++ LSU Seminar 7 / 23
  • 15. Introduction Generative Programming NT2 Quaff Conclusion From Generative to Meta-programming Meta-programmable languages template H ASKELL metaOcaml C++ C++ meta-programming Relies on the C++ template sub-language Handles types and integral constants at compile-time Proved to be Turing-complete LSU Seminar 7 / 23
  • 16. Introduction Generative Programming NT2 Quaff Conclusion Embedded Domain Speciļ¬c Languages Whatā€™s an EDSL ? DSL = Domain Speciļ¬c Language Declarative language, easy-to-use, ļ¬tting the domain EDSL = DSL within a general purpose language EDSL in C++ Relies on operator overload abuse (Expression Templates) Carry semantic information around code fragment Generic implementation become self-aware of optimizations Exploiting static AST At the expression level: code generation At the function level: inter-procedural optimization LSU Seminar 8 / 23
  • 17. Introduction Generative Programming NT2 Quaff Conclusion Expression Templates matrix x(h,w),a(h,w),b(h,w); = x = cos(a) + (b*a); x + expr<assign ,expr<matrix&> ,expr<plus cos * , expr<cos ,expr<matrix&> > a b a , expr<multiplies ,expr<matrix&> ,expr<matrix&> > #pragma omp parallel for >(x,a,b); for(int j=0;j<h;++j) { for(int i=0;i<w;++i) { Arbitrary Transforms applied x(j,i) = cos(a(j,i)) on the meta-AST + ( b(j,i) * a(j,i) ); } } LSU Seminar 9 / 23
  • 18. Introduction Generative Programming NT2 Quaff Conclusion What is NT 2 ? A Scientiļ¬c Computing Library Provide a simple, M ATLAB-like interface for users Provide high-performance computing entities and primitives Easily extendable LSU Seminar 10 / 23
  • 19. Introduction Generative Programming NT2 Quaff Conclusion What is NT 2 ? A Scientiļ¬c Computing Library Provide a simple, M ATLAB-like interface for users Provide high-performance computing entities and primitives Easily extendable Principles Take a .m ļ¬le, copy to a .cpp ļ¬le LSU Seminar 10 / 23
  • 20. Introduction Generative Programming NT2 Quaff Conclusion What is NT 2 ? A Scientiļ¬c Computing Library Provide a simple, M ATLAB-like interface for users Provide high-performance computing entities and primitives Easily extendable Principles Take a .m ļ¬le, copy to a .cpp ļ¬le Add #include <nt2/nt2.hpp> and do cosmetic changes LSU Seminar 10 / 23
  • 21. Introduction Generative Programming NT2 Quaff Conclusion What is NT 2 ? A Scientiļ¬c Computing Library Provide a simple, M ATLAB-like interface for users Provide high-performance computing entities and primitives Easily extendable Principles Take a .m ļ¬le, copy to a .cpp ļ¬le Add #include <nt2/nt2.hpp> and do cosmetic changes Compile the ļ¬le and link with libnt2.a LSU Seminar 10 / 23
  • 22. Introduction Generative Programming NT2 Quaff Conclusion M ATLAB you said ? R = I(:,:,1); G = I(:,:,2); B = I(:,:,3); Y = min(abs(0.299.*R+0.587.*G+0.114.*B),235); U = min(abs(-0.169.*R-0.331.*G+0.5.*B),240); V = min(abs(0.5.*R-0.419.*G-0.081.*B),240); LSU Seminar 11 / 23
  • 23. Introduction Generative Programming NT2 Quaff Conclusion Now with NT 2 table<double> R = I(_,_,1); table<double> G = I(_,_,2); table<double> B = I(_,_,3); table<double> Y, U, V; Y = min(abs(0.299*R+0.587*G+0.114*B),235); U = min(abs(-0.169*R-0.331*G+0.5*B),240); V = min(abs(0.5*R-0.419*G-0.081*B),240); LSU Seminar 12 / 23
  • 24. Introduction Generative Programming NT2 Quaff Conclusion Now with NT 2 table<float,settings(shallow,of_size_<640,480>)> R = I(_,_,1); table<float,settings(shallow,of_size_<640,480>)> G = I(_,_,2); table<float,settings(shallow,of_size_<640,480>)> B = I(_,_,3); table<float,settings(of_size_<640,480>)> Y, U, V; Y = min(abs(0.299*R+0.587*G+0.114*B),235), U = min(abs(-0.169*R-0.331*G+0.5*B),240), V = min(abs(0.5*R-0.419*G-0.081*B),240); LSU Seminar 12 / 23
  • 25. Introduction Generative Programming NT2 Quaff Conclusion Some Performances RGB2YUV timing (in cycles/pixels) Size 128x128 256x256 512x512 1024x1024 M ATLAB 2010a (2 cores) 85 89 97 102 C (1 core) 23.6 23.8 23.9 24.0 NT2 (1 core) 22.3 22.4 22.2 24.1 NT2 OpenMP (2 cores) 11.4 11.4 11.5 12.2 NT2 SIMD 5.5 5.6 5.6 5.9 NT2 SIMD+OpenMP 2.9 2.9 2.9 3.0 NT2 SIMD speed-up 3.9 3.9 3.9 4.0 NT2 OpenMP speed-up 1.92 1.96 1.98 1.95 NT2 vs M ATLAB speed-up 29.3 30.7 33.5 34 LSU Seminar 13 / 23
  • 26. Introduction Generative Programming NT2 Quaff Conclusion Some real life applications LSU Seminar 14 / 23
  • 27. Introduction Generative Programming NT2 Quaff Conclusion Parallel Skeletons in a nutshell Basic Principles [COLE 89] There are patterns in parallel applications Those patterns can be generalized in Skeletons Applications are assembled as combination of such patterns LSU Seminar 15 / 23
  • 28. Introduction Generative Programming NT2 Quaff Conclusion Parallel Skeletons in a nutshell Basic Principles [COLE 89] There are patterns in parallel applications Those patterns can be generalized in Skeletons Applications are assembled as combination of such patterns Functionnal point of view Skeletons are Higher-Order Functions Skeletons support a compositionnal semantic Applications become composition of state-less functions LSU Seminar 15 / 23
  • 29. Introduction Generative Programming NT2 Quaff Conclusion Spotting skeletons when you see one Pipeline Farm Processus 3 F2 Processus 1 Processus 2 Processus 4 Processus 6 Processus 7 F1 Distrib. F2 Collect. F3 Processus 5 F2 LSU Seminar 16 / 23
  • 30. Introduction Generative Programming NT2 Quaff Conclusion Objectives Proposing a C++ skeletons library Limit runtime overhead Use the formal model skeleton as guidelines LSU Seminar 17 / 23
  • 31. Introduction Generative Programming NT2 Quaff Conclusion Objectives Proposing a C++ skeletons library Limit runtime overhead Use the formal model skeleton as guidelines What we want to write run( pipeline( seq(F1), seq(F2), seq(F3) ) ) LSU Seminar 17 / 23
  • 32. Introduction Generative Programming NT2 Quaff Conclusion Objectives Proposing a C++ skeletons library Limit runtime overhead Use the formal model skeleton as guidelines What we want to run if( rank == 0 ) do { out = F1(); MPI_Send(&out,1,MPI_INT,1,0,MPI_COMM_WORLD); } while( isValid(out) ); if( rank == 1 ) do { MPI_Recv(&in,1,MPI_INT,0,0,MPI_COMM_WORLD,&s); out = F2(in); MPI_Send(&in,1,MPI_INT,2,0,MPI_COMM_WORLD); } while ( isValid(out) ) if( rank == 2 ) do { MPI_Recv(&in,1,MPI_INT,1,0,MPI_COMM_WORLD,&s); F2(in); } while ( isValid(in) ) LSU Seminar 17 / 23
  • 33. Introduction Generative Programming NT2 Quaff Conclusion Design Rationale Code generation process Generating the skeleton tree at compile-time Turning this tree into a process network using MPL Producing the C + MPI target code using Fusion PIPE GĆ©nĆ©ration Production Ļ† 2 GĆ©nĆ©ration AST du RPSC Ļ† 2 Ļ† 2 de code C+MPI C C++ Ļ†1 FARM3 Ļ†3 MPI Ļ† 1 f Ļ† 3 Ļ†2 LSU Seminar 18 / 23
  • 34. Introduction Generative Programming NT2 Quaff Conclusion Quaff over the CELL The OCELLE project IEF/CEA/TRT Tools for heterog. proc. MPI and skeleton for the Cell Developing for the CELL How to ļ¬nd a good mapping for an application ? LSU Seminar 19 / 23
  • 35. Introduction Generative Programming NT2 Quaff Conclusion Harris Corner Detector Mul Ixx=Ix*Ix Gauss Sxx Grad X Ix coarsity I Mul Ixy=Ix*Iy Gauss Sxy Sxx*Syy-SxyĀ² K Grad Y Iy Mul Iyy=Iy*Iy Gauss Syy LSU Seminar 20 / 23
  • 36. Introduction Generative Programming NT2 Quaff Conclusion Harris Corner Detector Mul Ixx=Ix*Ix Gauss Sxx Grad X Ix coarsity I Mul Ixy=Ix*Iy Gauss Sxy Sxx*Syy-SxyĀ² K Grad Y Iy Mul Iyy=Iy*Iy Gauss Syy Skeleton Code and Benchmarks void full_chain_harris(tile const&,tile&) { run( pardo<8>((seq(grad),seq(mul),seq(gauss),seq(coarsity))); } LSU Seminar 20 / 23
  • 37. Introduction Generative Programming NT2 Quaff Conclusion Harris Corner Detector Mul Ixx=Ix*Ix Gauss Sxx Grad X Ix coarsity I Mul Ixy=Ix*Iy Gauss Sxy Sxx*Syy-SxyĀ² K Grad Y Iy Mul Iyy=Iy*Iy Gauss Syy Skeleton Code and Benchmarks void half_chain_harris(tile const&,tile&) { run( pardo<4>((seq(grad),seq(mul)) | (seq(gauss),seq(coarsity))); } LSU Seminar 20 / 23
  • 38. Introduction Generative Programming NT2 Quaff Conclusion Harris Corner Detector Mul Ixx=Ix*Ix Gauss Sxx Grad X Ix coarsity I Mul Ixy=Ix*Iy Gauss Sxy Sxx*Syy-SxyĀ² K Grad Y Iy Mul Iyy=Iy*Iy Gauss Syy Skeleton Code and Benchmarks void no_chain_harris(tile const&,tile&) { run( pardo<2>( seq(grad) | seq(mul) | seq(gauss) | seq(coarsity)); } LSU Seminar 20 / 23
  • 39. Introduction Generative Programming NT2 Quaff Conclusion Harris Corner Detector Mul Ixx=Ix*Ix Gauss Sxx Grad X Ix coarsity I Mul Ixy=Ix*Iy Gauss Sxy Sxx*Syy-SxyĀ² K Grad Y Iy Mul Iyy=Iy*Iy Gauss Syy Results (PACT 09) Version Full-chain Half-chain No-chain Manual 11.26 8.36 9.97 Skell 11.86 8.64 10.43 Overhead 5.33% 3.35% 4.61% LSU Seminar 20 / 23
  • 40. Introduction Generative Programming NT2 Quaff Conclusion Letā€™s round this up! Parallel Computing for Scientist Parallel programmign tools are required BUT: ... They need to cater to usersā€™ needs ! ... Users should feel Ā«at homeĀ» LSU Seminar 21 / 23
  • 41. Introduction Generative Programming NT2 Quaff Conclusion Letā€™s round this up! Parallel Computing for Scientist Parallel programmign tools are required BUT: ... They need to cater to usersā€™ needs ! ... Users should feel Ā«at homeĀ» Our claims Software Libraries built as Generic and Generative components can solve a large chunk of parallelism related problems while being easy to use. EDSL are an efļ¬cient way to design such libraries C++ provides a wide selection of idioms to achieve this goal. LSU Seminar 21 / 23
  • 42. Introduction Generative Programming NT2 Quaff Conclusion Prospectives What weā€™re cooking at the moment Get a public release of NT 2 and Quaff NT 2 : Automatic matlab conversion with source to source compiler Quaff: Simplify new skeletons design by providing a Semantic Rules EDSL What weā€™ll be cooking in the future Multi-stage programming for skeleton over the Grid/Cloud NT 2 supports for embedded architectures LSU Seminar 22 / 23
  • 43. Thanks for your attention