CMakeLists.txtcppcon_add_test(basic SOURCES async_event.cpp main.cpp pending.cpp LIBRARIES Asia::asio Catch2::Catch2 basic)0 码力 | 1 页 | 112.00 B | 1 年前3
CMakeLists.txtcppcon_add_test(async_initiate SOURCES async_event.cpp main.cpp pending.cpp LIBRARIES Asio::asio Catch2::Catch2 async_initiate)0 码力 | 1 页 | 130.00 B | 1 年前3
CMakeLists.txtcppcon_add_test(no_service SOURCES async_event.cpp main.cpp pending.cpp LIBRARIES Asia::asio Catch2::Catch2 no_service)0 码力 | 1 页 | 122.00 B | 1 年前3
C++高性能并行编程与优化 - 课件 - 04 从汇编角度看编译器优化-fverbose-asm -S main.cpp -o /tmp/main.S 返回值:通过 eax 传出 movl $42, %eax 相当于: eax = 42; int func() { return 42; } Z4funcv: .LFB0: .cfi_startproc # main.cpp:2: return 42; movl $42, %eax #, _1 # main.cpp:3: } movl %r9d, -24(%rsp) # f, f # main.cpp:2: return a; movl -4(%rsp), %eax # a, _2 # main.cpp:3: } ret .cfi_endproc #### gcc -03 -fomit-frame-pointer -fverbose-asm -S main.cpp -o /tmp/main.S ## 开启优化:-03 return a; } Z4funciiiiii: .LFB0: .cfi_startproc # main.cpp:1: int func(int a, int b, int c, int d, int e, int f) { movl %edi, %eax # tmp90, a # main.cpp:3: } ret .cfi_endproc movl %edi, %eax 相当于: eax =0 码力 | 108 页 | 9.47 MB | 2 年前3
How Meta Made Debugging Async Code Easier with Coroutines and Sendersfex::linuxos::io_uring_context::async_read_only_file)) at /home/cppcon/cppcon24-async-demo/src/main.cpp:70 frame #2 : 0x00005555555584045 in unifex::_ch::continuation_handle::resume()() at /ho /home/cppcon/cppcon24-async-demo/src/main.cpp:103 15: main () at /home/cppcon/cppcon24-async-demo/src/main.cpp:103 16: main () at /home/cppcon/cppcon24-async-demo/src/main.cpp:103 17: main () at /home/cpp /home/cppcon/cppcon24-async-demo/src/main.cpp:105 18: __libc_start_main () at ??:0 0 : un0 码力 | 131 页 | 907.41 KB | 1 年前3
C++高性能并行编程与优化 - 课件 - 11 现代 CMake 进阶指南中添加一个可执行文件作为构建目标 main.cpp CMakeLists.txt 1 add_executable(main main.cpp) 另一种方式:先创建目标,稍后再添加源文件 main.cpp CMakeLists.txt 1 add_executable(main) 2 target_sources(main PUBLIC main.cpp) ## 如果有多个源文件呢? main.cpp | other 1 add_executable(main) 2 target_sources(main PUBLIC main.cpp other.cpp) ## 使用变量来存储 CMakeLists.txt 1 add_executable(main) 2 set(sources main.cpp other.cpp) 3 target_sources(main PUBLIC ${sources}) ${sources}) 建议把头文件也加上,这样在 VS 里可以出现在“Header Files”一栏 CMakeLists.txt 1 add_executable(main) 2 set(sources main.cpp other.cpp other.h) 3 target_sources(main PUBLIC ${sources}) 使用 GLOB 自动查找当前目录下指定扩展名的文件,实现批量添加源文件0 码力 | 166 页 | 6.54 MB | 2 年前3
C++高性能并行编程与优化 - 课件 - 12 从计算机组成原理看 C 语言指针系统特有的,Windows 上不存在,因此请勿使用 ssize_t,可以用 intptr_t 代替。 ## 实验:各种标准化类型的大小 • 我们可以通过 `sizeof(T)` 获取 T 类型的字节数。 main.cpp #include#include int main() { printf("uint8_t = %ld\n", sizeof(uint8_t)); - 一个较小类型的 short 和较大类型的 int 相加会得到什么类型?会得到 int 类型。 • 结论:小类型和大类型做数学运算( $ +-*/\% $ )会得到两个类型中的大类型。 main.cpp #include #include #include int main() { static_assert( 实验:自动类型提升(type promotion) • 对 unsigned 类型也是同理的。 • unsigned int + unsigned short = unsigned int main.cpp #include #include #include int main() { static_assert(std: 0 码力 | 128 页 | 2.95 MB | 2 年前3
C++高性能并行编程与优化 - 课件 - 01 学 C++ 从 CMake 学起|GNU|gcc|g++|gfortran| |LLVM|clang|clang++|flang| • 编译器,是一个根据源代码生成机器码的程序。 • > g++ main.cpp -o a.out - 该命令会调用编译器程序 g++,让他读取 main.cpp 中的字符串(称为源码),并根据 C++ 标准生成相应的机器指令码,输出到 a.out 这个文件中,(称为可执行文件)。 • > ./a.out 工程变大时,编译时间变得很长,改动一个地方就得全部重新编译。 因此,我们提出多文件编译的概念,文件之间通过符号声明相互引用。 • > g++ -c hello.cpp -o hello.o • > g++ -c main.cpp -o main.o - 其中使用 -c 选项指定生成临时的对象文件 main.o,之后再根据一系列对象文件进行链接,得到最终的 a.out: • > g++ hello.o main 指明依赖关系的好处: 1. 当更新了 hello.cpp 时只会重新编译 hello.o,而不需要把 main.o 也重新编译一遍。 2. 能够自动并行地发起对 hello.cpp 和 main.cpp 的编译,加快编译速度(make -j)。 3. 用通配符批量生成构建规则,避免针对每个 .cpp 和 .o 重复写 g++ 命令(%.o: %.cpp)。 但坏处也很明显: 1. make0 码力 | 32 页 | 11.40 MB | 2 年前3
Building Effective Embedded Systems: Architectural Best Practices☐ Monitoring ☐ External Interfaces Simulators ☐ Logs Logs |1|2023-09-16|10:00:00.123|INFO|main.cpp:100 \[Thread-1]: System Startup| |---|---|---|---|---| |2|2023-09-16|10:01:15.045|WARNING|sensors error - system halted| |4|2023-09-16|10:03:45.678|INFO|main.cpp:105 \[Thread-1]: System reboot initiated| |5|2023-09-16|10:05:00.256|INFO|main.cpp:110 \[Thread-1]: System Startup| |6|2023-09-16|10:06:15 malfunction detected| |14|2023-09-16|10:16:15.789|INFO|main.cpp:115 \[Thread-1]: System restart required| |15|2023-09-16|10:17:30.234|INFO|main.cpp:120 \[Thread-1]: System Startup| |16|2023-09-16|10:18:450 码力 | 241 页 | 2.28 MB | 1 年前3
LLVM's Realtime Safety Revolution: Tools for Modern Mission Critical Systemsint main() { auto v = std::vector(16); return v[16]; } > clang -fsanitize=address main.cpp >=98481==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x000105701320 at pc 0x000102d8 [[clang::nonblocking]] { auto const y = std::vector (16); } > clang++ -fsanitize=realtime main.cpp ==86660==ERROR: RealtimeSanitizer: unsafe-library-call Intercepted call to real-time unsafe function [[clang::nonblocking]] { auto y = std::vector (16); } > clang++ -fsanitize=realtime main.cpp ==86660==ERROR: RealtimeSanitizer: unsafe-library-call Intercepted call to real-time unsafe function 0 码力 | 153 页 | 1.38 MB | 1 年前3
共 127 条
- 1
- 2
- 3
- 4
- 5
- 6
- 13
相关搜索词
cppcon_add_testasync_event.cppmain.cpppending.cppLIBRARIESasync_initiateCMakeLists.txtno_serviceAsia::asioCatch2::Catch2C++高性性能高性能并行编程优化课件04Async CodeCoroutinesSendersAsyncStacksAsyncStackFrameCMakeNinja缓存变量构建类型C语言指针引用空指针内存管理二级指针并行编程GPU嵌入式系统操作系统分层设计线程协议设计原则RealtimeSanitizerLLVMPerformance constraintsMission critical systemsDavid Trevelyan & Christopher Apple













