Learning by Contributing to Rust Compiler - 陈于康
第三届中国 Rust 开发者大会 Learning by Contributing to Rust Compiler Yukang github.com/chenyukang Engineer @ Cryptape Leveling Up in Rust • 2011 ~ 2014 EDA startup C/C++ • 2014 ~ 2020 DJI Infra tools, code refactor, algorithms improvements Some PR stories • Rust cares about error messages • We are building a sufficiently empathetic compiler • It’s a trade-off Diagnostic is an art art Simple diagnostic is a good start Compiler is a teacher/friend [# 100502 Avoid infinite loop in function arguments checking] A trivial fix may require a lot of time ? Fix the bug of next_point0 码力 | 23 页 | 3.28 MB | 1 年前3C++23: An Overview of Almost All New and Updated Features
Escapes Trim Whitespace Before Line Splicing C++23 Standard Library String Formatting Improvements Standard Library Modules std::flat_(multi)map / std::flat_(multi)set std::mdspan std::generator Escapes Trim Whitespace Before Line Splicing C++23 Standard Library String Formatting Improvements Standard Library Modules std::flat_(multi)map / std::flat_(multi)set std::mdspan std::generator Escapes Trim Whitespace Before Line Splicing C++23 Standard Library String Formatting Improvements Standard Library Modules std::flat_(multi)map / std::flat_(multi)set std::mdspan std::generator0 码力 | 105 页 | 759.96 KB | 5 月前3whats new in visual studio
participating in the creation of the C++ Standards 2. by investing in the Microsoft Visual C++ (MSVC) Compiler & Libraries 3. by simplifying acquisition in C++ via vcpkg 4. by improving the Visual Studio IDE your code (with the same compiler as today) 💡 MSVC 2015, 2017 and 2019 toolsets are available directly from Visual Studio 2022 Step #3: Compile your code with the latest compiler 💡 Binary compatibility previous C++ runtimes (VS 2019, VS 2017, VS 2015) Step #4: Compile your dependencies with the latest compiler 💡 Have peace of mind upgrading all your open-source libraries with vcpkg (https://vcpkg.io) Next:0 码力 | 42 页 | 19.02 MB | 5 月前3Making Libraries Consumable for Non-C++ Developers
Who am I? Still at Microsoft, now on the .NET Core runtime team. • https://github.com/dotnet/runtimeWhat is interoperability? Enabling two or more disparate entities to work together. Don’t touch it Java Native Access (JNA) – 2007 Go – cgo – permit C in the .go source file – 2009 Swift – share a runtime and be like C – 2014There is no one approach. Make it suck less by recognizing assumptions.What function returns in caller provided memory. This is often unexpected but occurs using the MSVC compiler for x86 with stdcall (callee cleanup) or cdecl (caller cleanup). For non-MSVC, data_t is always0 码力 | 29 页 | 1.21 MB | 5 月前3Bringing Existing Code to CUDA Using constexpr and std::pmr
behavior of this flag may change in future compiler releases. https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/ index.html#options-for-altering-compiler-linker-behavior-expt-relaxed- constexpr Using function from a constexpr function. – That the behavior of your constexpr function matches your runtime behaviour (they can diverge). No Work is Less Work Than Some Work 45 |Questions About constexpr/Execution expands the set of functions available to the GPU. • May improve performance by: • Moving work from runtime to compile time. • Making dimensions of vectors/matrices available at compile time. 49 |Concluding0 码力 | 51 页 | 3.68 MB | 5 月前3C++高性能并行编程与优化 - 课件 - 11 现代 CMake 进阶指南
MAKE_LANG_COMPILER_ID.html#variable:CMAKE_%3CLANG%3E_COMPILER_ID 也可以用生成器表达式判断编译器 https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_COMPILER_ID.html#variable:CMAKE_%3CLANG%3E_COMPILER_ID 生成器表达式也可以做复杂的逻辑判断 生成器表达式也可以做复杂的逻辑判断 CMake 还提供了一些简写变量: MSVC, CMAKE_COMPILER_IS_GNUCC CMAKE_CXX_COMPILER_ID 直接作为字符串变量 从命令行参数指定编译器 也可以通过环境变量 CXX 指定 CMAKE_GENERATOR 也可以了解一下 顺便一提,小彭老师使用的 vimrc 分享 github.com/archibate/vimrc0 码力 | 166 页 | 6.54 MB | 1 年前3C++20: An (Almost) Complete Overview
to precompiled header files (PCH) Custom headers can also be made importable, but how to is compiler dependent “How C++20 Changes the Way We Write Code” -- Timur Doumler Friday, September 18 • 12:00Ranges11 integral, constructible, … sortable, mergeable, permutable, …24 Concepts Concepts help with compiler error messages Easier to read template error messages: e.g.: void Foo(Incrementable auto t) value49 Spaceship Operator <=> Common case: auto X::operator<=>(const Y&) const = default; Compiler generates all 6 comparison operators to compare X with Y (memberwise) Advanced: Non-defaulted0 码力 | 85 页 | 512.18 KB | 5 月前3C++20 STL Features: 1 Year of Development on GitHub
Again (GH-367, Neargye) • P0595R2 is_constant_evaluated() (GH-353, Jennifer Yao – MSVC compiler) • P1006R1 constexpr pointer_to() (GH-397, AdamBucior) • P1023R0 constexpr array Comparisons (GH-599 architectures is very fast • Testing x86/x64 takes about an hour • Many tests, multiplied by many compiler configurations42 Projects • Code Reviews (primary dashboard!) • Work In Progress Initial Review 0 码力 | 45 页 | 702.09 KB | 5 月前3C++高性能并行编程与优化 - 课件 - 07 深入浅出访存优化
that uses a large matrix multiply function. Using a combination of new ordering and the Intel MIC compiler directives, performance on the Intel Xeon Phi coprocessor was up to 36 X faster, and on the Intel0 码力 | 147 页 | 18.88 MB | 1 年前3C++高性能并行编程与优化 - 课件 - 08 CUDA 开启的 GPU 编程
这个版本号是编译时指定的版本,不是运 行时检测到的版本。编译器默认就是最老 的 52 ,能兼容所有 GTX900 以上显卡。 https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html#extended-notation 针对不同的架构,使用不同的代码 通过 CMake 设置架构版本号 • 可以用 CMAKE_CUDA_ARCHITECTURES0 码力 | 142 页 | 13.52 MB | 1 年前3
共 20 条
- 1
- 2