Data Is All You Need for FusionData is all you need for fusion N 1int x = 4; callee(x); // do work } #include#include #include "benchmark.h" #include "matrix_lib.h" int main(..){ std::vector a; a.reserve(100); #define macro_n4 {\ b_pref = b_ptr + 4 * K;\ __asm__ __volatile__(\ "movq %7,%%r15; movq %1,%%r14; movq %6,%%r11; salq £4,%%r11;"\ "cmpq £24,%%r15; jb 3243431f;"\ "3243430:\n\t"\ COMPUTE_m24n4 "subq £24 "3243431:\n\t"\ "cmpq £8,%%r15; jb 3243433f;"\ "3243432:\n\t"\ COMPUTE_m8n4 "subq £8,%%r15; cmpq £8,%%r15; jnb 3243432b;"\ "3243433:\n\t"\ "cmpq £2,%%r15; jb 3243435f;"\ "3243434:\n\t"\ COMPUTE_m2n4 "subq 0 码力 | 151 页 | 9.90 MB | 6 月前3
Algorithmic Complexity(hopefully) know that O(n) is better than O(n2) 4Algorithmic Complexity @ CppCon 2021 Performance is the name of the game You all (hopefully) know that O(n) is better than O(n2) But there is still important 2021 Why this talk? Performance is the name of the game You all (hopefully) know that O(n) is better than O(n2) But there is still important stuff that might be overlooked And… 6Algorithmic Complexity 2021 Why this talk? Performance is the name of the game You all (hopefully) know that O(n) is better than O(n2) But there is still important stuff that might be overlooked And… the academic answer isn’t0 码力 | 52 页 | 1.01 MB | 6 月前3
Back To Basics Lifetime Management<< "\n";struct Gadget { int i; }; Gadget gadget; -2132860828 std::cout << gadget.i << "\n";struct Gadget { int i; Gadget() : i(0) {} }; Gadget gadget; 0 std::cout << gadget.i << "\n"; default 0 std::cout << gadget.i << "\n"; default member initializerstruct Gadget { int i; Gadget(int i) : i(i) {} }; Gadget gadget(42); 42 std::cout << gadget.i << "\n"; custom constructorstruct Gadget ^~~~~~ std::cout << gadget.i << "\n";struct Gadget { int i = 0; Gadget() {} Gadget(int i) : i(i) {} }; Gadget gadget; 0 std::cout << gadget.i << "\n"; explicitly implemented default constructorstruct0 码力 | 66 页 | 8.43 MB | 6 月前3
Linear Algebra Coming to Standard C++library extern “C” void dgemm_( const char* TRANSA, const char* TRANSB, const int* m, const int* n, const int* k, const double* alpha, const double A[], const int* LDA, const double* beta, const LDB, double C[], const int* LDC); int m = C.extent(0); // C^T is n x m int n = C.extent(1); int k = B.extent(1); // B^T is n x k int LDA = A.stride(0); // layout_right int LDB = B.stride(0); // // layout_right int LDC = C.stride(0); // layout_right dgemm_(“T”, “N”, &n, &m, &k, &alpha, B.data_handle(), &LDB, A.data_handle(), &LDA, &beta, C.data_handle(), &LDC); // AFTER: Use std::linalg0 码力 | 46 页 | 2.95 MB | 6 月前3
Adventures in SIMD Thinking (Part 2 of 2)Thinking (Part 2 of 2) Bob Steagall CppCon 2020 K E W B C O M P U T I N GCopyright © 2020 Bob Steagall K E W B C O M P U T I N G Agenda • Learn a little about Intel's SIMD facilities (disclaimer: I Convolution 3 CppCon 2020 - Adventures in SIMD ThinkingCopyright © 2020 Bob Steagall K E W B C O M P U T I N G Convolution • f is a signal • g is a kernel • Output f*g is the convolution • Every point of result de-noising CppCon 2020 - Adventures in SIMD Thinking 4Copyright © 2020 Bob Steagall K E W B C O M P U T I N G Convolution CppCon 2020 - Adventures in SIMD Thinking 5 S = s0 s1 s2 s3 s40 码力 | 135 页 | 551.08 KB | 6 月前3
Hello 算法 1.0.0 C++版285 13.3 子集和问题 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290 13.4 n 皇后问题 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297 13.5 小结 . . 他们是(按照 GitHub 自动生成的顺序):krahets、codingonion、nuomi1、Gonglja、Reanon、justin‑tse、danielsss、 hpstory、S‑N‑O‑R‑L‑A‑X、night‑cruise、msk397、gvenusleo、RiverTwilight、gyt95、zhuoqinyue、 Zuoxun、Xia‑Sang、mingXta、Fa : // === File: iteration.cpp === /* for 循环 */ int forLoop(int n) { int res = 0; // 循环求和 1, 2, ..., n-1, n for (int i = 1; i <= n; ++i) { res += i; } return res; } 第 2 章 复杂度分析 hello‑algo.com0 码力 | 378 页 | 17.59 MB | 1 年前3
Hello 算法 1.1.0 C++ 版283 13.3 子集和问题 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288 13.4 n 皇后问题 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295 13.5 小结 . . 自动生成的顺序):krahets、Gonglja、nuomi1、codingonion、Reanon、justin‑tse、hpstory、 danielsss、curtishd、night‑cruise、S‑N‑O‑R‑L‑A‑X、msk397、gvenusleo、RiverTwilight、gyt95、 zhuoqinyue、Zuoxun、mingXta、hello‑ikun、khoaxuantu、Fa : // === File: iteration.cpp === /* for 循环 */ int forLoop(int n) { int res = 0; // 循环求和 1, 2, ..., n-1, n for (int i = 1; i <= n; ++i) { res += i; } return res; } 图 2‑1 是该求和函数的流程框图。 第 2 章 复杂度分析0 码力 | 379 页 | 18.47 MB | 1 年前3
Hello 算法 1.0.0b5 C++版。感谢每一位投入时间与精力的撰稿人,他们是 (按照 GitHub 自动生成的顺序):krahets, justin‑tse, sjinzh, nuomi1, Reanon, Gonglja, S‑N‑O‑R‑ L‑A‑X, hpstory, danielsss, RiverTwilight, gvenusleo, msk397, gyt95, night‑cruise, zhuoqinyue, 285 13.3 子集和问题 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291 13.4 N 皇后问题 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298 13.5 小结 . . . 。 // === File: iteration.cpp === /* for 循环 */ int forLoop(int n) { int res = 0; // 循环求和 1, 2, ..., n-1, n for (int i = 1; i <= n; ++i) { res += i; } return res; } 第 2 章 复杂度分析 hello‑algo.com0 码力 | 377 页 | 30.69 MB | 1 年前3
Hello 算法 1.0.0b4 C++版。感谢每一位投入时间与精力的撰稿人,他们 是(按照 GitHub 自动生成的顺序):krahets, sjinzh, justin‑tse, Reanon, nuomi1, Gonglja, S‑N‑O‑ R‑L‑A‑X, danielsss, hpstory, RiverTwilight, msk397, gyt95, zhuoqinyue, FangYuan33, mingXta, gvenusleo 13.3. 子集和问题 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259 13.4. N 皇后问题 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266 13.5. 小结 . . + 5) × ? = 6? + 12 // 在某运行平台下 void algorithm(int n) { int a = 2; // 1 ns a = a + 1; // 1 ns a = a * 2; // 10 ns // 循环 n 次 for (int i = 0; i < n; i++) { // 1 ns ,每轮都要执行 i++ cout << 0 << endl; //0 码力 | 343 页 | 27.39 MB | 1 年前3
Hello 算法 1.2.0 简体中文 C++ 版283 13.3 子集和问题 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288 13.4 n 皇后问题 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295 13.5 小结 . . 自动生成的顺序):krahets、coderonion、Gonglja、nuomi1、Reanon、justin‑tse、hpstory、 danielsss、curtishd、night‑cruise、S‑N‑O‑R‑L‑A‑X、msk397、gvenusleo、khoaxuantu、RiverTwilight、 rongyi、gyt95、zhuoqinyue、K3v123、Zuoxun、mingXta : // === File: iteration.cpp === /* for 循环 */ int forLoop(int n) { int res = 0; // 循环求和 1, 2, ..., n-1, n for (int i = 1; i <= n; ++i) { res += i; } return res; } 第 2 章 复杂度分析 www.hello‑algo0 码力 | 379 页 | 18.48 MB | 10 月前3
共 319 条
- 1
- 2
- 3
- 4
- 5
- 6
- 32













