C++ template metaprogramming in practice

C++ template metaprogramming in practice: a deep learning framework

by Wei, Li

Type Book
Rate 0.0 /5

Using the implementation of a deep learning framework as an example, C++ Template Metaprogramming in Practice: A Deep Learning Framework explains the application of metaprogramming in a relatively large project and emphasizes ways to optimize systems performance. The book is suitable for developers with a basic knowledge of C++. Developers familiar with mainstream deep learning frameworks can also refer to this book to compare the differences between the deep learning framework implemented with…

Read More ↓

Title Statements

  • Full title :C++ template metaprogramming in practice : a deep learning framework / by Li Wei.

Summary

Using the implementation of a deep learning framework as an example, C++ Template Metaprogramming in Practice: A Deep Learning Framework explains the application of metaprogramming in a relatively large project and emphasizes ways to optimize systems performance. The book is suitable for developers with a basic knowledge of C++. Developers familiar with mainstream deep learning frameworks can also refer to this book to compare the differences between the deep learning framework implemented with metaprogramming and compile-time computing with deep learning frameworks using object-oriented methods. Consisting of eight chapters, the book starts with two chapters discussing basic techniques of metaprogramming and compile-time computing. The rest of the book's chapters focus on the practical application of metaprogramming in a deep learning framework. It examines rich types and systems, expression templates, and writing complex meta-functions, as well as such topics as: Heterogeneous dictionaries and policy templates An introduction to deep learning Type system and basic data types Operations and expression templates Basic layers Composite and recurrent layers Evaluation and its optimization Metaprogramming can construct flexible and efficient code. For C++ developers who are familiar with object-oriented programming, the main difficulty in learning and mastering C++ metaprogramming is establishing the thinking mode of functional programming. The meta-programming approach involved at compile time is functional, which means that the intermediate results of the construction cannot be changed, and the impact may be greater than expected. This book enables C++ programmers to develop a functional mindset and metaprogramming skills. The book also discusses the development cost and use cost of metaprogramming and provides workarounds for minimizing these costs.

Read More ↓

Edition Statements

  • Publication Date:©2021

Publication Statements

  • Publisher(s):CRC Press
  • Place of Publication:Boca Raton, FL
  • Language:eng
  • Publication Date:©2021

Notes

"An Auerbach Book".

The Physical Object

  • Description:1 online resource (xii, 308 pages) : : illustrations

Edition Identifiers

  • ISBN:9781000219739, 1000219739, 9781003102311, 100310231X, 9781000219753, 1000219755, 9781000219777, 1000219771
  • oclc:on1301550838
  • LC Classification:QA76.73.C153

Table of Contents

Cover -- Half Title -- Title Page -- Copyright Page -- Contents -- Preface -- Acknowledgment -- PART I: INTRODUCTION -- 1. Basic Tips -- 1.1. Metafunction and type_traits -- 1.1.1. Introduction to Metafunctions -- 1.1.2. Type Metafunction -- 1.1.3. Various Metafunctions -- 1.1.4. type_traits -- 1.1.5. Metafunctions and Macros -- 1.1.6. The Nominating Method of Metafunctions in This Book -- 1.2. Template Template Parameters and Container Templates -- 1.2.1. Templates as the Input of Metafunctions -- 1.2.2. Templates as the Output of Metafunctions -- 1.2.3. Container Templates

1.3. Writing of Sequences, Branches, and Looping Codes -- 1.3.1. Codes Executed in Sequence Order -- 1.3.2. Codes Executed in Branches -- 1.3.2.1. Implementing Branches Using std::conditional and std::conditional_t -- 1.3.2.2. Implementing Branches with (Partial) Specialization -- 1.3.2.3. Implementing Branches Using std::enable_if and std::enable_if_t -- 1.3.2.4. Compile-time Branches with Different Return Types -- 1.3.2.5. Simplify Codes with if constexpr -- 1.3.3. Codes Executed in Loops -- 1.3.4. Caution: Instantiation Explosion and Compilation Crash

1.3.5. Branch Selection and Short Circuit Logic -- 1.4…

Read More ↓

Subjects

Writers

Rate & Review

0.0/5
(0 people Voted)

No reviews yet. Be the first to rate this work.

Files & Downloads

  • C++ Template Metaprogramming in Practice: A Deep …

    PDF · 13.0 MB · updated