Vectorizing a CFD Code With std::simd Supplemented by Transparent Loading and Storing+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 LOADING 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 library multiple set of operands at once → Single Instruction Multiple Data (SIMD) For more details Matthias Kretz' Cppcon talk about std::simd: https://youtu.be/LAJ_hywLtMA ## Background: Vectorization void0 码力 | 58 页 | 2.68 MB | 1 年前3
Advanced SIMD Algorithms in Pictures## ADVANCED SIMD ALGORITHMS IN PICTURES Denis Yaroshevskiy ## THIS TALK • tinyurl.com/dycppcon2023 memcmp • copy_if • set intersection MEMCMP ## std::memcmp ## std::memcmp  ## EVE LIBRARY • github • Joel Falcou, Jean-Thierry Lapresté, Denis Yaroshevskiy • SIMD in C++20: EVE of a new Era • eve::algo::mismatch MEMCMP RESULTS, X86 name : mismatch | size : 10000 #includebool core_of_mmatch(const std::uint8_t* &a, const std::uint8_t* &b) { using wide = eve::wide<std::uint8_t>; wide wide_a = eve::load(a); // [0, 1, 2, 3] 0 码力 | 96 页 | 4.55 MB | 1 年前3
Limitations and Problems in std::function and Similar## +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 vectorusing 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
Spanny 2: Rise of std::mdspan## +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 layouts0 码力 | 117 页 | 2.02 MB | 1 年前3
Adventures in SIMD Thinking (Part 2 of 2)## Adventures in SIMD Thinking (Part 2 of 2) Bob Steagall CppCon 2020 ## KEWB COMPUTING ## Agenda • Learn a little about Intel's SIMD facilities (disclaimer: I don't work for Intel) • Create Create some useful functions in terms of AVX-512 intrinsics • Try some SIMD-style thinking to tackle some interesting problems • Intra-register sorting • Fast linear median-of-seven filter • Fast small-kernel 83397899fe79b53265/p33_2.jpg) ## The Basic Conversion Algorithm (UTF-8 to UTF-32) KEWB_ALIGN_FN std::ptrdiff_t UtfUtils::BasicConvert(char8_t const* pSrc, char8_t const* pSrcEnd, char32_t* pDst) noexcept0 码力 | 135 页 | 551.08 KB | 1 年前3
Adventures in SIMD Thinking (Part 1 of 2)## Adventures in SIMD Thinking (Part 1 of 2) Bob Steagall CppCon 2020 ## KEWB COMPUTING ## Agenda • Learn a little about Intel's SIMD facilities (disclaimer: I don't work for Intel) • Create Create some useful functions in terms of AVX-512 intrinsics • Try some SIMD-style thinking to tackle some interesting problems • Intra-register sorting • Fast linear median-of-seven filter • Fast small-kernel#undef _OPTIMIZE #define KEWB_FORCE_INLINE #endif namespace simd { using rf_512 = __m512; using ri_512 = __m512i; using msk_512 = uint32_t; ... } 0 码力 | 88 页 | 824.07 KB | 1 年前3
A Long Journey of Changing std::sort Implementation at Scale## 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 ordering of 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 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 any0 码力 | 182 页 | 7.65 MB | 1 年前3
Bringing Existing Code to CUDA Using constexpr and std::pmr## +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::vectorx(N); // ???? std::vector ## 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::vectory(N); // ... x(N, &mem); std::pmr::vector y(N, &mem); 0 码力 | 51 页 | 3.68 MB | 1 年前3
simd: How to Express Inherent Parallelism Efficiently Via Data-Parallel Types## 20 23 October 01 - 06 ## +23 ## : ## MATTHIAS KRETZ # std::�md how to express inherent parallelism efficiently via data-parallel types Dr. Matthias Kretz GSI Helmholtz Center for Heavy Ion Research Goals and non-goals for this talk • This is not a tutorial! You won’t really know how to use the std::�API after this talk. I will have to scratch the surface. Most examples/topics have many interesting tangents to take; we don’t have that time. • My goal is to share my vision. Take your view from SIMD registers up to designing efficient software. • How to think / design... I might have promised too0 码力 | 160 页 | 8.82 MB | 1 年前3
Is std::mdspan a Zero-overhead Abstraction? - Oleksandr Bakirov - CppCon## +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 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\} $$ $$ \{-2 4*r8], xmm0 ## V ectorization is great for performance, not great for slideware #### clang16.0.4 -01 -std=c++20













