LMMP 4.3.0
Lamina High-Precision Arithmetic Library
载入中...
搜索中...
未找到
limb_sizes.h
浏览该文件的文档.
1/**
2 * Copyright (C) 2026 HJimmyK (Jericho Knox)
3 *
4 * This file is part of LMMP.
5 *
6 * LMMP is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU Lesser General Public License as
8 * published by the Free Software Foundation; either version 3 of
9 * the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library. If not, see
18 * <https://www.gnu.org/licenses/>.
19 *
20 * SPDX-License-Identifier: LGPL-3.0-or-later
21 */
22
23#ifndef LMMP_PERF_LIMB_SIZES_H
24#define LMMP_PERF_LIMB_SIZES_H
25
26#include "support/perf.h"
27#include "lmmp/lmmpn.h"
28
29static inline void run_limb_sizes(const char* name, double (*bench)(mp_size_t, const bench_options*)) {
30 const mp_size_t sizes[] = {100, 1000, 10000};
31 for (size_t i = 0; i < ARRAY_SIZE(sizes); ++i) {
32 mp_size_t n = sizes[i];
33 report_n(name, n, bench(n, &bench_default), n * 8.0);
34 }
35}
36
37#endif
static void run_limb_sizes(const char *name, double(*bench)(mp_size_t, const bench_options *))
Copyright (C) 2026 HJimmyK (Jericho Knox)
uint64_t mp_size_t
定义 lmmp.h:93
#define n
#define ARRAY_SIZE(a)
Copyright (C) 2026 HJimmyK (Jericho Knox)
定义 perf.h:40