Powered by AI: A Cambrian Explosion for C++ Software Development Toolsaarch64-linux-gnu/libthread_db.so.1". a.out: ./test/test-failed-assert.cpp:9: float fact(float): Assertion `x != 0.0' failed. Program received signal SIGABRT, Aborted. __pthread_kill_implementation (threadid=281474842450080 linux-gnu/libthread_db.so.1". a.out: ./test/test-failed-assert.cpp:9: float fact(float): Assertion `x != 0.0' failed. Program received signal SIGABRT, Aborted. __pthread_kill_implementation (threadid=281474842450080 `assert(x != 0.0);` is failing, causing the program to abort. This is because the initial loop is including a zero in the multiplication. The erroneous line is: ``` for(auto i = 0.0; i < n; i++)0 码力 | 128 页 | 23.40 MB | 6 月前3
A New Dragon in the Den: Fast Conversion From Floating-Point Numberslosses 99.5% 0.0% 0.5% Intel i7 (10510U) - gcc 13.2.1Benchmarks - centred (b) teju x dragonbox wins ties losses 99.5% 0.0% 0.5% teju x ryu wins ties losses 100.0% 0.0% 0.0% Intel i7 (10510U) 1Benchmarks - centred (b) teju x dragonbox wins ties losses 99.5% 0.0% 0.5% teju x ryu wins ties losses 100.0% 0.0% 0.0% teju dragonbox ryu σ min median max relative mean 7.14 9.04 14 x dragonbox wins ties losses 38.2% 0.0% 61.8% Intel i7 (10510U) - gcc 13.2.1Benchmarks - uncentred (a) teju x dragonbox wins ties losses 38.2% 0.0% 61.8% Only 0.000,000,000,000,01% of doubles0 码力 | 171 页 | 6.42 MB | 6 月前3
Cache-Friendly Design in Robot Path Planning7.9% ( 9.6% + 0.7% ) ==131579== LLd miss rate: 0.0% ( 0.0% + 0.1% ) ==131579== ==131579== LL refs: 615,106,923 ( 604,716,765 3,340,076 ( 2,270,562 rd + 1,069,514 wr) ==131579== LL miss rate: 0.0% ( 0.0% + 0.1% ) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 100Measuring cache 7.9% ( 9.6% + 0.7% ) ==131579== LLd miss rate: 0.0% ( 0.0% + 0.1% ) ==131579== ==131579== LL refs: 615,106,923 ( 604,716,7650 码力 | 216 页 | 10.68 MB | 6 月前3
Combining Co-Routines and Functions into a Job Systemco_await parallel(a(), vector, …) //resume here, a coroutine is its own continuation! co_return 0.0f; } CorocoroTest(int i) { co_await thread_index_t{ 0 }; co_yield 10; co_return 0; }Helmut initial_suspend(); try { Coro retObj = coroTest(i); int res = co_await retObj; co_return 0.0f; } catch (...) { promise.unhandled_exception(); } FinalSuspend: co_await promise.final_suspend(); Coro driver(int i) { Coro retObj = coroTest(i); int res = co_await retObj; co_return 0.0f; } Coroutine Frame Suspend point Function parameters Stack frame ? promise; promise.get_return_object() 0 码力 | 39 页 | 1.23 MB | 6 月前3
Algorithmic Complexitybegin(), vec.end(), 0); double inner_product = std::inner_product(vec.begin(), vec.end(), vec.begin(), 0.0); Algorithmic Complexity @ CppCon 2021 Two calls to std algorithms 76 unsigned long sum = std::accumulate(vec begin(), vec.end(), 0); double inner_product = std::inner_product(vec.begin(), vec.end(), vec.begin(), 0.0); Above calls iterate over vec twice. Would it be better to perform the two operations inside a single begin(), vec.end(), 0); double inner_product = std::inner_product(vec.begin(), vec.end(), vec.begin(), 0.0); Above calls iterate over vec twice. Would it be better to perform the two operations inside a single0 码力 | 52 页 | 1.01 MB | 6 月前3
Adventures in SIMD Thinking (Part 2 of 2)note the zeroes in the register representing data // preceding the input array. // prev = load_value(0.0f); curr = load_from(psrc); next = load_from(psrc + 16); ... }Copyright © 2020 Bob Steagall K E W note the zeroes in the register representing data // preceding the input array. // prev = load_value(0.0f); curr = load_from(psrc); next = load_from(psrc + 16); ... }Copyright © 2020 Bob Steagall K E W len) { ... for (auto pEnd = psrc + len - 16; psrc < pEnd; psrc += 16, pdst += 16) { sum = load_value(0.0f); //- Init the accumulator lo = shift_up_with_carry(prev 0 码力 | 135 页 | 551.08 KB | 6 月前3
Structure and Interpretation of Computer Programs| rv::chunk(2) | rv::transform([](auto rng) { return 1.0 / (rng[0] * rng[1]); }) | hs::accumulate(0.0, std::plus{})) * 8; }auto leibniz_pi_approximation(int n) { return (rv::iota(0, n) | rv::transform([](auto | rv::chunk(2) | rv::transform([](auto rng) { return 1.0 / (rng[0] * rng[1]); }) | hs::accumulate(0.0, std::plus{})) * 8; } fmt::print("{}\n", leibniz_pi_approximation(10000)); // 3.14149265359003671 rv::iota(0, n) | rv::transform([](auto e){ return 1 + 2 * e;}), rv::cycle(signs)) | hs::accumulate(0.0, std::plus{})) * 4; }auto leibniz_pi_approximation2_alt(int n) { return (rv::iota(0, n) | rv::transform([s0 码力 | 136 页 | 7.35 MB | 6 月前3
Writing Python Bindings for C++ Libraries: Easy-to-use PerformanceRowReader(f) rows = reader.getRows() sum_sig_change_by_trade_size, count, last_px = 0.0, 0, 0.0 for i, row in enumerate(rows): cur_trade_size = 0 for item in row RowReader(f) rows = reader.getRows() sum_sig_change_by_trade_size, count, last_px = 0.0, 0, 0.0 for i, row in enumerate(rows): cur_trade_size = 0 for item in row0 码力 | 118 页 | 2.18 MB | 6 月前3
Changing Legacy Code: With Confidencestart_position_lat = (int32_t)posn->lat; rcrd_mesg.start_position_long = (int32_t)posn->lon; total_distance = 0.0f; } /*-------------------------------------- Keep track of cumulative --------------------------------------*/ start_position_lat = (int32_t)posn->lat; rcrd_mesg.start_position_long = (int32_t)posn->lon; total_distance = 0.0f; } /*-------------------------------------- Keep track of cumulative --------------------------------------*/ start_position_lat = (int32_t)posn->lat; rcrd_mesg.start_position_long = (int32_t)posn->lon; total_distance = 0.0f; } /*-------------------------------------- Keep track of cumulative --------------------------------------*/0 码力 | 114 页 | 982.54 KB | 6 月前3
Performance Mattersmemory layout0.0 0.2 0.4 350 360 370 380 390 400 Time (s) Probability Density STABILIZER randomizes layout repeatedly one random layout per-runSTABILIZER randomizes layout repeatedly 0.0 0.2 0 -O2 0.0% 0.5% 1.0% 1.5% bzip2 gobmk zeusmp libquantum wrf astar mcf hmmer milc namd gcc lbm gromacs h264ref cactusADM perlbench sphinx3 sjeng Speedup Significant Yes No0.0% 00 码力 | 197 页 | 11.90 MB | 6 月前3
共 106 条
- 1
- 2
- 3
- 4
- 5
- 6
- 11
相关搜索词
PoweredbyAICambrianExplosionforC++SoftwareDevelopmentToolsNewDragonintheDenFastConversionFromFloatingPointNumbersCacheFriendlyDesignRobotPathPlanningCombiningCoRoutinesandFunctionsintoJobSystemAlgorithmicComplexityAdventuresSIMDThinkingPartofStructureInterpretationComputerProgramsWritingPythonBindingsLibrariesEasytousePerformanceChangingLegacyCodeWithConfidenceMatters













