| 698 | |
| 699 | // |
| 700 | static void initBasicParam(const int n, int &L, int &m) { |
| 701 | // split n into 2^m * L |
| 702 | m = 0; |
| 703 | L = n; |
| 704 | while (1) { |
| 705 | int rem = L % 2; |
| 706 | if (rem != 0) { |
| 707 | break; |
| 708 | } |
| 709 | m++; |
| 710 | L = L / 2; |
| 711 | } |
| 712 | |
| 713 | // when L is smaller than 64, encrease L to ensure IO efficiency. |
| 714 | while (L < 64 && m > 1) { |
| 715 | L = L * 2; |
| 716 | m--; |
| 717 | } |
| 718 | } |
| 719 | |
| 720 | static bool findStockham(mluOpHandle_t handle, int &L, int &m, int &L_sub, |
| 721 | bool &find_stockham) { |