Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void sampling(FILE *logf, float out[32], const int n)
- {
- const int TRANS_NUM = N_MAX / BLOCK_NUM;
- assert(n <= TRANS_NUM);
- const uint8_t *pool = &g_commandpool[0];
- const uint32_t commandlen = g_commandlen;
- const bool tbc = g_use_time_base_correction;
- const int basemasure_n = 10; // 増やし過ぎないほうが良さそう
- double base = 0;
- double newbase = 0;
- if (tbc)
- base = measure(pool, basemasure_n);
- for (int i = 0; i < 32; i++) {
- const int ix = order_R(i);
- const uint32_t R = 1 << ix;
- const uint8_t *command = pool + commandlen * TRANS_NUM * ix;
- static const char *ordinal[] = { "", "1st", "2nd", "3rd", "4th" };
- teeprintf(logf, "%s R: %08x / total_ave : ", ordinal[g_stage], R);
- double total_ave = measure(command, n) / n;
- if (tbc) {
- newbase = measure(pool, basemasure_n);
- const double t = base / ((base + newbase) * 0.5);
- total_ave *= t;
- teeprintf(logf, "%f ms / x%f, %+f ms\n", total_ave, t, newbase - base);
- }
- else {
- teeprintf(logf, "%f ms\n", total_ave);
- }
- out[ix] = static_cast<float>(total_ave);
- base = newbase;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement