diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2023-11-08 14:04:36 +0100 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2023-11-08 14:04:36 +0100 |
| commit | 72c9082c9824c7ffecc97a94083aa350956285e4 (patch) | |
| tree | 77f1184e58887f618f30678821b8e2672799d852 | |
| parent | 41d6b7aea5f1c9abddf5377dc6f37d8d197e548b (diff) | |
| download | nissy-core-72c9082c9824c7ffecc97a94083aa350956285e4.tar.gz nissy-core-72c9082c9824c7ffecc97a94083aa350956285e4.zip | |
Change include statement
| -rw-r--r-- | README.md | 15 | ||||
| -rw-r--r-- | cube.c | 111 | ||||
| -rw-r--r-- | cube.h | 3 | ||||
| -rw-r--r-- | test/00_basic/basic_tests.c | 4 | ||||
| -rw-r--r-- | test/010_io_H48_read_write/io_H48_tests.c | 4 | ||||
| -rw-r--r-- | test/011_io_SRC_write/io_SRC_tests.c | 4 | ||||
| -rw-r--r-- | test/012_io_AVX_write/io_AVX_tests.c | 4 | ||||
| -rw-r--r-- | test/020_move/move_tests.c | 4 | ||||
| -rw-r--r-- | test/030_inverse_cube/inverse_tests.c | 4 | ||||
| -rw-r--r-- | test/040_compose/compose_tests.c | 4 | ||||
| -rw-r--r-- | test/050_transform/transform_tests.c | 4 | ||||
| -rw-r--r-- | test/061_coord_eo/coord_eo_tests.c | 4 |
12 files changed, 106 insertions, 59 deletions
| @@ -37,17 +37,18 @@ for benchmarks. | |||
| 37 | 37 | ||
| 38 | ## TODO: | 38 | ## TODO: |
| 39 | 39 | ||
| 40 | ### Trivial things | 40 | ### Generic solver |
| 41 | 41 | ||
| 42 | * Remove unnecessary prototypes for static functions | ||
| 43 | * getpiece and similar macros: remove? make functions? | ||
| 44 | |||
| 45 | ### Simple solver | ||
| 46 | |||
| 47 | * tests | ||
| 48 | * finish implementation | 42 | * finish implementation |
| 43 | * tests: solve full cube (max 7-8 moves?) | ||
| 44 | * more tests: eo and other stuff | ||
| 49 | * benchmarks | 45 | * benchmarks |
| 50 | 46 | ||
| 47 | ### Add NISS | ||
| 48 | |||
| 49 | * Add mask to moves (e.g. U | NISS where NISS = 32 or something) | ||
| 50 | * Adapt readmoves and writemoves | ||
| 51 | |||
| 51 | ### Coordinates | 52 | ### Coordinates |
| 52 | 53 | ||
| 53 | * [done] eo | 54 | * [done] eo |
| @@ -2,6 +2,10 @@ | |||
| 2 | #include <stdbool.h> | 2 | #include <stdbool.h> |
| 3 | #include <string.h> | 3 | #include <string.h> |
| 4 | 4 | ||
| 5 | #ifdef CUBE_AVX2 | ||
| 6 | #include <immintrin.h> | ||
| 7 | #endif | ||
| 8 | |||
| 5 | #ifdef DEBUG | 9 | #ifdef DEBUG |
| 6 | #include <stdio.h> | 10 | #include <stdio.h> |
| 7 | #define DBG_LOG(...) fprintf(stderr, __VA_ARGS__) | 11 | #define DBG_LOG(...) fprintf(stderr, __VA_ARGS__) |
| @@ -250,11 +254,6 @@ typedef struct { | |||
| 250 | uint8_t e[12]; | 254 | uint8_t e[12]; |
| 251 | } cube_array_t; | 255 | } cube_array_t; |
| 252 | 256 | ||
| 253 | #define get_edge(cube, i) (cube).e[(i)] | ||
| 254 | #define get_corner(cube, i) (cube).c[(i)] | ||
| 255 | #define set_edge(cube, i, p) (cube).e[(i)] = (p) | ||
| 256 | #define set_corner(cube, i, p) (cube).c[(i)] = (p) | ||
| 257 | |||
| 258 | static bool equal_array(cube_array_t, cube_array_t); | 257 | static bool equal_array(cube_array_t, cube_array_t); |
| 259 | static bool iserror_array(cube_array_t); | 258 | static bool iserror_array(cube_array_t); |
| 260 | static bool isconsistent_array(cube_array_t); | 259 | static bool isconsistent_array(cube_array_t); |
| @@ -372,7 +371,7 @@ readcube_array_H48(char *buf) | |||
| 372 | if ((orient = readeo(b)) == _error) | 371 | if ((orient = readeo(b)) == _error) |
| 373 | return _zerocube_array; | 372 | return _zerocube_array; |
| 374 | b++; | 373 | b++; |
| 375 | set_edge(ret, i, piece | orient); | 374 | ret.e[i] = piece | orient; |
| 376 | } | 375 | } |
| 377 | for (i = 0; i < 8; i++) { | 376 | for (i = 0; i < 8; i++) { |
| 378 | while (*b == ' ' || *b == '\t' || *b == '\n') | 377 | while (*b == ' ' || *b == '\t' || *b == '\n') |
| @@ -383,7 +382,7 @@ readcube_array_H48(char *buf) | |||
| 383 | if ((orient = readco(b)) == _error) | 382 | if ((orient = readco(b)) == _error) |
| 384 | return _zerocube_array; | 383 | return _zerocube_array; |
| 385 | b++; | 384 | b++; |
| 386 | set_corner(ret, i, piece | orient); | 385 | ret.c[i] = piece | orient; |
| 387 | } | 386 | } |
| 388 | 387 | ||
| 389 | return ret; | 388 | return ret; |
| @@ -441,7 +440,7 @@ writecube_array_AVX(cube_array_t cube, char *buf) | |||
| 441 | ptr = 30; | 440 | ptr = 30; |
| 442 | 441 | ||
| 443 | for (i = 11; i >= 0; i--) { | 442 | for (i = 11; i >= 0; i--) { |
| 444 | piece = get_edge(cube, i); | 443 | piece = cube.e[i]; |
| 445 | ptr += writepiece_SRC(piece, buf + ptr); | 444 | ptr += writepiece_SRC(piece, buf + ptr); |
| 446 | } | 445 | } |
| 447 | 446 | ||
| @@ -449,7 +448,7 @@ writecube_array_AVX(cube_array_t cube, char *buf) | |||
| 449 | ptr += 25; | 448 | ptr += 25; |
| 450 | 449 | ||
| 451 | for (i = 7; i >= 0; i--) { | 450 | for (i = 7; i >= 0; i--) { |
| 452 | piece = get_corner(cube, i); | 451 | piece = cube.c[i]; |
| 453 | ptr += writepiece_SRC(piece, buf + ptr); | 452 | ptr += writepiece_SRC(piece, buf + ptr); |
| 454 | } | 453 | } |
| 455 | 454 | ||
| @@ -463,7 +462,7 @@ writecube_array_H48(cube_array_t cube, char *buf) | |||
| 463 | int i; | 462 | int i; |
| 464 | 463 | ||
| 465 | for (i = 0; i < 12; i++) { | 464 | for (i = 0; i < 12; i++) { |
| 466 | piece = get_edge(cube, i); | 465 | piece = cube.e[i]; |
| 467 | perm = piece & _pbits; | 466 | perm = piece & _pbits; |
| 468 | orient = (piece & _eobit) >> _eoshift; | 467 | orient = (piece & _eobit) >> _eoshift; |
| 469 | buf[4*i ] = edgestr[perm][0]; | 468 | buf[4*i ] = edgestr[perm][0]; |
| @@ -472,7 +471,7 @@ writecube_array_H48(cube_array_t cube, char *buf) | |||
| 472 | buf[4*i + 3] = ' '; | 471 | buf[4*i + 3] = ' '; |
| 473 | } | 472 | } |
| 474 | for (i = 0; i < 8; i++) { | 473 | for (i = 0; i < 8; i++) { |
| 475 | piece = get_corner(cube, i); | 474 | piece = cube.c[i]; |
| 476 | perm = piece & _pbits; | 475 | perm = piece & _pbits; |
| 477 | orient = (piece & _cobits) >> _coshift; | 476 | orient = (piece & _cobits) >> _coshift; |
| 478 | buf[48 + 5*i ] = cornerstr[perm][0]; | 477 | buf[48 + 5*i ] = cornerstr[perm][0]; |
| @@ -495,7 +494,7 @@ writecube_array_SRC(cube_array_t cube, char *buf) | |||
| 495 | ptr = 9; | 494 | ptr = 9; |
| 496 | 495 | ||
| 497 | for (i = 0; i < 8; i++) { | 496 | for (i = 0; i < 8; i++) { |
| 498 | piece = get_corner(cube, i); | 497 | piece = cube.c[i]; |
| 499 | ptr += writepiece_SRC(piece, buf + ptr); | 498 | ptr += writepiece_SRC(piece, buf + ptr); |
| 500 | } | 499 | } |
| 501 | 500 | ||
| @@ -503,7 +502,7 @@ writecube_array_SRC(cube_array_t cube, char *buf) | |||
| 503 | ptr += 8; | 502 | ptr += 8; |
| 504 | 503 | ||
| 505 | for (i = 0; i < 12; i++) { | 504 | for (i = 0; i < 12; i++) { |
| 506 | piece = get_edge(cube, i); | 505 | piece = cube.e[i]; |
| 507 | ptr += writepiece_SRC(piece, buf + ptr); | 506 | ptr += writepiece_SRC(piece, buf + ptr); |
| 508 | } | 507 | } |
| 509 | 508 | ||
| @@ -673,7 +672,7 @@ isconsistent_array(cube_array_t c) | |||
| 673 | for (i = 0; i < 12; i++) | 672 | for (i = 0; i < 12; i++) |
| 674 | found[i] = false; | 673 | found[i] = false; |
| 675 | for (i = 0; i < 12; i++) { | 674 | for (i = 0; i < 12; i++) { |
| 676 | piece = get_edge(c, i); | 675 | piece = c.e[i]; |
| 677 | p = piece & _pbits; | 676 | p = piece & _pbits; |
| 678 | e = piece & _eobit; | 677 | e = piece & _eobit; |
| 679 | if (p >= 12) | 678 | if (p >= 12) |
| @@ -689,7 +688,7 @@ isconsistent_array(cube_array_t c) | |||
| 689 | for (i = 0; i < 8; i++) | 688 | for (i = 0; i < 8; i++) |
| 690 | found[i] = false; | 689 | found[i] = false; |
| 691 | for (i = 0; i < 8; i++) { | 690 | for (i = 0; i < 8; i++) { |
| 692 | piece = get_corner(c, i); | 691 | piece = c.c[i]; |
| 693 | p = piece & _pbits; | 692 | p = piece & _pbits; |
| 694 | e = piece & _cobits; | 693 | e = piece & _cobits; |
| 695 | if (p >= 8) | 694 | if (p >= 8) |
| @@ -727,16 +726,16 @@ issolvable_array(cube_array_t c) | |||
| 727 | "issolvable: cube is inconsistent\n"); | 726 | "issolvable: cube is inconsistent\n"); |
| 728 | 727 | ||
| 729 | for (i = 0; i < 12; i++) | 728 | for (i = 0; i < 12; i++) |
| 730 | edges[i] = get_edge(c, i) & _pbits; | 729 | edges[i] = c.e[i] & _pbits; |
| 731 | for (i = 0; i < 8; i++) | 730 | for (i = 0; i < 8; i++) |
| 732 | corners[i] = get_corner(c, i) & _pbits; | 731 | corners[i] = c.c[i] & _pbits; |
| 733 | 732 | ||
| 734 | if (permsign(edges, 12) != permsign(corners, 8)) | 733 | if (permsign(edges, 12) != permsign(corners, 8)) |
| 735 | goto issolvable_parity; | 734 | goto issolvable_parity; |
| 736 | 735 | ||
| 737 | eo = 0; | 736 | eo = 0; |
| 738 | for (i = 0; i < 12; i++) { | 737 | for (i = 0; i < 12; i++) { |
| 739 | piece = get_edge(c, i); | 738 | piece = c.e[i]; |
| 740 | eo += (piece & _eobit) >> _eoshift; | 739 | eo += (piece & _eobit) >> _eoshift; |
| 741 | } | 740 | } |
| 742 | if (eo % 2 != 0) | 741 | if (eo % 2 != 0) |
| @@ -744,7 +743,7 @@ issolvable_array(cube_array_t c) | |||
| 744 | 743 | ||
| 745 | co = 0; | 744 | co = 0; |
| 746 | for (i = 0; i < 8; i++) { | 745 | for (i = 0; i < 8; i++) { |
| 747 | piece = get_corner(c, i); | 746 | piece = c.c[i]; |
| 748 | co += (piece & _cobits) >> _coshift; | 747 | co += (piece & _cobits) >> _coshift; |
| 749 | } | 748 | } |
| 750 | if (co % 3 != 0) | 749 | if (co % 3 != 0) |
| @@ -2395,9 +2394,9 @@ _invertco(cube_t c) | |||
| 2395 | 2394 | ||
| 2396 | ret = c; | 2395 | ret = c; |
| 2397 | for (i = 0; i < 8; i++) { | 2396 | for (i = 0; i < 8; i++) { |
| 2398 | piece = get_corner(c, i); | 2397 | piece = c.c[i]; |
| 2399 | orien = ((piece << 1) | (piece >> 1)) & _cobits2; | 2398 | orien = ((piece << 1) | (piece >> 1)) & _cobits2; |
| 2400 | set_corner(ret, i, (piece & _pbits) | orien); | 2399 | ret.c[i] = (piece & _pbits) | orien; |
| 2401 | } | 2400 | } |
| 2402 | 2401 | ||
| 2403 | return ret; | 2402 | return ret; |
| @@ -3377,15 +3376,15 @@ _inverse(cube_t c) | |||
| 3377 | ret = _zerocube; | 3376 | ret = _zerocube; |
| 3378 | 3377 | ||
| 3379 | for (i = 0; i < 12; i++) { | 3378 | for (i = 0; i < 12; i++) { |
| 3380 | piece = get_edge(c, i); | 3379 | piece = c.e[i]; |
| 3381 | orien = piece & _eobit; | 3380 | orien = piece & _eobit; |
| 3382 | set_edge(ret, piece & _pbits, i | orien); | 3381 | ret.e[piece & _pbits] = i | orien; |
| 3383 | } | 3382 | } |
| 3384 | 3383 | ||
| 3385 | for (i = 0; i < 8; i++) { | 3384 | for (i = 0; i < 8; i++) { |
| 3386 | piece = get_corner(c, i); | 3385 | piece = c.c[i]; |
| 3387 | orien = ((piece << 1) | (piece >> 1)) & _cobits2; | 3386 | orien = ((piece << 1) | (piece >> 1)) & _cobits2; |
| 3388 | set_corner(ret, piece & _pbits, i | orien); | 3387 | ret.c[piece & _pbits] = i | orien; |
| 3389 | } | 3388 | } |
| 3390 | 3389 | ||
| 3391 | return ret; | 3390 | return ret; |
| @@ -3400,21 +3399,21 @@ _compose(cube_t c1, cube_t c2) | |||
| 3400 | ret = _zerocube; | 3399 | ret = _zerocube; |
| 3401 | 3400 | ||
| 3402 | for (i = 0; i < 12; i++) { | 3401 | for (i = 0; i < 12; i++) { |
| 3403 | piece2 = get_edge(c2, i); | 3402 | piece2 = c2.e[i]; |
| 3404 | p = piece2 & _pbits; | 3403 | p = piece2 & _pbits; |
| 3405 | piece1 = get_edge(c1, p); | 3404 | piece1 = c1.e[p]; |
| 3406 | orien = (piece2 ^ piece1) & _eobit; | 3405 | orien = (piece2 ^ piece1) & _eobit; |
| 3407 | set_edge(ret, i, (piece1 & _pbits) | orien); | 3406 | ret.e[i] = (piece1 & _pbits) | orien; |
| 3408 | } | 3407 | } |
| 3409 | 3408 | ||
| 3410 | for (i = 0; i < 8; i++) { | 3409 | for (i = 0; i < 8; i++) { |
| 3411 | piece2 = get_corner(c2, i); | 3410 | piece2 = c2.c[i]; |
| 3412 | p = piece2 & _pbits; | 3411 | p = piece2 & _pbits; |
| 3413 | piece1 = get_corner(c1, p); | 3412 | piece1 = c1.c[p]; |
| 3414 | aux = (piece2 & _cobits) + (piece1 & _cobits); | 3413 | aux = (piece2 & _cobits) + (piece1 & _cobits); |
| 3415 | auy = (aux + _ctwist_cw) >> 2U; | 3414 | auy = (aux + _ctwist_cw) >> 2U; |
| 3416 | orien = (aux + auy) & _cobits2; | 3415 | orien = (aux + auy) & _cobits2; |
| 3417 | set_corner(ret, i, (piece1 & _pbits) | orien); | 3416 | ret.c[i] = (piece1 & _pbits) | orien; |
| 3418 | } | 3417 | } |
| 3419 | 3418 | ||
| 3420 | return ret; | 3419 | return ret; |
| @@ -3692,24 +3691,29 @@ implementation of all the solving algorithms. | |||
| 3692 | 3691 | ||
| 3693 | typedef struct { | 3692 | typedef struct { |
| 3694 | cube_t cube; | 3693 | cube_t cube; |
| 3695 | uint8_t d; | 3694 | int (*estimate)(cube_t); |
| 3696 | int max; | 3695 | uint8_t depth; |
| 3697 | move_t *sol; | 3696 | int maxsols; |
| 3698 | int ns; | 3697 | move_t *sols; |
| 3699 | int nm; | 3698 | int nsols; |
| 3700 | move_t m[20]; | 3699 | int nmoves; |
| 3700 | move_t moves[20]; | ||
| 3701 | } dfs_arg_t; | 3701 | } dfs_arg_t; |
| 3702 | 3702 | ||
| 3703 | int | 3703 | int |
| 3704 | solve_small_dfs(dfs_arg_t arg) | 3704 | solve_generic_dfs(dfs_arg_t arg) |
| 3705 | { | 3705 | { |
| 3706 | if (arg.ns == arg.max) | 3706 | int bound = arg.estimate(arg.cube); |
| 3707 | |||
| 3708 | if (arg.nsols == arg.maxsols || bound + arg.nmoves > arg.depth) | ||
| 3707 | return 0; | 3709 | return 0; |
| 3708 | 3710 | ||
| 3709 | if (issolved(arg.cube)) { | 3711 | if (bound == 0) { |
| 3710 | if (arg.nm != arg.d) | 3712 | if (arg.nmoves != arg.depth) |
| 3711 | return 0; | 3713 | return 0; |
| 3712 | memcpy(&arg.sol[arg.d*arg.ns], arg.m, arg.d * sizeof(move_t)); | 3714 | memcpy(&arg.sols[arg.depth * arg.nsols], |
| 3715 | arg.moves, | ||
| 3716 | arg.depth * sizeof(move_t)); | ||
| 3713 | return 1; | 3717 | return 1; |
| 3714 | } | 3718 | } |
| 3715 | 3719 | ||
| @@ -3718,7 +3722,13 @@ solve_small_dfs(dfs_arg_t arg) | |||
| 3718 | } | 3722 | } |
| 3719 | 3723 | ||
| 3720 | int | 3724 | int |
| 3721 | solve_small(cube_t cube, uint8_t depth, int max, move_t *sol) | 3725 | solve_generic( |
| 3726 | cube_t cube, | ||
| 3727 | int (*estimate)(cube_t), | ||
| 3728 | uint8_t depth, | ||
| 3729 | int maxsols, | ||
| 3730 | move_t *sols | ||
| 3731 | ) | ||
| 3722 | { | 3732 | { |
| 3723 | dfs_arg_t arg; | 3733 | dfs_arg_t arg; |
| 3724 | 3734 | ||
| @@ -3727,15 +3737,16 @@ solve_small(cube_t cube, uint8_t depth, int max, move_t *sol) | |||
| 3727 | 3737 | ||
| 3728 | arg = (dfs_arg_t) { | 3738 | arg = (dfs_arg_t) { |
| 3729 | .cube = cube, | 3739 | .cube = cube, |
| 3730 | .d = depth, | 3740 | .estimate = estimate, |
| 3731 | .max = max, | 3741 | .depth = depth, |
| 3732 | .sol = sol, | 3742 | .maxsols = maxsols, |
| 3733 | .ns = 0, | 3743 | .sols = sols, |
| 3734 | .nm = 0, | 3744 | .nsols = 0, |
| 3735 | .m = {0} | 3745 | .nmoves = 0, |
| 3746 | .moves = {0} | ||
| 3736 | }; | 3747 | }; |
| 3737 | 3748 | ||
| 3738 | return solve_small_dfs(arg); | 3749 | return solve_generic_dfs(arg); |
| 3739 | 3750 | ||
| 3740 | return 0; | 3751 | return 0; |
| 3741 | } | 3752 | } |
| @@ -1,5 +1,4 @@ | |||
| 1 | #ifdef CUBE_AVX2 | 1 | #ifdef CUBE_AVX2 |
| 2 | #include <immintrin.h> | ||
| 3 | typedef __m256i cube_t; | 2 | typedef __m256i cube_t; |
| 4 | #else | 3 | #else |
| 5 | typedef struct { | 4 | typedef struct { |
| @@ -34,4 +33,4 @@ cube_t transform(cube_t, trans_t); | |||
| 34 | int16_t coord_eo(cube_t); | 33 | int16_t coord_eo(cube_t); |
| 35 | 34 | ||
| 36 | /* Solvers return -1 in case of error, the number of solutions otherwise */ | 35 | /* Solvers return -1 in case of error, the number of solutions otherwise */ |
| 37 | int solve_small(cube_t, uint8_t, int, move_t *); | 36 | int solve_generic(cube_t, int (*)(cube_t), uint8_t, int, move_t *); |
diff --git a/test/00_basic/basic_tests.c b/test/00_basic/basic_tests.c index 0a8f2ac..af0f2cd 100644 --- a/test/00_basic/basic_tests.c +++ b/test/00_basic/basic_tests.c | |||
| @@ -3,6 +3,10 @@ | |||
| 3 | #include <stdio.h> | 3 | #include <stdio.h> |
| 4 | #include <string.h> | 4 | #include <string.h> |
| 5 | 5 | ||
| 6 | #ifdef CUBE_AVX2 | ||
| 7 | #include <immintrin.h> | ||
| 8 | #endif | ||
| 9 | |||
| 6 | #include "../../cube.h" | 10 | #include "../../cube.h" |
| 7 | 11 | ||
| 8 | void | 12 | void |
diff --git a/test/010_io_H48_read_write/io_H48_tests.c b/test/010_io_H48_read_write/io_H48_tests.c index 62117b9..758124e 100644 --- a/test/010_io_H48_read_write/io_H48_tests.c +++ b/test/010_io_H48_read_write/io_H48_tests.c | |||
| @@ -2,6 +2,10 @@ | |||
| 2 | #include <stdint.h> | 2 | #include <stdint.h> |
| 3 | #include <stdio.h> | 3 | #include <stdio.h> |
| 4 | 4 | ||
| 5 | #ifdef CUBE_AVX2 | ||
| 6 | #include <immintrin.h> | ||
| 7 | #endif | ||
| 8 | |||
| 5 | #include "../../cube.h" | 9 | #include "../../cube.h" |
| 6 | 10 | ||
| 7 | #define STRLENMAX 10000 | 11 | #define STRLENMAX 10000 |
diff --git a/test/011_io_SRC_write/io_SRC_tests.c b/test/011_io_SRC_write/io_SRC_tests.c index ea9005d..dd1bb7c 100644 --- a/test/011_io_SRC_write/io_SRC_tests.c +++ b/test/011_io_SRC_write/io_SRC_tests.c | |||
| @@ -2,6 +2,10 @@ | |||
| 2 | #include <stdint.h> | 2 | #include <stdint.h> |
| 3 | #include <stdio.h> | 3 | #include <stdio.h> |
| 4 | 4 | ||
| 5 | #ifdef CUBE_AVX2 | ||
| 6 | #include <immintrin.h> | ||
| 7 | #endif | ||
| 8 | |||
| 5 | #include "../../cube.h" | 9 | #include "../../cube.h" |
| 6 | 10 | ||
| 7 | #define STRLENMAX 10000 | 11 | #define STRLENMAX 10000 |
diff --git a/test/012_io_AVX_write/io_AVX_tests.c b/test/012_io_AVX_write/io_AVX_tests.c index 62a6874..e2fa3e4 100644 --- a/test/012_io_AVX_write/io_AVX_tests.c +++ b/test/012_io_AVX_write/io_AVX_tests.c | |||
| @@ -2,6 +2,10 @@ | |||
| 2 | #include <stdint.h> | 2 | #include <stdint.h> |
| 3 | #include <stdio.h> | 3 | #include <stdio.h> |
| 4 | 4 | ||
| 5 | #ifdef CUBE_AVX2 | ||
| 6 | #include <immintrin.h> | ||
| 7 | #endif | ||
| 8 | |||
| 5 | #include "../../cube.h" | 9 | #include "../../cube.h" |
| 6 | 10 | ||
| 7 | #define STRLENMAX 10000 | 11 | #define STRLENMAX 10000 |
diff --git a/test/020_move/move_tests.c b/test/020_move/move_tests.c index 0dede14..4a010f1 100644 --- a/test/020_move/move_tests.c +++ b/test/020_move/move_tests.c | |||
| @@ -2,6 +2,10 @@ | |||
| 2 | #include <stdint.h> | 2 | #include <stdint.h> |
| 3 | #include <stdio.h> | 3 | #include <stdio.h> |
| 4 | 4 | ||
| 5 | #ifdef CUBE_AVX2 | ||
| 6 | #include <immintrin.h> | ||
| 7 | #endif | ||
| 8 | |||
| 5 | #include "../../cube.h" | 9 | #include "../../cube.h" |
| 6 | 10 | ||
| 7 | #define STRLENMAX 10000 | 11 | #define STRLENMAX 10000 |
diff --git a/test/030_inverse_cube/inverse_tests.c b/test/030_inverse_cube/inverse_tests.c index b08e42e..b07ab87 100644 --- a/test/030_inverse_cube/inverse_tests.c +++ b/test/030_inverse_cube/inverse_tests.c | |||
| @@ -2,6 +2,10 @@ | |||
| 2 | #include <stdint.h> | 2 | #include <stdint.h> |
| 3 | #include <stdio.h> | 3 | #include <stdio.h> |
| 4 | 4 | ||
| 5 | #ifdef CUBE_AVX2 | ||
| 6 | #include <immintrin.h> | ||
| 7 | #endif | ||
| 8 | |||
| 5 | #include "../../cube.h" | 9 | #include "../../cube.h" |
| 6 | 10 | ||
| 7 | #define STRLENMAX 10000 | 11 | #define STRLENMAX 10000 |
diff --git a/test/040_compose/compose_tests.c b/test/040_compose/compose_tests.c index e8f0175..62f636e 100644 --- a/test/040_compose/compose_tests.c +++ b/test/040_compose/compose_tests.c | |||
| @@ -2,6 +2,10 @@ | |||
| 2 | #include <stdint.h> | 2 | #include <stdint.h> |
| 3 | #include <stdio.h> | 3 | #include <stdio.h> |
| 4 | 4 | ||
| 5 | #ifdef CUBE_AVX2 | ||
| 6 | #include <immintrin.h> | ||
| 7 | #endif | ||
| 8 | |||
| 5 | #include "../../cube.h" | 9 | #include "../../cube.h" |
| 6 | 10 | ||
| 7 | #define STRLENMAX 10000 | 11 | #define STRLENMAX 10000 |
diff --git a/test/050_transform/transform_tests.c b/test/050_transform/transform_tests.c index e199035..30d62da 100644 --- a/test/050_transform/transform_tests.c +++ b/test/050_transform/transform_tests.c | |||
| @@ -2,6 +2,10 @@ | |||
| 2 | #include <stdint.h> | 2 | #include <stdint.h> |
| 3 | #include <stdio.h> | 3 | #include <stdio.h> |
| 4 | 4 | ||
| 5 | #ifdef CUBE_AVX2 | ||
| 6 | #include <immintrin.h> | ||
| 7 | #endif | ||
| 8 | |||
| 5 | #include "../../cube.h" | 9 | #include "../../cube.h" |
| 6 | 10 | ||
| 7 | #define STRLENMAX 10000 | 11 | #define STRLENMAX 10000 |
diff --git a/test/061_coord_eo/coord_eo_tests.c b/test/061_coord_eo/coord_eo_tests.c index 3aed352..65119ef 100644 --- a/test/061_coord_eo/coord_eo_tests.c +++ b/test/061_coord_eo/coord_eo_tests.c | |||
| @@ -2,6 +2,10 @@ | |||
| 2 | #include <inttypes.h> | 2 | #include <inttypes.h> |
| 3 | #include <stdio.h> | 3 | #include <stdio.h> |
| 4 | 4 | ||
| 5 | #ifdef CUBE_AVX2 | ||
| 6 | #include <immintrin.h> | ||
| 7 | #endif | ||
| 8 | |||
| 5 | #include "../../cube.h" | 9 | #include "../../cube.h" |
| 6 | 10 | ||
| 7 | #define STRLENMAX 10000 | 11 | #define STRLENMAX 10000 |
