aboutsummaryrefslogtreecommitdiff
path: root/src/solvers/h48/distribution_h48.h
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2026-03-01 18:09:44 +0100
committerSebastiano Tronto <sebastiano@tronto.net>2026-03-01 18:09:44 +0100
commit2c291aed4bb80f07e8557284d3399cf1e2a4ccb9 (patch)
tree2c009a3ad206842b07b1cd758b8192e2154231e9 /src/solvers/h48/distribution_h48.h
parentdff3a040637f2985b5b5e369148a993183964096 (diff)
downloadnissy-core-2c291aed4bb80f07e8557284d3399cf1e2a4ccb9.tar.gz
nissy-core-2c291aed4bb80f07e8557284d3399cf1e2a4ccb9.zip
Improve Windows build support.
- Use multithreading (works with a sufficiently recent version of the Microsoft developer tools / C SDK). - Detect CPU architecture and use AVX2 or NEON when appropriate. - Automatically detect python installation path.
Diffstat (limited to 'src/solvers/h48/distribution_h48.h')
-rw-r--r--src/solvers/h48/distribution_h48.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/solvers/h48/distribution_h48.h b/src/solvers/h48/distribution_h48.h
index 93a6933..80c946e 100644
--- a/src/solvers/h48/distribution_h48.h
+++ b/src/solvers/h48/distribution_h48.h
@@ -4,11 +4,11 @@ needed for H48 because of the intertwined fallback table, and it is easier
4to have some duplication than to make these functions needlessly generic. 4to have some duplication than to make these functions needlessly generic.
5*/ 5*/
6 6
7STATIC void *getdistribution_h48_runthread(void *); 7STATIC wrapthread_return_t getdistribution_h48_runthread(void *);
8STATIC void getdistribution_h48(const unsigned char *, 8STATIC void getdistribution_h48(const unsigned char *,
9 uint64_t [static INFO_DISTRIBUTION_LEN], const tableinfo_t [static 1]); 9 uint64_t [static INFO_DISTRIBUTION_LEN], const tableinfo_t [static 1]);
10 10
11STATIC void * 11STATIC wrapthread_return_t
12getdistribution_h48_runthread(void *arg) 12getdistribution_h48_runthread(void *arg)
13{ 13{
14 getdistribution_data_t *data = (getdistribution_data_t *)arg; 14 getdistribution_data_t *data = (getdistribution_data_t *)arg;
@@ -33,7 +33,7 @@ getdistribution_h48_runthread(void *arg)
33 data->distr[(t & (m << (3*k))) >> (3*k)]--; 33 data->distr[(t & (m << (3*k))) >> (3*k)]--;
34 } 34 }
35 35
36 return NULL; 36 return wrapthread_return_val;
37} 37}
38 38
39STATIC void 39STATIC void
@@ -58,12 +58,12 @@ getdistribution_h48(
58 .distr = local_distr[i], 58 .distr = local_distr[i],
59 .table = table, 59 .table = table,
60 }; 60 };
61 wrapthread_create(&thread[i], NULL, 61 wrapthread_create(&thread[i],
62 getdistribution_h48_runthread, &targ[i]); 62 getdistribution_h48_runthread, &targ[i]);
63 } 63 }
64 64
65 for (i = 0; i < THREADS; i++) 65 for (i = 0; i < THREADS; i++)
66 wrapthread_join(thread[i], NULL); 66 wrapthread_join(thread[i]);
67 67
68 memset(distr, 0, INFO_DISTRIBUTION_LEN * sizeof(uint64_t)); 68 memset(distr, 0, INFO_DISTRIBUTION_LEN * sizeof(uint64_t));
69 for (i = 0; i < THREADS; i++) 69 for (i = 0; i < THREADS; i++)

Generated with cgit - Back to sebastiano.tronto.net