├── .clang-format ├── .github └── workflows │ ├── build.yml │ └── slides.yml ├── .gitignore ├── .gitpod.Dockerfile ├── .gitpod.yml ├── .gitpod └── .vscode │ └── settings.json ├── 01_01_introduction ├── CMakeLists.txt └── introduction.md ├── 01_02_infrastructure_resources ├── CMakeLists.txt ├── code │ └── cpp-example │ │ ├── .gitignore │ │ ├── CMakeLists.txt │ │ ├── MathFunctions │ │ ├── CMakeLists.txt │ │ ├── MathFunctions.cxx │ │ ├── MathFunctions.h │ │ └── test_MathFunctions.cxx │ │ ├── README.md │ │ ├── TutorialConfig.h.in │ │ ├── cmake │ │ └── ECMEnableSanitizers.cmake │ │ └── tutorial.cxx └── infrastructure_resources.md ├── 01_03_raii_move-semantics ├── CMakeLists.txt ├── attachments │ ├── bender-who-cares.jpg │ ├── business-spiderman-working-computer-office-1359497850d.jpg │ ├── c++-logo.png │ ├── cppref-shared_ptr.png │ ├── cppref-unique_ptr.png │ ├── five.png │ ├── pointers.jpg │ ├── shared_ptr-cost-heap.png │ ├── shared_ptr-ctors.png │ ├── shared_ptr-machinery.png │ ├── shared_ptr_cost-sync.png │ ├── smart-idea.jpeg │ ├── stone-wheel.png │ ├── tenor-1940754097.png │ ├── three.png │ ├── todolist.png │ ├── value-categories-00-l-vs-r.excalidraw │ ├── value-categories-00-l-vs-r.png │ ├── value-categories-01-l-vs-r-move.excalidraw │ ├── value-categories-01-l-vs-r-move.png │ ├── value-categories-02-move-semantic.excalidraw │ ├── value-categories-02-move-semantic.png │ ├── value-categories-03-rvalue.excalidraw │ ├── value-categories-03-rvalue.png │ ├── value-categories-04-general.excalidraw │ ├── value-categories-04-general.png │ ├── whoarewe-performances.png │ ├── zach-math-thinking.jpg │ └── zero.png ├── code │ └── raii_buffer.cpp └── raii_move-semantic.md ├── 01_04_generic_programming_1_templates ├── CMakeLists.txt ├── code │ ├── debug_print_specializations.cpp │ ├── demangle_helper.hpp │ ├── fold_print.cpp │ └── type_list.hpp ├── generic_programming_part1.md └── templates_part1.md ├── 02_01_functional_generic_utilities ├── CMakeLists.txt ├── code │ ├── apply.cpp │ ├── apply_tuple_bug.cpp │ ├── ast.cpp │ ├── empty_variant_optional.cpp │ ├── lambda_capture.cpp │ ├── tuple_storage.cpp │ └── tuple_storage_apply.cpp ├── functional_generic_utilities.md └── lambdas_cppref.png ├── 02_03_generic_programming_part2 ├── CMakeLists.txt ├── attachments │ ├── quiz-answer.jpg │ ├── quiz-question.jpg │ └── yoda.jpg ├── code │ ├── swap.cpp │ ├── swap_cpo.cpp │ └── swap_tag_invoke.cpp ├── generic_programming_part2_concepts.md └── generic_programming_part2_cpos.md ├── 02_05_example_concept_based_design ├── CMakeLists.txt ├── code │ ├── cursor.hpp │ ├── ex1_filter.cpp │ ├── ex2_to_vector.cpp │ ├── ex3_vector_as_cursor.cpp │ ├── ex4_cursor_algorithm_concept.cpp │ ├── sol1_filter.cpp │ ├── sol2_to_vector.cpp │ ├── sol3_vector_as_cursor.cpp │ ├── sol4_cursor_algorithm_concept.cpp │ └── test_cursor.cpp └── example_concept_based_design.md ├── 03_01_data_oriented_design ├── CMakeLists.txt ├── code │ ├── cache_block_size.cpp │ ├── cache_false_sharing.cpp │ ├── dram_block_size.cpp │ ├── dram_burst_mode.cpp │ └── nbody │ │ ├── CMakeLists.txt │ │ ├── common.hpp │ │ ├── dod.cpp │ │ ├── dod.hpp │ │ ├── main.cpp │ │ ├── oop.cpp │ │ └── oop.hpp ├── data_oriented_design.md ├── data_oriented_tips.md ├── examples │ ├── CMakeLists.txt │ └── struct_layout.cpp └── images │ ├── cache_block_size.svg │ ├── cache_no_prefetch_latency.drawio.svg │ ├── cache_prefetch_block_size_random.svg │ ├── cache_prefetch_block_size_sequential.svg │ ├── cache_prefetch_latency.drawio │ ├── cache_prefetch_latency.drawio.svg │ ├── data_access_patterns.drawio │ ├── dod_nbody_example.drawio.svg │ ├── dram_all_elements.drawio.svg │ ├── dram_block_reads.drawio.svg │ ├── dram_block_size_random.svg │ ├── dram_block_size_sequential.svg │ └── dram_every_8th.drawio.svg ├── 03_02_data_access_algorithms_ranges ├── CMakeLists.txt ├── code │ └── ranges_snippets.cpp └── containers_algorithms_ranges.md ├── 03_02b_mdspan ├── CMakeLists.txt ├── Row_and_column_major_order.png ├── code │ └── mdspan.cpp ├── md_span_implementation_status.png └── mdspan.md ├── 03_04_future ├── CMakeLists.txt ├── coroutines.md ├── future.md └── images │ └── coroutines.drawio ├── 0x_0x_coroutines ├── CMakeLists.txt ├── code │ └── task.cpp └── coroutines.md ├── CMakeLists.txt ├── README.md ├── cmake └── Marp.cmake ├── images └── repo_link_qr.gif ├── slides-support ├── README.md ├── common │ ├── 4k-slide-bg-white.png │ ├── 4k-slide-bg.png │ ├── footer.png │ ├── title-bg1.png │ ├── title-bg2.png │ └── title-bg3.png ├── docs │ ├── environment.png │ ├── preview.png │ └── settings.png └── themes │ └── cscs.css └── utility ├── .gitignore └── line_graph.py /.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | AccessModifierOffset: '-4' 3 | AlignAfterOpenBracket: Align 4 | AlignConsecutiveAssignments: 'false' 5 | AlignConsecutiveBitFields: 'false' 6 | AlignConsecutiveDeclarations: 'false' 7 | AlignConsecutiveMacros: 'false' 8 | AlignEscapedNewlines: 'Left' 9 | AlignOperands: 'true' 10 | AlignTrailingComments: 'false' 11 | AllowAllParametersOfDeclarationOnNextLine: 'false' 12 | AllowShortBlocksOnASingleLine: 'Always' 13 | AllowShortCaseLabelsOnASingleLine: 'true' 14 | AllowShortFunctionsOnASingleLine: 'All' 15 | AllowShortIfStatementsOnASingleLine: 'true' 16 | AllowShortLambdasOnASingleLine: 'All' 17 | AllowShortLoopsOnASingleLine: 'true' 18 | AlwaysBreakAfterReturnType: 'None' 19 | AlwaysBreakBeforeMultilineStrings: 'true' 20 | AlwaysBreakTemplateDeclarations: 'Yes' 21 | BinPackArguments: 'true' 22 | BinPackParameters: 'true' 23 | BitFieldColonSpacing: 'Both' 24 | BraceWrapping: 25 | AfterCaseLabel: false 26 | AfterClass: false 27 | AfterControlStatement: 'MultiLine' 28 | AfterEnum: false 29 | AfterFunction: false 30 | AfterNamespace: false 31 | AfterStruct: false 32 | AfterUnion: false 33 | AfterExternBlock: true 34 | BeforeCatch: true 35 | BeforeElse: true 36 | BeforeLambdaBody: false 37 | BeforeWhile: false 38 | IndentBraces: false 39 | SplitEmptyFunction: false 40 | SplitEmptyRecord: false 41 | SplitEmptyNamespace: false 42 | BreakBeforeBinaryOperators: NonAssignment 43 | BreakBeforeBraces: Custom 44 | BreakBeforeTernaryOperators: 'true' 45 | BreakConstructorInitializers: 'BeforeColon' 46 | BreakInheritanceList: 'BeforeColon' 47 | BreakStringLiterals: 'true' 48 | ColumnLimit: '0' 49 | ConstructorInitializerAllOnOneLineOrOnePerLine: 'true' 50 | ContinuationIndentWidth: '4' 51 | Cpp11BracedListStyle: 'false' 52 | DeriveLineEnding: 'true' 53 | FixNamespaceComments: true 54 | IncludeBlocks: Regroup 55 | IncludeCategories: 56 | - Regex: '<([[:alnum:].]|_)+>' 57 | Priority: 4 58 | - Regex: '(<|")((C|c)atch.*)/' 59 | Priority: 5 60 | - Regex: '.*' 61 | Priority: 1 62 | IndentCaseBlocks: 'false' 63 | IndentCaseLabels: 'true' 64 | IndentExternBlock: 'false' 65 | IndentGotoLabels: 'true' 66 | IndentPPDirectives: 'BeforeHash' 67 | IndentWidth: '4' 68 | IndentWrappedFunctionNames: 'false' 69 | KeepEmptyLinesAtTheStartOfBlocks: 'false' 70 | Language: Cpp 71 | MaxEmptyLinesToKeep: '3' 72 | NamespaceIndentation: Inner 73 | PointerAlignment: Left 74 | SortIncludes: 'true' 75 | SortUsingDeclarations: 'false' 76 | SpaceAfterCStyleCast: 'false' 77 | SpaceAfterLogicalNot: 'false' 78 | SpaceAfterTemplateKeyword: 'true' 79 | SpaceBeforeAssignmentOperators: 'true' 80 | SpaceBeforeCaseColon: 'false' 81 | SpaceBeforeCpp11BracedList: 'false' 82 | SpaceBeforeCtorInitializerColon: 'true' 83 | SpaceBeforeInheritanceColon: 'true' 84 | SpaceBeforeParens: ControlStatements 85 | SpaceBeforeRangeBasedForLoopColon: 'true' 86 | SpaceBeforeSquareBrackets: 'false' 87 | SpaceInEmptyBlock: 'false' 88 | SpaceInEmptyParentheses: 'false' 89 | SpacesBeforeTrailingComments: '1' 90 | SpacesInAngles: 'false' 91 | SpacesInCStyleCastParentheses: 'false' 92 | SpacesInConditionalStatement: 'false' 93 | SpacesInContainerLiterals: 'true' 94 | SpacesInParentheses: 'false' 95 | SpacesInSquareBrackets: 'false' 96 | Standard: c++20 97 | TabWidth: '4' 98 | UseCRLF: 'false' 99 | UseTab: Never 100 | ... 101 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Build 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | - master 8 | pull_request: 9 | branches: 10 | - main 11 | - master 12 | 13 | jobs: 14 | build-test: 15 | strategy: 16 | fail-fast: false 17 | matrix: 18 | os: [windows-latest, ubuntu-latest] 19 | c_compiler: [gcc, clang, cl] 20 | build_type: [Debug, Release] 21 | cxx_standard: ["20"] 22 | include: 23 | - c_compiler: gcc 24 | cxx_compiler: g++ 25 | - c_compiler: clang 26 | cxx_compiler: clang++ 27 | - c_compiler: cl 28 | cxx_compiler: cl 29 | - os: windows-latest 30 | test_name: .\Bin\UnitTest.exe 31 | - os: ubuntu-latest 32 | test_name: ./Bin/UnitTest 33 | exclude: 34 | - os: windows-latest 35 | c_compiler: gcc 36 | - os: windows-latest 37 | c_compiler: clang 38 | - os: ubuntu-latest 39 | c_compiler: cl 40 | 41 | name: ${{ matrix.c_compiler }} - ${{ matrix.build_type }} - ${{ matrix.os }} - c++${{ matrix.cxx_standard }} 42 | 43 | runs-on: ${{matrix.os}} 44 | 45 | steps: 46 | - uses: actions/checkout@v3 47 | - uses: seanmiddleditch/gha-setup-ninja@v3 48 | - uses: seanmiddleditch/gha-setup-vsdevenv@master 49 | - name: Install LLVM and Clang 50 | uses: KyleMayes/install-llvm-action@v1 51 | with: 52 | version: "17.0" 53 | 54 | - name: Create Build Environment 55 | run: cmake -E make_directory ${{runner.workspace}}/build 56 | 57 | - name: Configure CMake 58 | working-directory: ${{runner.workspace}}/build 59 | env: 60 | CC: ${{matrix.c_compiler}} 61 | CXX: ${{matrix.cxx_compiler}} 62 | run: cmake -S ${{github.workspace}} -B ${{runner.workspace}}/build -G Ninja -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DCMAKE_CXX_STANDARD=${{ matrix.cxx_standard }} -DCPP_COURSE_BUILD_SLIDES:BOOL=OFF 63 | 64 | - name: Build 65 | working-directory: ${{runner.workspace}}/build 66 | run: cmake --build . --config ${{matrix.build_type}} 67 | 68 | - name: CTest 69 | working-directory: ${{runner.workspace}}/build 70 | run: ctest 71 | -------------------------------------------------------------------------------- /.github/workflows/slides.yml: -------------------------------------------------------------------------------- 1 | name: Slides 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | - main 8 | pull_request: 9 | branches: 10 | - master 11 | - main 12 | 13 | jobs: 14 | slides: 15 | name: slides 16 | runs-on: ubuntu-latest 17 | steps: 18 | - uses: actions/checkout@v2 19 | - uses: seanmiddleditch/gha-setup-ninja@v3 20 | 21 | - name: Install dependencies 22 | shell: bash 23 | run: | 24 | sudo apt update 25 | sudo apt install chromium-browser 26 | wget https://github.com/marp-team/marp-cli/releases/download/v3.2.1/marp-cli-v3.2.1-linux.tar.gz 27 | tar -xf ./marp-cli-v3.2.1-linux.tar.gz 28 | sudo ln -s $(pwd)/marp /usr/bin/marp 29 | 30 | - name: Create Build Environment 31 | run: cmake -E make_directory ${{runner.workspace}}/build 32 | 33 | - name: Configure CMake 34 | shell: bash 35 | working-directory: ${{runner.workspace}}/build 36 | run: | 37 | cmake -S $GITHUB_WORKSPACE -B . -DCMAKE_BUILD_TYPE=Debug 38 | 39 | - name: Build 40 | working-directory: ${{runner.workspace}}/build 41 | shell: bash 42 | run: cmake --build . --config Debug 43 | 44 | - name: Copy slides 45 | working-directory: ${{runner.workspace}}/build 46 | shell: bash 47 | run: | 48 | mkdir slides 49 | # For the moment we just PDF slides, because HTML have problem with images urls 50 | cp ./*.pdf ./slides/ 51 | 52 | - name: Archive slides 53 | uses: actions/upload-artifact@v3 54 | with: 55 | name: slides 56 | path: ${{runner.workspace}}/build/slides 57 | 58 | deploy: 59 | if: github.ref_name == 'main' 60 | needs: slides 61 | 62 | # Grant GITHUB_TOKEN the permissions required to make a Pages deployment 63 | permissions: 64 | pages: write # to deploy to Pages 65 | id-token: write # to verify the deployment originates from an appropriate source 66 | 67 | environment: 68 | name: github-pages 69 | url: ${{ steps.deployment.outputs.page_url }} 70 | 71 | runs-on: ubuntu-latest 72 | steps: 73 | - name: Download slides 74 | uses: actions/download-artifact@v3 75 | with: 76 | name: slides 77 | 78 | - name: Generate GitHub Pages index 79 | shell: bash 80 | run: | 81 | echo "