Author: digitalmedium1

Differentiable Programming in C++ – Vassil Vassilev & William Moses – CppCon 2021

  • Lobby
  • Author Archives: digitalmedium1

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
Mathematical derivatives are vital components of many computing algorithms including: neural networks, numerical optimization, Bayesian inference, nonlinear equation solvers, physics simulations, sensitivity analysis, and nonlinear inverse problems. Derivatives track the rate of change of an output parameter with respect to an input parameter, such as how much reducing an individuals’ carbon footprint will impact the Earth’s temperature. Derivatives (and generalizations such as gradients, jacobians, hessians, etc) allow us to explore the properties of a function and better describe the underlying process as a whole. In recent years, the use of gradient-based optimizations such as training neural networks have become widespread, leading to many languages making differentiation a first-class citizen.

Derivatives can be computed numerically, but unfortunately the accumulation of floating-point errors and high-computational complexity presents several challenges. These problems become worse with higher order derivatives and more parameters to differentiate.

Many derivative-based algorithms require gradients, or the computation of the derivative of an output parameter with respect to many input parameters. As such, developing techniques for computing gradients that are scalable in the number of input parameters is crucial for the performance of such algorithms. This paper describes a broad set of domains where scalable derivative computations are essential. We make an overview of the major techniques in computing derivatives, and finally, we introduce the flagman of computational differential calculus -- algorithmic (also known as automatic) differentiation (AD). AD makes clever use of the ‘nice’ mathematical properties of the chained rule and generative programming to solve the scalability issues by inverting the dependence on the number of input variables to the number of output variables. AD provides mechanisms to augment the regular function computation with instructions calculating its derivatives.

Differentiable programming is a programming paradigm in which the programs can be differentiated throughout, usually via automatic differentiation. This talk introduces the differentiable programming paradigm in terms of C++. It shows its applications in science as applicable for data science and industry. The authors make an overview of the existing tools in the area and the two common implementation approaches -- template metaprogramming and custom parsers. We demonstrate implementation pros and cons and propose compiler toolchain-based implementation either in clang AST or LLVM IR. We would like to briefly outline our current efforts in standardization of that feature.

---
Vassil Vassilev & William Moses

---
Videos Streamed & Edited by Digital Medium: http://online.digital-medium.co.uk

The CppCon YouTube Channel Is Sponsored By:
JetBrains : http://jb.gg/cpptools
SonarSource: https://www.sonarsource.com/

Filed under: Science & Technology

Back to Basics: Move Semantics – Nicolai Josuttis – CppCon 2021

  • Lobby
  • Author Archives: digitalmedium1

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
Move semantics, introduced with C++11, has become a hallmark of modern C++ programming. However, it also complicates the language in some ways. For thisu reason it is key to understand move semantics (it purpose, its basic rules, and how to use them in practice).

This session teaches the basics of C++ move semantics. Based on the basic principles, it motivates and explains move semantics so that you as an application programmer you can use move semantics correctly und understand its use better.

---
Nicolai Josuttis

