C++20: An (Almost) Complete Overviewfixed-size: 42 ints spanb {data}; // dynamic-size: 42 ints span c {data}; // compilation error span d { ptr, len }; // dynamic-size: len ints Read-only span: span required to always produce a constant at compile time, a non- constant result should be a compilation error called: immediate functions consteval auto InchToMm(double inch) { return inch * 25.4; everything is constant ✔ double dynamic_inch { 8 }; const auto mm2 { InchToMm(dynamic_inch) }; // Compilation error: not constant ❌73 constinit Static initialization order fiasco Variables with static 0 码力 | 85 页 | 512.18 KB | 6 月前3
C++高性能并行编程与优化 - 课件 - 08 CUDA 开启的 GPU 编程里 的 __device__ 或 __global__ 函数,就会出错 。 分离 __device__ 函数的声明和定义:解决 • 开启 CMAKE_CUDA_SEPARABLE_COMPILATION 选 项(设为 ON ),即可启用分离声明和定义的支持。 • 不过我还是建议把要相互调用的 __device__ 函数放在 同一个文件,这样方便编译器自动内联优化(第四课讲 过)。 glDispatchComputeIndirect 的 API 和这个很像,但毕竟没有 CUDA 可以直接在核函数里调用核函数并指定参数这么方便…… 不过,这个功能同样需要开启 CUDA_SEPARABLE_COMPILATION 。 第 2 章:内存管理 如何从核函数里返回数据? • 我们试着把 kernel 的返回类型声明为 int ,试 图从 GPU 返回数据到 CPU 。 • 但发现这样做会在编译期出错,为什么?0 码力 | 142 页 | 13.52 MB | 1 年前3
Analyzing MySQL Logs with ClickHousewith ProxySQL Extra Bonus © 2018 Percona. 9 Logs to ClickHouse © 2018 Percona. 10 Several Options Logstash (ELK Stack) Kafka Do it yourself © 2018 Percona. 11 Founder and CEO of HoneyComb • cat schema/mysqlaudit.sql | clickhouse-client –multiline • Configure ClickTail • [Required Options] • ParserName = mysqlaudit • LogFiles = /var/lib/mysql/audit.log • Dataset = clicktail.mysql_audit_log [Required Options] • ParserName = mysql • LogFiles = /var/log/mysql/db01-slow.log • Dataset = clicktail.mysql_slow_log © 2018 Percona. 27 Additional Parser Configurarion [MySQL Parser Options] Host0 码力 | 43 页 | 2.70 MB | 1 年前3
C++20's like systems • But for Windows? Not so much...47 The MSVC story for time zone data We had a few options... • Ship the entire IANA time zone database with the library The IANA time zone database is huge source for the data This is where we settled!48 The MSVC story for time zone data We had a few options... • Ship the entire IANA time zone database with the library The IANA time zone database is huge0 码力 | 55 页 | 8.67 MB | 6 月前3
C++高性能并行编程与优化 - 课件 - 01 学 C++ 从 CMake 学起• target_add_definitions(myapp PUBLIC -DMY_MACRO=1) # 与 MY_MACRO=1 等价 • target_compile_options(myapp PUBLIC -fopenmp) # 添加编译器命令行选项 • target_sources(myapp PUBLIC hello.cpp # 添加库文件的搜索路径 • add_definitions(MY_MACRO=1) # 添加一个宏定义 • add_compile_options(-fopenmp) # 添加编译器命令行选项 第三方库 - 作为纯头文件引入 • 有时候我们不满足于 C++ 标准库的功能,难免会用到一些第三方库。 • 最友好的0 码力 | 32 页 | 11.40 MB | 1 年前3
谈谈MYSQL那点事MySQL 技巧分享 技巧分享 Explain Explain 使用 使用 语法: 语法: EXPLAIN SELECT EXPLAIN SELECT select_options select_options Type: Type: 类型,是否使用了索引还是全表扫描 类型,是否使用了索引还是全表扫描 , const,eg_reg,ref,range,index0 码力 | 38 页 | 2.04 MB | 1 年前3
C++高性能并行编程与优化 - 课件 - 16 现代 CMake 模块化项目管理指南cmake/Qt5 了。 科普:亲 Unix 软件从源码安装的通用套路 • Makefile 构建系统: • ./configure --prefix=/usr --with-some-options # 生成 Makefile (这个 configure 脚本由 Autoconf 生 成) • make -j 8 # 8 核心编译,生成 libtest 安装,拷贝到 /usr/lib/libtest.so • CMake 构建系统: • cmake -B build -DCMAKE_INSTALL_PREFIX=/usr -DWITH_SOME_OPTIONS=ON # 生成 Makefile • cmake --build build --parallel 8 # 8 核心编译,生成 libtest.so •0 码力 | 56 页 | 6.87 MB | 1 年前3
Bringing Existing Code to CUDA Using constexpr and std::pmrin future compiler releases. https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/ index.html#options-for-altering-compiler-linker-behavior-expt-relaxed- constexpr Using constexpr 40 |constexpr void0 码力 | 51 页 | 3.68 MB | 6 月前3
Lock-Free Atomic Shared Pointers Without a Split Reference Count? It Can Be Done!Daniel Anderson -- danielanderson.net Solution #2: The split reference count Implementation options struct counted_cb { control_block* ctrl; long local_ref_count; }; std::atomiccctrl; 0 码力 | 45 页 | 5.12 MB | 6 月前3
C++23: An Overview of Almost All New and Updated FeaturesFeatures Garbage Collection Support17 Multidimensional Subscript Operator In the past, two options for accessing multidimensional data: Function call: data(x, y, z) Multiple levels of array0 码力 | 105 页 | 759.96 KB | 6 月前3
共 10 条
- 1













