Skip to content

Commit 4fcf6a6

Browse files
committed
feat bfdev: update version
Signed-off-by: John Sanpe <[email protected]>
1 parent 6a624ed commit 4fcf6a6

File tree

5 files changed

+10
-12
lines changed

5 files changed

+10
-12
lines changed

bfdev

Submodule bfdev updated 87 files

build.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
options+=" -DHOST_C_COMPILER=/bin/gcc"
77
options+=" -DENABLE_EXAMPLES=ON"
8+
options+=" -DCMAKE_EXPORT_COMPILE_COMMANDS=ON"
89
options+=" --toolchain cmake/toolchain.cmake"
910

1011
cmake -Bbuild $options

examples/benchmark/crc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ for (count = 0; count < TEST_LOOP; ++count) { \
3535

3636
int crc_benchmark(int argc, char const *argv[])
3737
{
38-
bfdev_prandom_state_t pstate;
38+
bfdev_prandom_t pstate;
3939
unsigned int count, loop;
4040
uint8_t *buff;
4141
size_t index;

examples/benchmark/mpi.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include "main.h"
1313
#include "py32f0xx_hal.h"
1414

15-
#define TEST_LEN 200
15+
#define TEST_LEN 100
1616
#define TEST_SIZE (TEST_LEN / 4 + 1)
1717
#define TEST_LOOP (TEST_LEN / 1.39793 + 1)
1818

@@ -29,24 +29,21 @@ int mpi_benchmark(void)
2929
(vq = bfdev_mpi_create(NULL))))
3030
return -ENOMEM;
3131

32-
bfdev_log_notice("Generate bignum: %u\n", TEST_SIZE);
33-
if ((retval = bfdev_mpi_set(vw, 16 * 5)) ||
34-
(retval = bfdev_mpi_set(vv, 239 * 4)) ||
35-
(retval = bfdev_mpi_set(vq, 10000)))
32+
if ((retval = bfdev_mpi_seti(vw, 16 * 5)) ||
33+
(retval = bfdev_mpi_seti(vv, 4 * 239)) ||
34+
(retval = bfdev_mpi_seti(vq, 10000)))
3635
return retval;
3736

3837
for (k = 0; k < TEST_SIZE; ++k) {
3938
if ((retval = bfdev_mpi_mul(vw, vw, vq)) ||
4039
(retval = bfdev_mpi_mul(vv, vv, vq)))
4140
return retval;
42-
43-
iwdg_touch();
4441
}
4542

46-
bfdev_log_notice("Calculate PI %d:\n", TEST_LEN);
43+
bfdev_log_info("Convergence Machin %d:\n", TEST_LEN);
4744
start = HAL_GetTick();
4845
for (k = 1; k <= TEST_LOOP; ++k) {
49-
if ((retval = bfdev_mpi_divi(vw, vw, vw, 25)) ||
46+
if ((retval = bfdev_mpi_divi(vw, vw, vw, 5 * 5)) ||
5047
(retval = bfdev_mpi_divi(vv, vv, vv, 239 * 239)) ||
5148
(retval = bfdev_mpi_sub(vq, vw, vv)) ||
5249
(retval = bfdev_mpi_divi(vq, vq, vq, 2 * k - 1)))

examples/benchmark/rbtree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ int rbtree_benchmark(void)
5959
for (loop = 0; loop < TEST_LOOP; ++loop) {
6060
for (count = 0; count < TEST_LEN; ++count)
6161
bfdev_rb_insert(&bench_root, &node[count].node, demo_cmp, NULL);
62-
bench_root = BFDEV_RB_INIT;
62+
bench_root = BFDEV_RB_INIT();
6363
iwdg_touch();
6464
}
6565

0 commit comments

Comments
 (0)