Nicolai Josuttis (http://www.josuttis.com) is well known in the programming community because he not only speaks and writes with authority (being the (co-)author of the world-wide best sellers The C++ Standard Library (www.cppstdlib.com), C++ Templates (www.tmplbook.com), C++17 - The Complete Guide (www.cppstd17.com), C++ Move Semantics - The Complete Guide (www.cppmove.com), and SOA in Practice), but is also an innovative presenter, having talked at various conferences and events.
He has been an active member of the C++ standards committee for more than 20 years.

---
Videos Streamed & Edited by Digital Medium: http://online.digital-medium.co.uk

The CppCon YouTube Channel Is Sponsored By:
JetBrains : http://jb.gg/cpptools
SonarSource: https://www.sonarsource.com/

Filed under: Science & Technology

Lessons Learned from Packaging 10,000+ C++ Projects – Bret Brown & Daniel Ruoso – CppCon 2021

  • Lobby
  • Author Archives: digitalmedium1

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
At Bloomberg, we maintain a system that coherently builds and integrates more than 10,000 C++ packages that are maintained independently by thousands of software engineers on hundreds of teams across our Engineering department. In this talk, we will go over the lessons we have learned about maintaining these packages, as well as how package management should interact with third-party libraries, third-party tools, build systems, IDEs, static analysis tools, and refactoring automation. We hope this will start a conversation around the potential requirements for a more complete package management solution in the C++ ecosystem.

---
Bret Brown
Software engineer currently focusing on improving C and C++ ergonomics, correctness, and productivity for Bloomberg's Developer Experience department.

Bret likes making authoring and maintaining C++ codebases simpler and more intuitive by treating projects more like cattle and less like pets. He is especially interested in the software development lifecycle, development automation, modern build systems, packaging, code transformation, software governance, and code analysis.
Bret worked in embedded C++ and safety critical C++ for previous employers.

Currently lead of Bloomberg's Build Tools team, responsible for tools such as CMake, pkg-config, and compilation toolchains.

Daniel Ruoso
Currently working as the lead for Code Governance at Bloomberg, where we focus on driving large scale Static Analysis and Automated Refactoring. Daniel has been working over the past 20+ years with a persistent lens on how to help engineers be more effective with build, deployment and analysis tooling on various different environments and languages.

---
Videos Filmed & Edited by Bash Films: http://www.BashFilms.com

YouTube Channel Managed by Digital Medium Ltd https://events.digital-medium.co.uk

The CppCon YouTube Channel Is Sponsored By:
JetBrains : http://jb.gg/cpptools
SonarSource: https://www.sonarsource.com/

Filed under: Science & Technology

GraphBLAS: Building a C++ Matrix API for Graph Algorithms – Benjamin Brock & Scott McMillan

  • Lobby
  • Author Archives: digitalmedium1

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
One of the most challenging issues in high-performance graph algorithms is dealing with bespoke graph data structures and algorithms, which can be difficult to optimize and maintain. The GraphBLAS is a mathematical and C API specification that allow programmers to implement graph algorithms using the language of linear algebra. Programmers implement their graph algorithms using high-level matrix and vector operations, such as generalized matrix and vector multiply. Their code can then be executed using matrix algorithms, such as sparse matrix multiply, that have been finely tuned, taking advantage of decades of research in optimizing sparse linear algebra for CPU, GPU, and distributed platforms.

In this talk, we discuss our efforts and experience building and implementing a C++ GraphBLAS API. We define a number of data structures, such as our GraphBLAS matrix type, which has a similar interface to `unordered_map`, but with a 2-D `key_type`, a fixed dimension, and possibly different backend storage data structures, depending on a collection of compile-time hints. We also define a collection of structs to represent various binary operators, monoids, and semirings used in graph algorithms. These are similar to the arithmetic operations defined in the STL's `functional`, but with extra type information to store a monoid's identity, and to promote pre-existing binary operators (such as STL's arithmetic ops) to monoids. We also discuss matrix views, the divorce of a specific arithmetic from the data structure (monoids and semirings being specifically associated with an operation, not a data structure, as a data structure may be used in multiple operations with different arithmetics), and generalized element-wise operations.

---
Benjamin Brock
Ben Brock is a PhD student at UC Berkeley, where he works on building libraries, tools, and algorithms for high-performance computing. His main work focuses on building a cross-platform library of data structures for distributed applications, with a focus on sparse linear algebra and graph algorithms. Ben is also a member of the GraphBLAS Languages Committee and is involved in drafting the C++ GraphBLAS API Specification.

Scott McMillan
Principal research engineer, Carnegie Mellon University
GraphBLAS: graph algorithms in the language of linear algebra

---
Videos Filmed & Edited by Bash Films: http://www.BashFilms.com

YouTube Channel Managed by Digital Medium Ltd https://events.digital-medium.co.uk

The CppCon YouTube Channel Is Sponsored By:
JetBrains : http://jb.gg/cpptools
SonarSource: https://www.sonarsource.com/

Filed under: Science & Technology

Implementing C++ Modules: Lessons Learned, Lessons Abandoned – Cameron DaCamara & Gabriel Dos Reis

  • Lobby
  • Author Archives: digitalmedium1

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
C++ Modules were designed to bring more safety to your programs, while dramatically reducing compile time, resulting in overall increased productivity. How can your C++ toolchain meet this challenge? What can you do to take advantage of these new functionalities available in your toolbox? In this talk, we share lessons learned from implementing Modules based on the singular idea of providing robust support through the entire toolchain (from the lexer through the linker, the IDE, the build system, etc.), debunking the misconception that C++ Modules are just some syntactic sugar that is compiled away by the front-end. The challenges that any C++ compiler implementer faces include: (1) how to satisfy the requirements of merging materialization of declarations -- needed for sound handling of the global module fragments, in particular, as found in header files and header units – with associated performance cost; (2) how to take advantage of the One Definition Rule guarantees provided by named modules. They must address those challenges without compromising efficiency and static semantics. These lessons are valuable not just to C++ tools developers, but to ordinary C++ programmers as well, shedding light on how speed and safety gains are achieved by staying close to the spirit of the original C++ Modules design (“take the ODR as foundational”), and how you can put them to good use in the architecture of your programs and libraries.

---
Cameron DaCamara

Senior software engineer at Microsoft working on the MSVC front-end team. Primary area of focus is C++ Modules and compiler evolution.

Gabriel Dos Reis

Gabriel Dos Reis is a Principal Software Engineer at Microsoft, where he works in the area of large scale software construction, tools, and techniques. He is also a researcher, and a longtime member of the C++ community, author and co-author of numerous extensions to support large scale programming, compile-time and generic programming. His research interests include programming tools for dependable software. Prior to joining Microsoft, he was Assistant Professor at Texas A&M University. Dr. Dos Reis was a recipient of the 2012 National Science Foundation CAREER award for his research in compilers for dependable computational mathematics and educational activities.

---
Videos Filmed & Edited by Bash Films: http://www.BashFilms.com

YouTube Channel Managed by Digital Medium Ltd https://events.digital-medium.co.uk

The CppCon YouTube Channel Is Sponsored By:
JetBrains : http://jb.gg/cpptools
SonarSource: https://www.sonarsource.com/

Filed under: Science & Technology

“Constexpr Everything” – The Standard Library, Microkernel, Apps, and Unit Tests – Rian Quinn

  • Lobby
  • Author Archives: digitalmedium1

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
Full Title: I See Your AUTOSAR and Raise You “Constexpr Everything”. No Seriously, Everything. The Standard Library, Microkernel, Apps, and Unit Tests.

This presentation will walk the audience through how we implemented an AUTOSAR compliant Hypervisor with all of it's code including the microkernel, apps and unit tests as a "constexpr" using C++20, all in open source. Are you worried about undefined behavior in your applications? Are you curious how far "constexpr everything" can be taken and how it benefits you, or what "constexpr everything" is? Do you work with AUTOSAR? Or are you curious how you would write a microkernel as a "constexpr"? If so, this presentation is for you.

The original goal of our project was to implement an AUTOSAR compliant hypervisor using a microkernel archeicture, designed specifically for US government and critical systems applications all in open source. The first problem we ran into was there were no, open source, AUTOSAR compliant implementations of the C++ standard library. There also were no static analysis tools in open source to verify AUTOSAR compliance. To solve this, we implemented our own AUTOSAR static analysis tool using Clang Tidy in open source as well as a portion of the C++ standard library (called the BSL) using C++20 to AUTOSAR specifications. Since C++20 was used, we decided to see just how far we could take the idea of "constexpr everything". To our surprise, we were able to implement everything as a "constexpr". The C++ code for the microkernel, the C++ code for the applications that run on top of this microkernel, and yes, all of the unit tests for everything with 100% code coverage. What this means is that our unit tests are executed at compile-time and they test everything from the page fault handler and ELF loader in the microkernel, to the tools that run on Windows or Linux. Not only does this ensure that undefined behavior is almost impossible for the entire project, it means that the compiler can verify both the syntax and the "logic" at compile time as the unit tests tell the compiler what the code is supposed to do.

"constexpr everything" will change the way you think about coding and C++. It's not just about performance and compile-time scripting. Its a way to tell the compiler what your application is supposed to do. Combined with Metaprogramming, the future of C++ in safety critical systems is boundless. This presentation will walk the audience through our experience of how we implemented everything as a "constexpr" and what the benefits of "constexpr everything" are to you and your projects from gaming and banking, to critical systems. This presentation will also cover how we overcame certain hurdles with "constexpr everything" in a real-world example, as well as how we implemented AUTOSAR compliance in open source. Think it's impossible to write a kernel as a "constexpr"? Be prepared to have some fun, learn some cool tricks and to have your mind blown!

---
Rian Quinn
Dr. Rian Quinn is a Senior Principal Investigator in the Trusted Information Systems Group at Assured Information Security, Inc. were he has focused on trusted computing and hypervisor related technologies for nearly 10 years. He holds a Ph.D. in Computer Engineering with specializations in Information Assurance and Computer Architectures from Binghamton University. He is a lead developer and co-founder of the Bareflank Hypervisor, and is an active member of several open source projects including OpenXT. Specialties: computer architectures, virtualization, operating systems, kernel programming, cyber security, and open source.

---
Videos Filmed & Edited by Bash Films: http://www.BashFilms.com

Filed under: Science & Technology

Type-and-resource safety in modern C++ – Bjarne Stroustrup – CppCon 2021

  • Lobby
  • Author Archives: digitalmedium1

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
Complete type-and-resource safety have been an ideal (aim) of C++ from very early on (1979) and is achievable though a judicious programming technique enforced by language rules and static analysis. The basic model for achieving that was documented in 2014 and does not imply limitations of what can be expressed or run-time overheads compared to traditional C and C++ programming techniques.

Experience shows that this cannot be achieved without static analysis and minimal run-time support. For fundamental reasons this cannot be done even with such support if arbitrary legal language constructs are accepted while conventional good performance must be maintained.

The way out of this dilemma is a carefully crafted set of programming rules supported by library facilities and enforced by static analysis.

This presentation is based on the C++ Core Guidelines and their enforcement rules (e.g., as implemented by the Core Guidelines checker distributed with Microsoft Visual Studio). That is, the points made here are backed up by specific rules and supported by existing software.

---
Bjarne Stroustrup

Bjarne Stroustrup is the designer and original implementer of C++ as well as the author of The C++ Programming Language (Fourth Edition), A Tour of C++ (Second edition), Programming: Principles and Practice using C++ (Second Edition), and many popular and academic publications. Dr. Stroustrup is a Technical Fellow and a Managing Director in the technology division of Morgan Stanley in New York City as well as a visiting professor at Columbia University. He is a member of the US National Academy of Engineering, and an IEEE, ACM, and CHM fellow. He received the 2018 Charles Stark Draper Prize, the IEEE Computer Society's 2018 Computer Pioneer Award, and the 2017 IET Faraday Medal. His research interests include distributed systems, design, programming techniques, software development tools, and programming languages. He is actively involved in the ISO standardization of C++. He holds a masters in Mathematics from Aarhus University, where he is an honorary professor, and a PhD in Computer Science from Cambridge University, where he is an honorary fellow of Churchill College. Personal website: www.Stroustrup.com.

---
Videos Filmed & Edited by Bash Films: http://www.BashFilms.com

YouTube Channel Managed by Digital Medium Ltd https://events.digital-medium.co.uk

The CppCon YouTube Channel Is Sponsored By:
JetBrains : http://jb.gg/cpptools
SonarSource: https://www.sonarsource.com/

Filed under: Science & Technology

Exceptional C++ – Victor Ciura – CppCon 2021

  • Lobby
  • Author Archives: digitalmedium1

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
When writing code we usually focus our attention on the happy paths - that’s where the interesting stuff happens. But there are also plenty of exciting things happening on the error handling flow, too. Although not universally loved/used, exceptions are a powerful mechanism of maneuvering execution on the unhappy path.

Even if std::exception and related machinery are not your cup of tea, you might care about hardware faults or OS signals like access violations, page errors, ALU overflows.

Let’s take a deep dive and explore what happens when an exception occurs, both at the application level and the OS level. We’ll explore the unwind process, the compiler generated code, the CRT hooks available and other exception internals. As we’re taking the scenic Windows route, we’re also going to encounter async exceptions (structured exceptions) on our quest for a better crash. We’ll poke into these mechanisms and see how we can leverage them in our application error handling. Did I mention threads? Routing exceptions between threads… oh my!

---
Victor Ciura
Victor Ciura is a Principal Engineer at CAPHYON, Technical Lead on the Advanced Installer team and a Microsoft MVP (Developer Technologies).

He’s a regular guest at Computer Science Department of his Alma Mater, University of Craiova, where he gives student lectures & workshops on using C++ STL Algorithms.

Since 2005, he has been designing and implementing several core components and libraries of Advanced Installer. Currently, he spends most of his time working with his team on improving and extending the repackaging and virtualization technologies in Advanced Installer IDE, helping clients migrate their traditional desktop apps to the modern Windows application format: MSIX.

One of his “hobbies” is tidying-up and modernizing (C++20) the aging codebase of Advanced Installer and has been known to build tools that help this process: Clang Power Tools

---
Videos Recorded & Edited by Digital Medium: http://online.digital-medium.co.uk

The CppCon YouTube Channel Is Sponsored By:
JetBrains : http://jb.gg/cpptools
SonarSource: https://www.sonarsource.com/

Filed under: Science & Technology

Concurrency Patterns – Rainer Grimm – CppCon 2021

  • Lobby
  • Author Archives: digitalmedium1

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
This session is part of the Software Design Track.

The main concern when you deal with concurrency is shared, mutable state or as Tony Van Eerd put it in his CppCon 2014 talk “Lock-free by Example”: “Forget what you learned in Kindergarten (i.e., stop Sharing).”

I present in theory and praxis proven patterns such as thread-safe storage, strategized locking, thread-safe interface, or guarded suspension to deal with the enemies of thread-safe programming: shared state and mutation.

To synchronize and schedule member function invocations in a concurrent architecture, the classics such as active object, or monitor object provide valuable services.

---
Rainer Grimm

I've worked as a software architect, team lead, and instructor since 1999. In 2002, I created company-intern meetings for further education. I have given training courses since 2002. My first tutorials were about proprietary management software, but I began teaching Python and C++ soon after. In my spare time, I like to write articles about C++, Python, and Haskell. I also like to speak at conferences. I publish weekly on my English blog (https://www.modernescpp.com/) and the (https://www.grimm-jaud.de/index.php/blog), hosted by Heise Developer. Since 2016 he is an independent instructor giving seminars about modern C++ and Python. Rainer published several books in various languages to modern C++ and concurrency, C++20, and the C++ Core Guidelines, in particular. Due to his profession, Rainer always searches for the best way to teach modern C++
---
Videos Filmed & Edited by Bash Films: http://www.BashFilms.com

Filed under: Science & Technology

Heterogeneous Modern C++ with SYCL 2020 – Michael Wong, Nevin Liber, Tom Deakin & Gordon Brown

  • Lobby
  • Author Archives: digitalmedium1

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
Heterogeneous programming in C++ used to be hard and low-level. Today, Khronos SYCL for Modern C ++ works with different libraries, ML frameworks and Standard C++ code on top of template libraries with lambda functions that separate host and accelerate device code in a single source, but still enables separate compilation of host and device code. The device SYCL compiler may employ kernel fusion for better performance and the host CPU compiler can be any C++ compiler, from clang, gcc, VS C++, or IBM XL compiler. SYCL enables accelerated code to pass into device OpenCL compilers or other backends to dispatch to any variety of devices.

This talk from members of the SYCL community will talk about highlighted features from the latest SYCL 2020. SYCL 2020 is released after 3 years of intense work with significant adoption in Embedded, Desktop and HPC markets. It offers improved programmability, smaller code size, faster performance and is based on C++17 whilst maintaining backwards compatibility with SYCL 1.2.1.
It simplifies porting of standard C++ applications to SYCL with closer alignment and integration to ISO C++ and allows multiple back-end acceleration and API independence. There are already a number of backends including CUDA, PTX, OpenMP, AMD, NEC, and TBB in addition to OpenCL.

This talk will showcase these features and show how SYCL 2020 has increased expressiveness and simplicity for modern C++ heterogeneous programming.

---
Michael Wong
Michael Wong is Distinguished Engineer/VP of R&D at Codeplay Software. He is a current Director and VP of ISOCPP , and a senior member of the C++ Standards Committee with more then 15 years of experience. He chairs the WG21 SG5 Transactional Memory and SG14 Games Development/Low Latency/Financials C++ groups and is the co-author of a number C++/OpenMP/Transactional memory features including generalized attributes, user-defined literals, inheriting constructors, weakly ordered memory models, and explicit conversion operators. He has published numerous research papers and is the author of a book on C++11. He is currently the editor of SG1 Concurrency TS and SG5 Transactional Memory TS. He is also the Chair of the SYCL standard and all Programming Languages for Standards Council of Canada.

Nevin Liber
Nevin “:-)” Liber is a Computer Scientist in the ALCF (Argonne Leadership Computing Facility) division of Argonne National Laboratory, where he works on the oneAPI/DPC++/SYCL backend for Kokkos for Aurora. He also represents Argonne on the SYCL and C++ Committees, the latter as Vice Chair of LEWGI/SG18. Back when he started out working at Bell Labs over three decades ago, a friend of his called and asked “What do you know about C++? You folks invented it!” That was enough to get a relatively shy junior engineer to go find the local expert so he could go play with it, and the rest is history! He has worked in C++ across various industries and platforms (big data, low-latency, operating systems, embedded, telephony and now exascale computing, just to name a few). He has also been a C++ Committee member since 2010 and hosted both the C++ and C standards meetings in Chicago.

Tom Deakin
Tom Deakin is a Senior Research Associate in the High Performance Computing Research Group at the University of Bristol, where he works on performance portability of massively parallel High Performance simulation codes. Tom is the Chair of the Khronos SYCL Advisory Panel and has been a member of the SYCL Working Group since 2019. Tom completed his PhD in Leveraging Many-Core Technology for Deterministic Neutral Particle Transport at Extreme Scale in 2018, and has since continued working on unstructured mesh transport and performance portability on HPC architectures. Tom has been involved in teaching Computer Architecture and High Performance Computing at the University of Bristol and given tutorials on open standard parallel programming models at international conferences.

Gordon Brown
Gordon Brown is a principal software engineer at Codeplay Software specializing in heterogeneous programming models for C++. He has been involved in the standardization of the Khronos standard SYCL and the development of Codeplay’s implementation of the standard; ComputeCpp, from its inception. More recently he has been involved in the efforts within SG1/SG14 to standardize execution and to bring heterogeneous computing to C++, including executors, topology discovery and affinity. Gordon is also a regular speaker at CppCon and teaches the CppCon class on parallelism and GPU programming in C++.

---
Videos Streamed & Edited by Digital Medium: http://online.digital-medium.co.uk

The CppCon YouTube Channel Is Sponsored By:
JetBrains : http://jb.gg/cpptools
SonarSource: https://www.sonarsource.com/

Filed under: Science & Technology