Boost.Dispatch is a generic tag-dispatching library that allows for specializing functions based on type constraints. It introduces a hierarchy system to categorize types and functions based on tags. This allows defining implementations of functions like "plus" for different argument types and architectures. The dispatch call uses the hierarchy information to select the best matching implementation at call sites in a generic way. This minimizes code duplication and increases the applicability of tag dispatching in C++.
(Costless) Software Abstractions for Parallel ArchitecturesJoel Falcou
Performing large, intensive or non-trivial computing on array like data structures is one of the most common task in scientific computing, video game development and other fields. This matter of fact is backed up by the large number of tools, languages and libraries to perform such tasks. If we restrict ourselves to C++ based solutions, more than a dozen such libraries exists from BLAS/LAPACK C++ binding to template meta-programming based Blitz++ or Eigen. If all of these libraries provide good performance or good abstraction, none of them seems to fit the need of so many different user types.
Moreover, as parallel system complexity grows, the need to maintain all those components quickly become unwieldy. This talk explores various software design techniques - like Generative Programming, MetaProgramming and Generic Programming - and their application to the implementation of a parallel computing librariy in such a way that:
- abstraction and expressiveness are maximized - cost over efficiency is minimized
We'll skim over various applications and see how they can benefit from such tools. We will conclude by discussing what lessons were learnt from this kind of implementation and how those lessons can translate into new directions for the language itself.
Automatic Task-based Code Generation for High Performance DSELJoel Falcou
Providing high level tools for parallel programming while sustaining a high level of performance has been a challenge that techniques like Domain Specific Embedded Languages try to solve. In previous works, we investigated the design of such a DSEL – NT2 – providing a Matlab -like syntax for parallel numerical computations inside a C++ library.
Main issues addressed here is how liimtaions of classical DSEL generation and multithreaded code generation can be overcome.
HDR Defence - Software Abstractions for Parallel ArchitecturesJoel Falcou
Performing large, intensive or non-trivial computing on array like data
structures is one of the most common task in scientific computing, video game
development and other fields. This matter of fact is backed up by the large number
of tools, languages and libraries to perform such tasks. If we restrict ourselves to
C++ based solutions, more than a dozen such libraries exists from BLAS/LAPACK
C++ binding to template meta-programming based Blitz++ or Eigen.
If all of these libraries provide good performance or good abstraction, none of
them seems to fit the need of so many different user types. Moreover, as parallel
system complexity grows, the need to maintain all those components quickly
become unwieldy. This thesis explores various software design techniques - like
Generative Programming, MetaProgramming and Generic Programming - and their
application to the implementation of various parallel computing libraries in such a
way that abstraction and expressiveness are maximized while efficiency overhead is
minimized.
Designing Architecture-aware Library using Boost.ProtoJoel Falcou
This document discusses designing architecture-aware libraries using Boost.Proto. It describes how the NT2 scientific computing library was redesigned using Boost.Proto to make it more extensible and able to better support new hardware architectures. The redesign segmented the evaluation of expressions into phases. Boost.Proto transforms are used in each phase to advance code generation. Hardware specifications influence function overloads through generalized tag dispatching, allowing the best function implementation to be selected for a given hardware architecture. This makes it possible to more easily add support for new optimization schemes and hardware targets to the library.
The Goal and The Journey - Turning back on one year of C++14 MigrationJoel Falcou
C++14 has been announced as the next best thing since sliced bread in terms of simplicity, performance and overall elegance of c++ code. This talk is the story of why and how we decided to migrate one of our old 'modern C++' software library -- BSP++, a C++ implementation of the BSP parallel programming model -- to C++14.
More than just a recollection of 'use this' or 'do that' mottos, this talk will try to ponder on :
why one should consider migrating to C++14 now
which features actually helped and which one did not
the traps and pitfalls compilers tried to pull on us
C++ is an object-oriented programming language created by Bjarne Stroustrup in 1985 that maintains aspects of C while adding object-oriented features like classes. C++ can be used to create small programs or large applications across many domains. Key concepts covered include functions, classes, inheritance, polymorphism, and memory management techniques like realloc() and free().
C is a widely used programming language developed in the 1970s. It is efficient and commonly used for system software and applications. Variables in C have automatic, static, or allocated storage classes. Static variables retain their value between function calls. Hashing is used to convert data into integers to enable fast searching when there is no inherent ordering. Include files can be nested and precompiled headers improve compilation speed. Pointers can have a null value to represent no target. calloc() allocates memory for an array and initializes elements to 0 while malloc() only allocates raw memory.
(Costless) Software Abstractions for Parallel ArchitecturesJoel Falcou
Performing large, intensive or non-trivial computing on array like data structures is one of the most common task in scientific computing, video game development and other fields. This matter of fact is backed up by the large number of tools, languages and libraries to perform such tasks. If we restrict ourselves to C++ based solutions, more than a dozen such libraries exists from BLAS/LAPACK C++ binding to template meta-programming based Blitz++ or Eigen. If all of these libraries provide good performance or good abstraction, none of them seems to fit the need of so many different user types.
Moreover, as parallel system complexity grows, the need to maintain all those components quickly become unwieldy. This talk explores various software design techniques - like Generative Programming, MetaProgramming and Generic Programming - and their application to the implementation of a parallel computing librariy in such a way that:
- abstraction and expressiveness are maximized - cost over efficiency is minimized
We'll skim over various applications and see how they can benefit from such tools. We will conclude by discussing what lessons were learnt from this kind of implementation and how those lessons can translate into new directions for the language itself.
Automatic Task-based Code Generation for High Performance DSELJoel Falcou
Providing high level tools for parallel programming while sustaining a high level of performance has been a challenge that techniques like Domain Specific Embedded Languages try to solve. In previous works, we investigated the design of such a DSEL – NT2 – providing a Matlab -like syntax for parallel numerical computations inside a C++ library.
Main issues addressed here is how liimtaions of classical DSEL generation and multithreaded code generation can be overcome.
HDR Defence - Software Abstractions for Parallel ArchitecturesJoel Falcou
Performing large, intensive or non-trivial computing on array like data
structures is one of the most common task in scientific computing, video game
development and other fields. This matter of fact is backed up by the large number
of tools, languages and libraries to perform such tasks. If we restrict ourselves to
C++ based solutions, more than a dozen such libraries exists from BLAS/LAPACK
C++ binding to template meta-programming based Blitz++ or Eigen.
If all of these libraries provide good performance or good abstraction, none of
them seems to fit the need of so many different user types. Moreover, as parallel
system complexity grows, the need to maintain all those components quickly
become unwieldy. This thesis explores various software design techniques - like
Generative Programming, MetaProgramming and Generic Programming - and their
application to the implementation of various parallel computing libraries in such a
way that abstraction and expressiveness are maximized while efficiency overhead is
minimized.
Designing Architecture-aware Library using Boost.ProtoJoel Falcou
This document discusses designing architecture-aware libraries using Boost.Proto. It describes how the NT2 scientific computing library was redesigned using Boost.Proto to make it more extensible and able to better support new hardware architectures. The redesign segmented the evaluation of expressions into phases. Boost.Proto transforms are used in each phase to advance code generation. Hardware specifications influence function overloads through generalized tag dispatching, allowing the best function implementation to be selected for a given hardware architecture. This makes it possible to more easily add support for new optimization schemes and hardware targets to the library.
The Goal and The Journey - Turning back on one year of C++14 MigrationJoel Falcou
C++14 has been announced as the next best thing since sliced bread in terms of simplicity, performance and overall elegance of c++ code. This talk is the story of why and how we decided to migrate one of our old 'modern C++' software library -- BSP++, a C++ implementation of the BSP parallel programming model -- to C++14.
More than just a recollection of 'use this' or 'do that' mottos, this talk will try to ponder on :
why one should consider migrating to C++14 now
which features actually helped and which one did not
the traps and pitfalls compilers tried to pull on us
C++ is an object-oriented programming language created by Bjarne Stroustrup in 1985 that maintains aspects of C while adding object-oriented features like classes. C++ can be used to create small programs or large applications across many domains. Key concepts covered include functions, classes, inheritance, polymorphism, and memory management techniques like realloc() and free().
C is a widely used programming language developed in the 1970s. It is efficient and commonly used for system software and applications. Variables in C have automatic, static, or allocated storage classes. Static variables retain their value between function calls. Hashing is used to convert data into integers to enable fast searching when there is no inherent ordering. Include files can be nested and precompiled headers improve compilation speed. Pointers can have a null value to represent no target. calloc() allocates memory for an array and initializes elements to 0 while malloc() only allocates raw memory.
C programming & data structure [character strings & string functions]MomenMostafa
The document provides information about C programming language and data structures. It includes references to books and websites on the topics. The document outlines topics that will be covered, including arrays and pointers, strings and string functions, structures, algorithms, stacks, queues and trees. It then gives details on a lesson about string functions, including examples of gets(), puts(), fgets() and other standard library string functions.
This document provides an overview of C++ and object-oriented programming concepts. It discusses:
1. C++ is an object-oriented programming language introduced in the 1980s that retains the power of C and adds classes, inheritance, function overloading, and operator overloading.
2. OOP languages like C++ are well-suited for developing large, complex programs like editors, compilers, databases, and communication systems due to features like modularity and code reusability.
3. A simple C++ program is presented that demonstrates basic syntax like main(), comments, cout and << operators, and return type for main(). Classes and member functions are also introduced.
C programming & data structure [arrays & pointers]MomenMostafa
This document provides an overview of arrays and pointers in C programming. It defines arrays as a series of elements of the same data type. Arrays can be initialized, accessed using subscripts, and their size determined. Multidimensional arrays contain arrays as elements. Pointers offer an efficient way to work with arrays, as array notation is equivalent to pointer notation. Functions can operate on arrays by passing a pointer to the first element as a parameter.
This document provides an overview of topics related to C programming language and data structures. It begins with a list of references and introduces the author. It then outlines topics that will be covered, including arrays and pointers, strings, storage classes and memory management, file I/O, structures, bit manipulation, preprocessing, algorithms, stacks, queues, and trees. The document focuses on keywords like auto, extern, static, register, const, and volatile. It discusses functions like rand(), srand(), time(), malloc(), calloc(), and free(). It also covers designing multi-file programs and variable scopes, linkages, storage durations, and memory allocation.
The document provides an introduction to the C programming language. It discusses C's history, origins in the development of UNIX, data types, variables, constants, operators, input/output functions, conditional statements, and loops. It also provides 10 examples of C programs covering topics like calculating sums, finding prime and palindrome numbers, temperature conversion, and linear/binary search.
This document provides an introduction and overview for a course on programming in C++. It discusses the goals of the course, which are to teach programming principles and the C++ language. Students will learn essential concepts like variables, data types, functions, and arrays. They will write increasingly complex programs and develop good programming style. The course will be assessed through quizzes, exams, and class projects. Topics to be covered include variables, input/output, control flow, arrays, pointers, strings, and file I/O. Good programming practices like readability, simplicity, and avoiding reinventing solutions are emphasized.
Programming is hard. Programming correct C and C++ is particularly hard. Indeed, both in C and certainly in C++, it is uncommon to see a screenful containing only well defined and conforming code.Why do professional programmers write code like this? Because most programmers do not have a deep understanding of the language they are using.While they sometimes know that certain things are undefined or unspecified, they often do not know why it is so. In these slides we will study small code snippets in C and C++, and use them to discuss the fundamental building blocks, limitations and underlying design philosophies of these wonderful but dangerous programming languages.
This content has a CC license. Feel free to use it for whatever you want. You may download the original PDF file from: http://www.pvv.org/~oma/DeepC_slides_oct2012.pdf
The document discusses C# and the .NET framework. It covers:
- The goals and components of the .NET framework, including the common language runtime (CLR) and class library.
- Key concepts in .NET like value types, reference types, boxing/unboxing, and the unified type system.
- Features that enable component-oriented development in C# like properties, events, and attributes.
- Productivity features of C# like parameter arrays, ref/out parameters, and foreach loops.
This document compares the programming languages Java and C#. It discusses that C# was developed with the .NET framework in mind and is intended to be the primary language for .NET development. It outlines some subtle syntactic differences between the languages, like how print statements and inheritance are defined. It also examines some concepts that are modified in C# compared to Java, such as polymorphism and operator overloading. Finally, it presents some new concepts in C# that do not exist in Java, including enums, foreach loops, and properties.
Sometimes you see code that is perfectly OK according to the definition of the language, but which is flawed because it breaks too many established idioms and conventions. On the other hand, a solid piece of code is something that looks like it is written by an experienced person who cares about professionalism in programming.
A presentation at Norwegian Developer Conference 2010
This document provides an overview of pointers in C programming. It discusses seven rules for pointers, including that pointers are integer variables that store memory addresses, how to dereference and reference pointers, NULL pointers, and arithmetic operations on pointers. It also covers dynamic memory allocation using malloc, calloc, realloc, and free and different approaches to 2D arrays. Finally, it discusses function pointers and their uses, including as callback functions.
Presentation on C++ Programming Languagesatvirsandhu9
This document provides an overview of the C++ programming language. It discusses why C++ is used, how it compares to Fortran, and the basic structure and components of a C++ program. The key topics covered include data types, variables, operators, selection statements, iteration statements, functions, arrays, pointers, input/output, preprocessor instructions, and comments. The document is intended to teach the basics of C++ programming in a structured way over multiple sections.
The presentation shows major features of the new C++ standard (language and the library). The full list of new things is very broad, so I've categorized them to be easier to understand.
This document provides an introduction to C programming over 13 pages. It covers the purpose and schedule of the lectures, differences between C and Java, C program structure, keywords, variables, data types, and more. The main points are that the lectures will provide a crash course in C with an emphasis on differences from Java, cover practical examples and topics related to C programming, and include history, language overview, pointers, memory management, compiling and debugging.
This document discusses the implementation of digital filters in fixed-point arithmetic on embedded systems. It presents the need for methodology and tools to design fixed-point embedded filter systems. The key steps are: 1) choosing a filter algorithm, 2) rounding coefficients to fixed-point, and 3) implementing the algorithm. Optimal implementations minimize degradation from quantization errors while meeting resource constraints. The document outlines a global flow from filter design to code generation and optimization.
This PPT is intended to provide a thorough coverage of verilog HDL concepts based on fundamental principles of digital design. This is the basic fundamental concept for the programming of the digital electronics.
This document discusses algorithms and data structures. It covers the requirements of algorithms including inputs, outputs, unambiguousness, generality, correctness, being finite, and efficiency. It also discusses representing algorithms through pseudo-code and flowcharts. Some key aspects of pseudo-code are described such as its purpose to define algorithms simply and its use of limited vocabulary and English-like notation. Common control structures like sequence, selection, and repetition are explained. Examples of bubble sort, selection sort, and insertion sort algorithms are also mentioned.
The document discusses the history of functional programming from 1903 to the present. It covers early developments like the lambda calculus in the 1930s and languages like Lisp in 1958. It also discusses key people who advanced functional programming like Alonzo Church, John McCarthy, and John Backus. The document then covers important milestones in functional programming languages between 1936 and 2013. It discusses concepts like purity, higher-order functions, and how functional programming relates to object-oriented programming.
VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & ...vtunotesbysree
The document contains solved question papers from June 2015 and December 2015 for Programming in C & Data Structures examinations. It includes questions ranging from basic C programming concepts like data types, operators, decision making and looping statements to more advanced topics such as arrays, strings, structures, files and pointers. For each question, the relevant concept is explained and examples are provided. Solutions for some programming problems involving simple calculations, palindrome checks and file handling are also presented.
Over the past two years, Unreal Engine 4 has received many new features and improvements including enhanced editor tutorials, camera animation tools, ambient occlusion techniques, shadowing for translucent materials, 2D artwork tools, behavior trees, ray tracing, sub-surface scattering, landscape tools, particle collision with meshes, mobile development improvements, virtual reality support, animation tools, foliage rendering, multi-threading, and post-processing effects. The document provides a high-level overview of the significant updates to Unreal Engine 4 in the past two years based on the numerous new features that have been added.
Building a Multithreaded Web-Based Game Engine Using HTML5/CSS3 and JavaScrip...Corey Clark, Ph.D.
As hardware developer’s push away from creating faster processors in lieu of multicore architectures game developers have to leverage multithreading technologies to capitalize on these new devices. With multicore mobile devices the need for a multithreaded web based game engine is a reality. This talk will discuss design of various multithreaded web engine architectures. Two specific threading implementations will be discussed. First technique shows how to create a static thread that is registered with the engine with the same techniques as other loaded resource. A second technique will focus on using a Thread Controller, which has the ability to create dynamic generic threads that can be passed functions during run time and process them in parallel. This also allows for coupling threaded commands together thereby creating critical sections and other common multithreading techniques utilized in C++ coding.
Focus will also be placed on design consideration and operation performance. An example will be show that demonstrates how the proper coding style and data structures can make or break your design. Also timing and performance standards will be given for various browsers so users can understand the overall overhead and operational considerations that need to be considered when using threads in a browser based environment.
Technology and capability limitations will also be discussed so developers can understand the differences between multithreading in C++ native applications and JavaScript browser-based application. This will also include some tricks on how to design an architecture that allows for some workarounds. Other JavaScript APIs such as WebGL, and WebSockets will also be discussed and demonstrated to help show the full realization of a web based game engine.
Coding samples and architectural layouts will be shown to the audience to help drive home the concepts being discussed during the lecture. A functional HTML5 JavaScript Multithreaded Web Engine will be demonstrated during the lectured to show the overall functionality and performance of the techniques described.
A summary write up of a sample engine architecture is attached in the supplemental documents that gives a brief description and architectural figures. These will be integrated into the lecture to help visualize some of the concepts being discussed.
C programming & data structure [character strings & string functions]MomenMostafa
The document provides information about C programming language and data structures. It includes references to books and websites on the topics. The document outlines topics that will be covered, including arrays and pointers, strings and string functions, structures, algorithms, stacks, queues and trees. It then gives details on a lesson about string functions, including examples of gets(), puts(), fgets() and other standard library string functions.
This document provides an overview of C++ and object-oriented programming concepts. It discusses:
1. C++ is an object-oriented programming language introduced in the 1980s that retains the power of C and adds classes, inheritance, function overloading, and operator overloading.
2. OOP languages like C++ are well-suited for developing large, complex programs like editors, compilers, databases, and communication systems due to features like modularity and code reusability.
3. A simple C++ program is presented that demonstrates basic syntax like main(), comments, cout and << operators, and return type for main(). Classes and member functions are also introduced.
C programming & data structure [arrays & pointers]MomenMostafa
This document provides an overview of arrays and pointers in C programming. It defines arrays as a series of elements of the same data type. Arrays can be initialized, accessed using subscripts, and their size determined. Multidimensional arrays contain arrays as elements. Pointers offer an efficient way to work with arrays, as array notation is equivalent to pointer notation. Functions can operate on arrays by passing a pointer to the first element as a parameter.
This document provides an overview of topics related to C programming language and data structures. It begins with a list of references and introduces the author. It then outlines topics that will be covered, including arrays and pointers, strings, storage classes and memory management, file I/O, structures, bit manipulation, preprocessing, algorithms, stacks, queues, and trees. The document focuses on keywords like auto, extern, static, register, const, and volatile. It discusses functions like rand(), srand(), time(), malloc(), calloc(), and free(). It also covers designing multi-file programs and variable scopes, linkages, storage durations, and memory allocation.
The document provides an introduction to the C programming language. It discusses C's history, origins in the development of UNIX, data types, variables, constants, operators, input/output functions, conditional statements, and loops. It also provides 10 examples of C programs covering topics like calculating sums, finding prime and palindrome numbers, temperature conversion, and linear/binary search.
This document provides an introduction and overview for a course on programming in C++. It discusses the goals of the course, which are to teach programming principles and the C++ language. Students will learn essential concepts like variables, data types, functions, and arrays. They will write increasingly complex programs and develop good programming style. The course will be assessed through quizzes, exams, and class projects. Topics to be covered include variables, input/output, control flow, arrays, pointers, strings, and file I/O. Good programming practices like readability, simplicity, and avoiding reinventing solutions are emphasized.
Programming is hard. Programming correct C and C++ is particularly hard. Indeed, both in C and certainly in C++, it is uncommon to see a screenful containing only well defined and conforming code.Why do professional programmers write code like this? Because most programmers do not have a deep understanding of the language they are using.While they sometimes know that certain things are undefined or unspecified, they often do not know why it is so. In these slides we will study small code snippets in C and C++, and use them to discuss the fundamental building blocks, limitations and underlying design philosophies of these wonderful but dangerous programming languages.
This content has a CC license. Feel free to use it for whatever you want. You may download the original PDF file from: http://www.pvv.org/~oma/DeepC_slides_oct2012.pdf
The document discusses C# and the .NET framework. It covers:
- The goals and components of the .NET framework, including the common language runtime (CLR) and class library.
- Key concepts in .NET like value types, reference types, boxing/unboxing, and the unified type system.
- Features that enable component-oriented development in C# like properties, events, and attributes.
- Productivity features of C# like parameter arrays, ref/out parameters, and foreach loops.
This document compares the programming languages Java and C#. It discusses that C# was developed with the .NET framework in mind and is intended to be the primary language for .NET development. It outlines some subtle syntactic differences between the languages, like how print statements and inheritance are defined. It also examines some concepts that are modified in C# compared to Java, such as polymorphism and operator overloading. Finally, it presents some new concepts in C# that do not exist in Java, including enums, foreach loops, and properties.
Sometimes you see code that is perfectly OK according to the definition of the language, but which is flawed because it breaks too many established idioms and conventions. On the other hand, a solid piece of code is something that looks like it is written by an experienced person who cares about professionalism in programming.
A presentation at Norwegian Developer Conference 2010
This document provides an overview of pointers in C programming. It discusses seven rules for pointers, including that pointers are integer variables that store memory addresses, how to dereference and reference pointers, NULL pointers, and arithmetic operations on pointers. It also covers dynamic memory allocation using malloc, calloc, realloc, and free and different approaches to 2D arrays. Finally, it discusses function pointers and their uses, including as callback functions.
Presentation on C++ Programming Languagesatvirsandhu9
This document provides an overview of the C++ programming language. It discusses why C++ is used, how it compares to Fortran, and the basic structure and components of a C++ program. The key topics covered include data types, variables, operators, selection statements, iteration statements, functions, arrays, pointers, input/output, preprocessor instructions, and comments. The document is intended to teach the basics of C++ programming in a structured way over multiple sections.
The presentation shows major features of the new C++ standard (language and the library). The full list of new things is very broad, so I've categorized them to be easier to understand.
This document provides an introduction to C programming over 13 pages. It covers the purpose and schedule of the lectures, differences between C and Java, C program structure, keywords, variables, data types, and more. The main points are that the lectures will provide a crash course in C with an emphasis on differences from Java, cover practical examples and topics related to C programming, and include history, language overview, pointers, memory management, compiling and debugging.
This document discusses the implementation of digital filters in fixed-point arithmetic on embedded systems. It presents the need for methodology and tools to design fixed-point embedded filter systems. The key steps are: 1) choosing a filter algorithm, 2) rounding coefficients to fixed-point, and 3) implementing the algorithm. Optimal implementations minimize degradation from quantization errors while meeting resource constraints. The document outlines a global flow from filter design to code generation and optimization.
This PPT is intended to provide a thorough coverage of verilog HDL concepts based on fundamental principles of digital design. This is the basic fundamental concept for the programming of the digital electronics.
This document discusses algorithms and data structures. It covers the requirements of algorithms including inputs, outputs, unambiguousness, generality, correctness, being finite, and efficiency. It also discusses representing algorithms through pseudo-code and flowcharts. Some key aspects of pseudo-code are described such as its purpose to define algorithms simply and its use of limited vocabulary and English-like notation. Common control structures like sequence, selection, and repetition are explained. Examples of bubble sort, selection sort, and insertion sort algorithms are also mentioned.
The document discusses the history of functional programming from 1903 to the present. It covers early developments like the lambda calculus in the 1930s and languages like Lisp in 1958. It also discusses key people who advanced functional programming like Alonzo Church, John McCarthy, and John Backus. The document then covers important milestones in functional programming languages between 1936 and 2013. It discusses concepts like purity, higher-order functions, and how functional programming relates to object-oriented programming.
VTU 1ST SEM PROGRAMMING IN C & DATA STRUCTURES SOLVED PAPERS OF JUNE-2015 & ...vtunotesbysree
The document contains solved question papers from June 2015 and December 2015 for Programming in C & Data Structures examinations. It includes questions ranging from basic C programming concepts like data types, operators, decision making and looping statements to more advanced topics such as arrays, strings, structures, files and pointers. For each question, the relevant concept is explained and examples are provided. Solutions for some programming problems involving simple calculations, palindrome checks and file handling are also presented.
Over the past two years, Unreal Engine 4 has received many new features and improvements including enhanced editor tutorials, camera animation tools, ambient occlusion techniques, shadowing for translucent materials, 2D artwork tools, behavior trees, ray tracing, sub-surface scattering, landscape tools, particle collision with meshes, mobile development improvements, virtual reality support, animation tools, foliage rendering, multi-threading, and post-processing effects. The document provides a high-level overview of the significant updates to Unreal Engine 4 in the past two years based on the numerous new features that have been added.
Building a Multithreaded Web-Based Game Engine Using HTML5/CSS3 and JavaScrip...Corey Clark, Ph.D.
As hardware developer’s push away from creating faster processors in lieu of multicore architectures game developers have to leverage multithreading technologies to capitalize on these new devices. With multicore mobile devices the need for a multithreaded web based game engine is a reality. This talk will discuss design of various multithreaded web engine architectures. Two specific threading implementations will be discussed. First technique shows how to create a static thread that is registered with the engine with the same techniques as other loaded resource. A second technique will focus on using a Thread Controller, which has the ability to create dynamic generic threads that can be passed functions during run time and process them in parallel. This also allows for coupling threaded commands together thereby creating critical sections and other common multithreading techniques utilized in C++ coding.
Focus will also be placed on design consideration and operation performance. An example will be show that demonstrates how the proper coding style and data structures can make or break your design. Also timing and performance standards will be given for various browsers so users can understand the overall overhead and operational considerations that need to be considered when using threads in a browser based environment.
Technology and capability limitations will also be discussed so developers can understand the differences between multithreading in C++ native applications and JavaScript browser-based application. This will also include some tricks on how to design an architecture that allows for some workarounds. Other JavaScript APIs such as WebGL, and WebSockets will also be discussed and demonstrated to help show the full realization of a web based game engine.
Coding samples and architectural layouts will be shown to the audience to help drive home the concepts being discussed during the lecture. A functional HTML5 JavaScript Multithreaded Web Engine will be demonstrated during the lectured to show the overall functionality and performance of the techniques described.
A summary write up of a sample engine architecture is attached in the supplemental documents that gives a brief description and architectural figures. These will be integrated into the lecture to help visualize some of the concepts being discussed.
Modeling Patterns for JavaScript Browser-Based GamesRay Toal
This document proposes JavaScript patterns for modeling browser-based game objects and types without using frameworks. It describes challenges for browser games and recent advances in JavaScript. Patterns are presented for modules, types, and inheritance using prototypes instead of classes. A root game object type and projectile subtype are implemented as examples. The patterns were applied in an HTML5 game and several JavaScript game engines are surveyed.
Microservices involve breaking up monolithic applications into smaller, independent services that work together. This allows for increased efficiency through scaling individual services as needed, easier updates by updating smaller code bases, and improved stability if one service fails. Containers are well-suited for microservices due to their lightweight nature and ability to easily move workloads.
Motivational overview for why the medical image analysis need a volumetric equivalent of popular ImageNet database used in benchmarking deep learning architectures, and as a basis for transfer learning when not enough data is available for training the deep learning from scratch
Deploying deep learning models with Docker and KubernetesPetteriTeikariPhD
Short introduction for platform agnostic production deployment with some medical examples.
Alternative download: https://www.dropbox.com/s/qlml5k5h113trat/deep_cloudArchitecture.pdf?dl=0
Some resources how to navigate in the hardware space in order to build your own workstation for training deep learning models.
Alternative download link: https://www.dropbox.com/s/o7cwla30xtf9r74/deepLearning_buildComputer.pdf?dl=0
The document discusses variadic templates in C++, including their fundamentals like parameter packs, common uses cases, and examples of how to work with parameter packs. It also covers variadic templates in more depth including expansion rules, where they are commonly used, and how to handle multiple expansions. The document concludes with an example of how variadic templates can be used to implement a typesafe printf function in C++.
Templates in C++ allow functions and classes to operate on different data types in a generic way. Function templates define generic functions that can work on different types, while class templates define generic classes. Templates promote code reuse by defining functions and classes independently of specific types. Function templates and class templates can be overloaded and classes can inherit from class templates.
Templates in C++ allow the construction of generic functions and classes that can work with different data types. Some key points:
- Templates support generic programming and reusable components like functions and classes that can handle different data types.
- Function templates define functions that can work with a generic data type T, while class templates define classes that can work with generic data types.
- Templates allow defining functions and classes like stacks once that can work with data types like int, float, char etc. instead of separate definitions for each type.
PHP Barcelona 2010 - Architecture and testabilityGiorgio Sironi
This document discusses techniques for improving code testability and maintainability. It recommends:
1. Applying SOLID principles like the single responsibility principle and dependency injection to reduce coupling and improve cohesion.
2. Avoiding direct static method calls and singleton patterns in favor of dependency injection as it allows dependencies to be mocked/stubbed for testing.
3. Following the law of Demeter to avoid excessive coupling between classes.
4. Using factories instead of singletons to allow injecting fakes/mocks for testing. Testing first and listening to tests results in more maintainable code.
Question 1 1 pts Skip to question text.As part of a bank account.docxamrit47
Question 1 1 pts Skip to question text.
As part of a bank account implementation, there is an account class and a checking account class. These two classes should be related by:
polymorphism
abstract classes
both composition and inheritance
inheritance
composition
Flag this Question
Question 2 1 pts
When using OOP, which of the following terms refers to a mechanism for a behavior, basically how it’s implemented?
composition
inheritance
polymorphism
dynamic binding
Flag this Question
Question 3 1 pts
To access an element in an Array object,
Use the ArrayList's get() method.
Use the ArrayList's element() method.
Individual elements in an ArrayList can’t be accessed without doing a sequential query getSequential(), returning every element up to and including the element requested.
Use square brackets around an index value.
Flag this Question
Question 4 1 pts
To access an element in an ArrayList object,
Use square brackets around an index value.
Use the ArrayList element() method.
Use the ArrayList get() method.
Individual elements in an ArrayList can’t be accessed without doing a sequential query getSequential(), returning every element up to and including the element requested.
Flag this Question
Question 5 1 pts
What term below is defined as a message that tells the program that something has happened?
an interaction
a listener
an action
an event
Flag this Question
Question 6 1 pts
Which item below is defined as an object?
A String
An Array
All of the above
An ArrayList
Flag this Question
Question 7 1 pts
When a text-box-enter event occurs, which method and parameter are required to handle this type of action? (1 point)
actionEvent with an actionperformed parameter
actionListener with an interfaceID parameter
windowListener with an eventID parameter
actionPerformed with an actionEvent parameter
Flag this Question
Question 8 1 pts
Which class includes the setTitle and setSize methods?
JFrame
JWindow
JBox
JOptionpane
Flag this Question
Question 9 1 pts
Before utilizing the binary search method, __________ must be done to the array?
indexing
splitting
sorting
importing
Flag this Question
Question 10 1 pts
Which layout manager implements a one-compartment layout scheme?
GridlessLayout
GridBagLayout
GridLayout
FlowLayout
BorderLayout
Flag this Question
Question 11 1 pts
What is the default layout manager for a JFrame window?
GridBagLayout
GridLayout
FlowLayout
GridlessLayout
BorderLayout
Flag this Question
Question 12 1 pts
To call the superclass constructor, super() must be the first line in a constructor.
True
False
Flag this Question
Question 13 1 pts
Method overriding is when a method has the same name, same sequence of parameter types, and the same return type as a method in a superclass.
True
False
Flag this Question
Question 14 1 pts
Type casting, also known as promotion is ...
The document discusses the present and future of metaprogramming in Scala. It describes scala.reflect, the current metaprogramming API, and its limitations. The future scala.meta API aims to have an independent language model, use hygienic quasiquotes for syntax trees, and make compiler syntax trees persistent. The new API design is being validated and will likely be available as a compiler plugin next year.
This document provides an overview of generics in C# including:
- Creating generic classes and interfaces
- Features of generics such as default values, constraints, inheritance, and static members
- Performance and type safety benefits compared to non-generic collections
- Examples of generic methods, covariance/contravariance in generic interfaces, and naming guidelines for generics
Some of the most common and easy-to-calculate/easy-to-measure code metrics. Understanding these can help you make your code better: avoiding code rot and writing maintainable code all starts here. Content is created for C# .net, however, the underlying principles apply to other languages/frameworks as well.
This document contains an agenda for a SQL Saturday session on .NET fundamentals by Mike Huguet. The session will cover generics, extension methods, lambda expressions, and LINQ. It will introduce these concepts and enhance attendees' knowledge of them. The document provides definitions and examples of each concept. It also outlines the timeline of when they were introduced in the .NET framework and how they can increase developer productivity.
The document discusses various concepts related to abstraction in software development including project architecture, code refactoring, enumerations, and the static keyword in Java. It describes how to split code into logical parts using methods and classes to improve readability, reuse code, and avoid repetition. Refactoring techniques like extracting methods and classes are presented to restructure code without changing behavior. Enumerations are covered as a way to represent numeric values from a fixed set as text. The static keyword is explained for use with classes, variables, methods, and blocks to belong to the class rather than object instances.
Templates and Exception Handling in C++Nimrita Koul
This document discusses templates and exception handling in C++. It provides an overview of templates, including why they are used for generic programming and how to define function and class templates. Exception handling in C++ uses try, catch, and throw blocks. The try block contains code that may throw exceptions, catch blocks handle specific exceptions, and throw explicitly throws an exception. The document contains examples of templates, exception handling, and derived class exceptions. It also discusses opportunities available at the School of CIT at Reva University.
The document describes a meetup organized by Cork Software Crafters on breaking dependencies in legacy code. The meetup agenda includes a welcome from 6:15-6:30pm, an introduction from 6:30-6:45pm, hands-on time from 6:45-8:00pm, and a retrospective from 8:00pm to discuss solutions. The facilitator is Paulo Clavijo and participants are encouraged to suggest new topics and hands-on sessions for future meetups.
Implementation details and performance traits of generics in .NET, Java and C++. Presentation for the Jerusalem .NET/C++ User Group by Sasha Goldshtein.
The document provides information on the C programming language. It discusses that C was developed by Dennis Ritchie at Bell Labs in 1972 and is a general purpose programming language well suited for business and scientific applications. It describes the basic structure of a C program including sections for links, definitions, variables, functions, and input/output statements. It also covers various C language concepts like data types, operators, decision making statements, looping statements, functions, and more.
Writing clean code using test-driven development (TDD) involves:
1. Writing small, focused unit tests before writing the code to make them pass;
2. Iteratively writing just enough code to pass each test, then refactoring the code;
3. Following principles of clean code like using meaningful names, short functions that do one thing well, and formatting for readability.
The presentation demonstrated converting Roman numerals to Arabic using TDD, highlighting benefits like producing readable, maintainable code with test coverage and living documentation.
ScyllaDB is making a major architecture shift. We’re moving from vNode replication to tablets – fragments of tables that are distributed independently, enabling dynamic data distribution and extreme elasticity. In this keynote, ScyllaDB co-founder and CTO Avi Kivity explains the reason for this shift, provides a look at the implementation and roadmap, and shares how this shift benefits ScyllaDB users.
This talk will cover ScyllaDB Architecture from the cluster-level view and zoom in on data distribution and internal node architecture. In the process, we will learn the secret sauce used to get ScyllaDB's high availability and superior performance. We will also touch on the upcoming changes to ScyllaDB architecture, moving to strongly consistent metadata and tablets.
"Scaling RAG Applications to serve millions of users", Kevin GoedeckeFwdays
How we managed to grow and scale a RAG application from zero to thousands of users in 7 months. Lessons from technical challenges around managing high load for LLMs, RAGs and Vector databases.
Getting the Most Out of ScyllaDB Monitoring: ShareChat's TipsScyllaDB
ScyllaDB monitoring provides a lot of useful information. But sometimes it’s not easy to find the root of the problem if something is wrong or even estimate the remaining capacity by the load on the cluster. This talk shares our team's practical tips on: 1) How to find the root of the problem by metrics if ScyllaDB is slow 2) How to interpret the load and plan capacity for the future 3) Compaction strategies and how to choose the right one 4) Important metrics which aren’t available in the default monitoring setup.
AI in the Workplace Reskilling, Upskilling, and Future Work.pptxSunil Jagani
Discover how AI is transforming the workplace and learn strategies for reskilling and upskilling employees to stay ahead. This comprehensive guide covers the impact of AI on jobs, essential skills for the future, and successful case studies from industry leaders. Embrace AI-driven changes, foster continuous learning, and build a future-ready workforce.
Read More - https://bit.ly/3VKly70
Lee Barnes - Path to Becoming an Effective Test Automation Engineer.pdfleebarnesutopia
So… you want to become a Test Automation Engineer (or hire and develop one)? While there’s quite a bit of information available about important technical and tool skills to master, there’s not enough discussion around the path to becoming an effective Test Automation Engineer that knows how to add VALUE. In my experience this had led to a proliferation of engineers who are proficient with tools and building frameworks but have skill and knowledge gaps, especially in software testing, that reduce the value they deliver with test automation.
In this talk, Lee will share his lessons learned from over 30 years of working with, and mentoring, hundreds of Test Automation Engineers. Whether you’re looking to get started in test automation or just want to improve your trade, this talk will give you a solid foundation and roadmap for ensuring your test automation efforts continuously add value. This talk is equally valuable for both aspiring Test Automation Engineers and those managing them! All attendees will take away a set of key foundational knowledge and a high-level learning path for leveling up test automation skills and ensuring they add value to their organizations.
"NATO Hackathon Winner: AI-Powered Drug Search", Taras KlobaFwdays
This is a session that details how PostgreSQL's features and Azure AI Services can be effectively used to significantly enhance the search functionality in any application.
In this session, we'll share insights on how we used PostgreSQL to facilitate precise searches across multiple fields in our mobile application. The techniques include using LIKE and ILIKE operators and integrating a trigram-based search to handle potential misspellings, thereby increasing the search accuracy.
We'll also discuss how the azure_ai extension on PostgreSQL databases in Azure and Azure AI Services were utilized to create vectors from user input, a feature beneficial when users wish to find specific items based on text prompts. While our application's case study involves a drug search, the techniques and principles shared in this session can be adapted to improve search functionality in a wide range of applications. Join us to learn how PostgreSQL and Azure AI can be harnessed to enhance your application's search capability.
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...Jason Yip
The typical problem in product engineering is not bad strategy, so much as “no strategy”. This leads to confusion, lack of motivation, and incoherent action. The next time you look for a strategy and find an empty space, instead of waiting for it to be filled, I will show you how to fill it in yourself. If you’re wrong, it forces a correction. If you’re right, it helps create focus. I’ll share how I’ve approached this in the past, both what works and lessons for what didn’t work so well.
"$10 thousand per minute of downtime: architecture, queues, streaming and fin...Fwdays
Direct losses from downtime in 1 minute = $5-$10 thousand dollars. Reputation is priceless.
As part of the talk, we will consider the architectural strategies necessary for the development of highly loaded fintech solutions. We will focus on using queues and streaming to efficiently work and manage large amounts of data in real-time and to minimize latency.
We will focus special attention on the architectural patterns used in the design of the fintech system, microservices and event-driven architecture, which ensure scalability, fault tolerance, and consistency of the entire system.
The Department of Veteran Affairs (VA) invited Taylor Paschal, Knowledge & Information Management Consultant at Enterprise Knowledge, to speak at a Knowledge Management Lunch and Learn hosted on June 12, 2024. All Office of Administration staff were invited to attend and received professional development credit for participating in the voluntary event.
The objectives of the Lunch and Learn presentation were to:
- Review what KM ‘is’ and ‘isn’t’
- Understand the value of KM and the benefits of engaging
- Define and reflect on your “what’s in it for me?”
- Share actionable ways you can participate in Knowledge - - Capture & Transfer
QR Secure: A Hybrid Approach Using Machine Learning and Security Validation F...AlexanderRichford
QR Secure: A Hybrid Approach Using Machine Learning and Security Validation Functions to Prevent Interaction with Malicious QR Codes.
Aim of the Study: The goal of this research was to develop a robust hybrid approach for identifying malicious and insecure URLs derived from QR codes, ensuring safe interactions.
This is achieved through:
Machine Learning Model: Predicts the likelihood of a URL being malicious.
Security Validation Functions: Ensures the derived URL has a valid certificate and proper URL format.
This innovative blend of technology aims to enhance cybersecurity measures and protect users from potential threats hidden within QR codes 🖥 🔒
This study was my first introduction to using ML which has shown me the immense potential of ML in creating more secure digital environments!
Essentials of Automations: Exploring Attributes & Automation ParametersSafe Software
Building automations in FME Flow can save time, money, and help businesses scale by eliminating data silos and providing data to stakeholders in real-time. One essential component to orchestrating complex automations is the use of attributes & automation parameters (both formerly known as “keys”). In fact, it’s unlikely you’ll ever build an Automation without using these components, but what exactly are they?
Attributes & automation parameters enable the automation author to pass data values from one automation component to the next. During this webinar, our FME Flow Specialists will cover leveraging the three types of these output attributes & parameters in FME Flow: Event, Custom, and Automation. As a bonus, they’ll also be making use of the Split-Merge Block functionality.
You’ll leave this webinar with a better understanding of how to maximize the potential of automations by making use of attributes & automation parameters, with the ultimate goal of setting your enterprise integration workflows up on autopilot.
How information systems are built or acquired puts information, which is what they should be about, in a secondary place. Our language adapted accordingly, and we no longer talk about information systems but applications. Applications evolved in a way to break data into diverse fragments, tightly coupled with applications and expensive to integrate. The result is technical debt, which is re-paid by taking even bigger "loans", resulting in an ever-increasing technical debt. Software engineering and procurement practices work in sync with market forces to maintain this trend. This talk demonstrates how natural this situation is. The question is: can something be done to reverse the trend?
2. Motivation and Scope
Generic Programming
Optimizations through Specialisations
... but how to specialize ?
What we want is Concepts (based overloads)
1 of 37
3. Motivation and Scope
Generic Programming
Optimizations through Specialisations
... but how to specialize ?
What we want is Concepts (based overloads)
Introducing Boost.Dispacth
Generic way to handle specializations and related optimizations
Minimize code duplication by an expressive definition of types constraints
Increase applicability of Tag Dispatching
1 of 37
4. What’s in this talk ?
Overloads, SFINAE, Tag Dispatching, Oh My ...
Why overloads in C++ are that useful
Getting further with SFINAE
Tag Dispatching Unplugged
2 of 37
5. What’s in this talk ?
Overloads, SFINAE, Tag Dispatching, Oh My ...
Why overloads in C++ are that useful
Getting further with SFINAE
Tag Dispatching Unplugged
Introducing Boost.Dispatch
Motivation and Rationale
The Generic Hierarchy System
The Generic Function Caller
Unusal Hierarchies
Trivial and non-trivial use cases
2 of 37
8. Function Overloading Rules
General Process [1]
The name is looked up to form an initial Overload Set.
If necessary, this set is tweaked in various ways.
Any candidate that doesn’t match the call at all is eliminated from the
overload set, building the Viable Set.
Overload resolution is performed to find the Best Viable Function.
The selected candidate is checked and potential diagnostic is issued.
[1] C++ Templates: The Complete Guide – David Vandevoorde, Nicolai M. Josuttis
4 of 37
9. Function Overloading Rules
General Process [1]
The name is looked up to form an initial Overload Set.
If necessary, this set is tweaked in various ways.
Any candidate that doesn’t match the call at all is eliminated from the
overload set, building the Viable Set.
Overload resolution is performed to find the Best Viable Function.
The selected candidate is checked and potential diagnostic is issued.
What to do with that ?
What are the rule for building the Overload Set (Ω)?
How to define the ”Best Candidate” ?
[1] C++ Templates: The Complete Guide – David Vandevoorde, Nicolai M. Josuttis
4 of 37
10. All Glory to the Overload Set
Building Ω
Add all non-template functions with the proper name
Add all template functions once template resolution is successful
Notes
Ω is a lattice: non-template supersede template functions
We need to refine what a success means for template functions
All of this use ADL if needed
5 of 37
11. Finding nemo()
Best Viable Function selection process
Determine the Implicit Conversion Sequence (ICS) for each arguments
Categorize and rank them
If any argument fails this process, compiler frowns.
6 of 37
12. Finding nemo()
The Implicit Conversion Sequence (ICS)
Standard conversion sequences
Exact match
Promotion
Conversion
User-defined conversion sequences defined as:
A standard conversion sequence
A user-defined conversion
A second standard conversion sequence
An UDCS is better than an other if it has the same UDC but a better
second SCS
Ellipsis conversion sequences
6 of 37
15. Substitution Failures Are What ???
template <typename Container >
typename Container :: size_type f(Container const &)
{
return c.size ();
}
int main ()
{
std ::vector <double > v(4);
f(v);
f(1); /// OMG Incoming Flaming Errors of Doom
}
8 of 37
16. Substitution Failures Are What ???
template <typename Container >
typename Container :: size_type f(Container const &)
{
return c.size ();
}
int main ()
{
std ::vector <double > v(4);
f(v);
f(1); /// OMG Incoming Flaming Errors of Doom
}
error: no matching function for call to ’f(int)’
8 of 37
17. Substitution Failures Are What ???
Definition
We want generate Ω for a given function
Some of the candidates functions are result of a template substitution
If this substitution fails, the function is removed from Ω and no error are emited
If at Ω ends up non ambiguous and not empty, we proceeed to the next step
9 of 37
18. SFINAE in practice - Rebuilding enable if
template <bool Condition , typename Result = void >
struct enable_if;
template <typename Result >
struct enable_if <true ,Result >
{
typedef Result type;
};
10 of 37
19. SFINAE in practice - Rebuilding enable if
template <typename T>
typename enable_if <( sizeof(T) >2) >::type
f( T const& )
{
cout << "That ’s a big type you have there !n";
}
template <typename T>
typename enable_if <( sizeof(T) <=2) >::type
f( T const& )
{
cout << "Oooh what a cute type !n";
}
11 of 37
20. SFINAE in practice - The dreadful enable if type
template <typename Type , typename Result = void >
struct enable_if_type
{
typedef Result type;
};
template <typename T, typename Enable = void > struct size_type
{
typedef std :: size_t type;
};
template <typename T> struct size_type <T,typename
enable_if_type <typename T:: size_type >:: type
{
typedef typename T:: size_type type;
};
12 of 37
21. SFINAE in practice - Type traits definition
template <typename T>
struct is_class
{
typedef char yes_t
typedef struct { char a[2]; } no_t;
template <typename C> static yes_t test(int C::*);
template <typename C> static no_t test (...);
static const bool value = sizeof(test <T >(0)) == 1;
};
13 of 37
22. Tag Dispatching
Limitation of SFINAE
Conditions must be non-overlapping
Difficult to extend
Compilation is O(N) with number of cases
Principles of Tag Dispatching
Categorize family of type using a tag hierarchy
Easy to extend : add new category and/or corresponding overload
Uses overloading rules to select best match
Poor man’s Concept overloading
14 of 37
24. Tag Dispatching - std::advance
namespace std
{
namespace detail
{
template <class InputIterator , class Distance >
void advance_dispatch ( InputIterator & i
, Distance n
, input_iterator_tag const&
)
{
assert(n >=0);
while (n--) ++i;
}
}
}
15 of 37
25. Tag Dispatching - std::advance
namespace std
{
namespace detail
{
template <class BidirectionalIterator , class Distance >
void advance_dispatch ( BidirectionalIterator & i
, Distance n
, bidirectional_iterator_tag const&
)
{
if (n >= 0)
while (n--) ++i;
else
while (n++) --i;
}
}
}
15 of 37
26. Tag Dispatching - std::advance
namespace std
{
namespace detail
{
template <class RandomAccessIterator , class Distance >
void advance_dispatch ( RandomAccessIterator & i
, Distance n
, random_access_iterator_tag const&
)
{
i += n;
}
}
}
15 of 37
27. Tag Dispatching - std::advance
namespace std
{
template <class InputIterator , class Distance >
void advance( InputIterator & i, Distance n)
{
typename iterator_traits <InputIterator >:: iterator_category
category;
detail :: advance_dispatch (i, n, category);
}
}
15 of 37
28. Boost.Dispatch
From NT2, Boost.SIMD to Boost.Dispatch
NT2 and Boost.SIMD use fine grain function overload for performances reason
Problem was : NT2 is 500+ functions over 10+ architectures
How can we handle this amount of overloads in an extensible way ?
Our Goals
Provide a generic entry point for tag dispatching
Provide base hierarchy tags for useful types (including Fusion and Proto types)
Provide a way to categorize functions and architecture properties
Provide a generic ”dispatch me this” process
16 of 37
29. Boost.Dispatch - Hierarchy
The Hierarchy Concept
H models Hierarchy if
H inherits from another Hierarchy P
H::parent evaluates to P
Usually Hierarchy are template types carrying the type they
hierarchize
Hierarchy are topped by an unspecified <T> hierarchy
17 of 37
31. Boost.Dispatch - hierarchy of
How to access hierarchy of a given type ?
hierarchy of is a meta-function giving you the hierarchy of a type
hierarchy of is extendable by specialization or SFINAE
Currently tied to NT2 view of things
Example - f(T t)
returns 1/t if it’s a floating point value
returns -t if it’s a signed integral value
returns t otherwise
18 of 37
32. Boost.Dispatch - hierarchy of example
template <typename T> T f_( T const& t, scalar_ <real_ <T>> )
{
return T(1)/t;
}
template <typename T> T f_( T const& t, scalar_ <signed_ <T>> )
{
return -t;
}
template <typename T> T f_( T const& t
, scalar_ <unspecified_ <T>> )
{
return t;
}
template <typename T> T f( T const& t )
{
return f_(t, hierarchy_of <T>:: type ());
}
19 of 37
34. Boost.Dispatch - The basic types hierarchy
Register types informations
Basic types hierarchy is built on top of one of the previous properties
If the types is regular, its hierarchy is wrapped by scalar <.>
If not,special wrappers are used.
Both scalar <.> and other wrapper goes into generic <.>
Application
simd <.> helps hierarchizing native SIMD types
If you have code looking the same for scalar and SIMD, dispatch on
generic <.>
One can think of having stuff like vliw <.> or proxy <.> wrappers
21 of 37
35. Boost.Dispatch - Other useful hierarchies
Array and Fusion Sequence
fusion sequence<T> hierarchizes all Fusion Sequence type
array<T,N> hierarchizes all array types
array<T,N> is obviously a sub-hierarchy from fusion sequence<T>
Proto Expressions
expr <T,Tag,N>is a proto AST with all informations available
node <T,Tag,N,D> is a proto AST on which the tag is hierarchized
ast <T,D> represents any Proto AST.
22 of 37
36. Boost.Dispatch - Gathering functions properties
Our Motivation
Parallel code can be refactored using Parallel Skeletons
A lot of functions share implementations
How can we know about a function properties ?
23 of 37
37. Boost.Dispatch - Gathering functions properties
Our Motivation
Parallel code can be refactored using Parallel Skeletons
A lot of functions share implementations
How can we know about a function properties ?
Solution : Functions Tag
Associate a type to each function
Give a hierarchy to this tag
Make those functions hierarchy useful
23 of 37
38. Boost.Dispatch - Function Tag examples
template <class Tag , class U, class B, class N>
struct reduction_ : unspecified_ <Tag > { ... };
template <class Tag >
struct elementwise_ : unspecified_ <Tag > { ... };
struct plus_ : elementwise_ <plus_ > { ... };
struct sum_ : reduction_ <sum_ , sum_ , plus_ , zero_ > { ... };
24 of 37
39. Boost.Dispatch - Gathering architectures properties
Our Motivation (again)
Drive optimization by knowledge of the architecture
Embed this knowledge into the dispatching system
Allow for architecture description to be derived
Solution : Architectural Tag
All traditional architectural element is a tag
Those tag can be compound Hierarchy
Make function use the current architecture tag as an additional hidden
parameters
25 of 37
41. Boost.Dispatch - Putting it together
dispatch call
Gather information about the function and the architecture
Computes the hierarchization of function parameters
Dispatch to an externally defined implementation
functor
Generic tag based functor
Encapsulate dispatch call calls
TR1 compliant functor
27 of 37
42. Boost.Dispatch - plus
template <typename A, typename B>
auto plus(A const& a, B const& b)
-> decltype(dispatch_call < plus_(A const&, B const &)
, typename default_site <plus_ >::
type
>::type ()(a,b)
)
{
return typename dispatch_call < plus_(A const&, B const &)
, typename default_site <plus_
>:: type
>::type ()(a,b);
};
28 of 37
43. Boost.Dispatch - plus
template <typename A, typename B>
auto plus(A const& a, B const& b)
-> decltype(functor <plus_ >()(a,b))
{
functor <plus_ > callee;
return calle(a,b);
};
28 of 37
44. Boost.Dispatch - plus
BOOST_SIMD_FUNCTOR_IMPLEMENTATION ( plus_ ,cpu_ , (A0)
, (( scalar_ <unspecified_ <A0 >>))
(( scalar_ <unspecified_ <A0 >>))
)
{
auto operator ()(A0 const& a, A0 const& b) const
-> decltype(a+b)
{
return a+b;
}
};
29 of 37
45. Boost.Dispatch - plus
BOOST_SIMD_FUNCTOR_IMPLEMENTATION ( plus_ ,sse2_ , (A0)
, ((simd_ <double_ <A0 >,sse_ >))
((simd_ <double_ <A0 >,sse_ >))
)
{
__m128d operator ()(__m128d a, __m128d b) const
{
return _mm_add_pd( a, b );
}
};
30 of 37
46. Boost.Dispatch - plus
BOOST_SIMD_FUNCTOR_IMPLEMENTATION ( plus_ ,cpu_ , (A0)(A1)
, (fusion_sequence <A0 >)
(fusion_sequence <A1 >)
)
{
auto operator ()(A0 const& a, A1 const& b) const
-> decltype(fusion :: transform(a,b, functor <plus_ >()))
{
return fusion :: transform(a,b, functor <plus_ >());
}
};
31 of 37
50. Wrapping this up
Tag Dispatching as a Tool
Good surrogate for Concept overloading
Scalable compile-time wise
Applicable with success to a lot of situations
Boost.Dispatch
Tag Dispatching on steroids
Function/Architecture Tag open up design space
Easy to extend and modularize
35 of 37
51. Future Works
Availability
Currently lives as a subcomponent of Boost.SIMD
Play with it from https://github.com/MetaScale/nt2
Opinions/Tests welcome
Remaining Challenges
Compile-time improvement
More generalization for hierarchy of
Make it works on more compilers
Submission to Boost review
36 of 37