-
## +23
## More Ranges Please
## ROI BARKAN

## 20 23 October 01 - 06
## Hi, I'm Roi
• Roi Barkan (he/him) - Ψηη
8/6/6386ec7baac2ff5a73f34700e7205779/p3_2.jpg)
H
## Outline
• Libraries
What
Why
○ How
• Ranges
○ Introduction
Strengths, core ideas
Rabbits
• Summary
## ▶️▶️▶️▶️
## Libraries
roi.barkan@gmail [Image](/uploads/documents/6/3/8/6/6386ec7baac2ff5a73f34700e7205779/p11_3.jpg)
## ▶️▶️▶️▶️
## C++ Ranges
roi.barkan@gmail.com
## Ranges is a Breakthrough Library
One of C++20 big-four features
Rests on decades of existing
0 码力 |
27 页 |
1.08 MB
| 1 年前 3
-
Effective Ranges: A tutorial for using C++2x ranges Jeff Garland
Created: 2023-10-03 Tue 08:50
## I ntro
the beginning of the end – for begin and end
## hello ranges
## the old way: sort
std::arraystd::sort ( a.begin(), a.end() );
for ( auto v : a )
cout << v << " " << endl;
## the ranges way: sort
namespace rng = std::ranges;
std::array clear, obvious meaning, -13 characters
std::print("{}", a); // [1, 2, 3, 4, 5, 6]
• https://godbolt.org/z/o478PEMff
## the old way: find_if
std::array a { 6, 2, 3, 4, 5, 1 };
0 码力 |
56 页 |
15.30 MB
| 1 年前 3
-
## Implementing Particle Filters With Ranges
## NAHUEL ESPINOSA

## ABOUT ME

## C++ RANGES LIBRARY
Extension and generalization of the algorithm and iterator libraries.
(C++98) algorithm(begin(range), end(range)) → result
## C++ RANGES LIBRARY
## Extension and
0 码力 |
83 页 |
4.70 MB
| 1 年前 3
-
## +24
## Limitations and Problems in std::function and Similar Mitigations and Alternatives
## AMANDEEP CHAWLA
## Limitations and Problems in std::function and similar constructs
Amandeep Chawla | notifyTQ,
std::function)> callback
);
## Lambdas
// print all the elements of vector of int.
std::for_each(c.begin(), c.end(), [(int i) {
std::cout std::cout << i << ' ";
});
// Sort the vector using a lambda function
std::sort(v.begin(), v.end(), [](int a, int b) {
return a < b;
});
// find the object with id "c"
0 码力 |
62 页 |
3.57 MB
| 1 年前 3
-
## +24
## spanny 2: Rise of std::mdspan
## GRISWALD BROOKS
## 20 24 September 15 - 20
##### DISCLAIMER: C++23... ish

understanding of std::mdspan layouts and accessors
• how to write custom layouts and accessors
• dispel common misconceptions about both
## how
• motivations for std::mdspan
- review std::mdspan declaration memory accessor
improving memory access using asynchronicity
## how
• motivations for std::mdspan
- review std::mdspan declaration
• layouts and their requirements
• occupancy grids and default layouts
0 码力 |
117 页 |
2.02 MB
| 1 年前 3
-
## A Long Journey of Changing std::sort Implementation at Scale
## DANILA KUTENIN
## WHO AM I?
• Senior Software Engineer at Google
• DC efficiency
## AGENDA FOR TODAY
• History of sorting
• Why have elements
• std::sort, std::stable_sort, ranges::sort, etc
std::sort(begin, end);
std::ranges::sort(cont);
## REMINDERS
• Sorting is the ordering of elements
• std::sort, std::stable_sort, ranges::sort, etc
std::sort(begin, end, comp);
std::ranges::sort(cont, comp);
## QUICKSORT
## QUICKSORT
• Quick sort
## QUICKSORT
• Quick sort
• Take any element
## QUICKSORT
• Quick sort
• Take any element
0 码力 |
182 页 |
7.65 MB
| 1 年前 3
-
## +23
## Distributed Ranges: A Model for Building Distributed Data Structures, Algorithms, and Views
## BENJAMIN BROCK
## Notices and Disclaimers
For notices, disclaimers, and details about performance return reduce(par_unseq, z, 0, std::plus());
}

## Outline
- Background (Ranges, Parallelism, Distributed Data
- Distributed Ranges (Concepts)
- Implementation (Algorithms and views)
- Complex Data Structures (Dense and sparse matrices)
- Lessons learned
## Outline
- Background (Ranges, Parallelism, Distributed
0 码力 |
127 页 |
2.06 MB
| 1 年前 3
-
## +21
## Bringing Existing Code to CUDA Using constexpr and std::pmr
BOWIE OWENS
20
21
October 24-29
## Outline
• Introduction
• Memory
• Host vs Device Functions
• Return on Investment
• Concluding Allocation
// cpu
std::vector x(N); // ????
std::vector y(N); // ...
## std::pmr
• Added in C++17:
• std::pmr::memory_resource
• std::pmr::polymorphic_allocator
• std::pmr::vector std::pmr::vector
• std::pmr::monotonic_buffer_resource
// ...
## Memory Allocation
// gpu
unified_memory_resource mem;
std::pmr::vector x(N, &mem);
std::pmr::vector y(N, &mem);
0 码力 |
51 页 |
3.68 MB
| 1 年前 3
-
## +24
## V ectorizing a CFD Code With `std::simd` Supplemented by (Almost) Transparent Loading and Storing
OLAF KRZIKALLA
## VECTORIZING A CFD CODE WITH STD::SIMD SUPPLEMENTED BY (ALMOST) TRANSPARENT deduction to load and store std::�:� and scalar variables
☑ syntactically equalize scalar and vectorized code
## The talk:
■ share experience with vectorization using std::�md
■ introduce the SIMD_ACCESS → Single Instruction Multiple Data (SIMD)
For more details Matthias Kretz' Cppcon talk about std::simd: https://youtu.be/LAJ_hywLtMA
## Background: Vectorization
void add_array(double* x, double*
0 码力 |
58 页 |
2.68 MB
| 1 年前 3
-
## +23
## I s
std::mdspan a Zero-overhead Abstraction?
## OLEKSANDR BACHERIKOV
## I s
std::mdspan a Zero-overhead Abstraction?
Oleksandr Bacherikov
Snap Inc
## What is
std::mdspan?
It's a view } $$
Back to C++
If the matrices are contiguous in memory, then we can treat them as
ranges and simply use
std::transform
$$ \{-5,\quad5,\quad-3,\quad1,\quad4,\quad0\} $$
$$ \{3,2,1,3,-5,4\} $$ 4*r8], xmm0
## V ectorization is great for performance, not great for slideware
#### clang16.0.4 -01 -
std=c++20
| push | rbx | je | .LBB0_6 |
| test | rdi 0 码力 |
75 页 |
1.04 MB
| 1 年前 3
|