Designing a Slimmer Vector of Variants## +24 ## Designing a Slimmer Vector of Variants ## CHRISTOPHER FRETZ ## Designing a Slimmer Vector of Variants Engineering CppCon 2024 September 18, 2024 Chris Fretz Senior C++ Engineer TechAtBloomberg details my experience in creating a novel solution to an observed problem with memory usage of std::vector<std::variant<...>> - The talk starts with the motivating use case, considers several candidate 2024 Bloomberg Finance L.P. All rights reserved. Bloombergstd::variant<...> ## Motivation • Heterogeneous containers like std::vector<std::variant<...>> are an extremely natural way to represent0 码力 | 64 页 | 1.98 MB | 1 年前3
Lecture Notes on Support Vector Machine# Lecture Notes on Support Vector Machine Feng Li fli@sdu.edu.cn Shandong University, China ## 1 Hyperplane and Margin In a n-dimensional space, a hyper plane is defined by $$ \omega^{T}x+b=0 $$ $$ where $ \omega\inR^{n} $ is the outward pointing normal vector, and b is the bias term. The n-dimensional space is separated into two half-spaces $ H^{+}=\{x\inR^{n}\mid\omega^{T}x+b\geq0\} $ and 7/4/ca747b9d33d07aa393893fb3862bcd67/p2_1.jpg) Figure 1: Margin and hyperplane. ## 2 Support Vector Machine ### 2.1 Formulation The hyperplane actually serves as a decision boundary to differentiating0 码力 | 18 页 | 509.37 KB | 2 年前3
Lecture 6: Support Vector Machine## Lecture 6: Support Vector Machine Feng Li Shandong University fli@sdu.edu.cn December 28, 2021 ## Outline  1 SVM: nts/4/1/3/0/41305aec36322a1beae76d1d88486b9a/p3_1.jpg) • Defined by an outward pointing normal vector $ \omega \in R^{n} $ • Assumption: The hyperplane passes through origin. If not, • have a bias 0 means moving it parallelly along $ \omega $ (b < 0 means in opposite direction) ## Support Vector Machine • A hyperplane based linear classifier defined by $ \omega $ and b • Prediction rule:0 码力 | 82 页 | 773.97 KB | 2 年前3
Back to Basics Almost Always Vector## +24 ## Back To Basics Almost Always Vector ## KEVIN CARPENTER #### My professor is telling us to NEVER use vectors. EDIT 3: Holy cow, that is a LOT of comments. I've read through a lot of them #include#include  -> int { std::cout << "C style array: " << << sizeof(a) / sizeof(a[0]) << std::endl; std::cout << "Vector size: " << c.size() << std::endl; return 0; } vector>0 码力 | 62 页 | 4.86 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 }); // 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" in a vector of objects // having 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
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
Designing Fast and Efficient List-like Data StructuresList-like Data Structures ## YANNIC BONENBERGER ## List-like data structures • std::vector • std::list • std::deque ## std::vector • C++ version of the array-list data structure • Backed by a C-style array allocates a new backing array when inserting into a "full" std::vector ## std::vector 1 template2 class vector { 3 public: 4 // constructor, accessors, ... } 6 private: 7 size_t size_; 8 size_t capacity_; 10}; 9 T* data_; ## std::vector • Compact layout – elements stored in contiguous memory • Inserting or removing elements at the end is0 码力 | 29 页 | 852.61 KB | 1 年前3
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 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
共 1000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 100
相关搜索词
std::variantstd::vector内存使用变种类型C++20支持向量机超平面间隔核函数正则化核化SVM软边界SVM拉格朗日对偶问题SMO算法缓存友好性随机访问动态内存分配成员函数std::functionMitigationsAlternativesPerformanceOptimizationstd::mdspanlayoutaccessorasynchronouspolicystd::sortC++标准库排序算法严格弱序调试模式constexprstd::pmrCUDA性能优化内存管理std::liststd::dequecache localityFixedStackstd::simdSIMD_ACCESStransparent loading/storingvectorizationcompiler optimization













