c2ImageD11 0.4.2__tar.gz → 0.4.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {c2imaged11-0.4.2 → c2imaged11-0.4.3}/AGENTS.md +16 -0
- {c2imaged11-0.4.2/c2ImageD11.egg-info → c2imaged11-0.4.3}/PKG-INFO +1 -1
- {c2imaged11-0.4.2 → c2imaged11-0.4.3}/c2ImageD11/__init__.py +1 -8
- {c2imaged11-0.4.2 → c2imaged11-0.4.3/c2ImageD11.egg-info}/PKG-INFO +1 -1
- {c2imaged11-0.4.2 → c2imaged11-0.4.3}/lib/interface/_cImageD11.c2py +41 -17
- {c2imaged11-0.4.2 → c2imaged11-0.4.3}/lib/interface/_cImageD11_wrapper.c +2240 -2039
- {c2imaged11-0.4.2 → c2imaged11-0.4.3}/lib/meson.build +22 -19
- {c2imaged11-0.4.2 → c2imaged11-0.4.3}/tests/test_equivalence.py +85 -4
- {c2imaged11-0.4.2 → c2imaged11-0.4.3}/tests/test_variants.py +19 -7
- {c2imaged11-0.4.2 → c2imaged11-0.4.3}/.githooks/check_all_pythons.sh +0 -0
- {c2imaged11-0.4.2 → c2imaged11-0.4.3}/.githooks/pre-commit +0 -0
- {c2imaged11-0.4.2 → c2imaged11-0.4.3}/.githooks/pre-push +0 -0
- {c2imaged11-0.4.2 → c2imaged11-0.4.3}/.github/workflows/docs.yml +0 -0
- {c2imaged11-0.4.2 → c2imaged11-0.4.3}/.github/workflows/release.yml +0 -0
- {c2imaged11-0.4.2 → c2imaged11-0.4.3}/.github/workflows/test-aarch64.yml +0 -0
- {c2imaged11-0.4.2 → c2imaged11-0.4.3}/.github/workflows/test-py27.yml +0 -0
- {c2imaged11-0.4.2 → c2imaged11-0.4.3}/.github/workflows/test.yml +0 -0
- {c2imaged11-0.4.2 → c2imaged11-0.4.3}/LICENSE +0 -0
- {c2imaged11-0.4.2 → c2imaged11-0.4.3}/MANIFEST.in +0 -0
- {c2imaged11-0.4.2 → c2imaged11-0.4.3}/README.md +0 -0
- {c2imaged11-0.4.2 → c2imaged11-0.4.3}/c2ImageD11.egg-info/SOURCES.txt +0 -0
- {c2imaged11-0.4.2 → c2imaged11-0.4.3}/c2ImageD11.egg-info/dependency_links.txt +0 -0
- {c2imaged11-0.4.2 → c2imaged11-0.4.3}/c2ImageD11.egg-info/not-zip-safe +0 -0
- {c2imaged11-0.4.2 → c2imaged11-0.4.3}/c2ImageD11.egg-info/requires.txt +0 -0
- {c2imaged11-0.4.2 → c2imaged11-0.4.3}/c2ImageD11.egg-info/top_level.txt +0 -0
- {c2imaged11-0.4.2 → c2imaged11-0.4.3}/lib/interface/c2py.h +0 -0
- {c2imaged11-0.4.2 → c2imaged11-0.4.3}/lib/interface/c2py_amd64.h +0 -0
- {c2imaged11-0.4.2 → c2imaged11-0.4.3}/lib/interface/c2py_arm64.h +0 -0
- {c2imaged11-0.4.2 → c2imaged11-0.4.3}/lib/interface/c2py_ppc64.h +0 -0
- {c2imaged11-0.4.2 → c2imaged11-0.4.3}/pyproject.toml +0 -0
- {c2imaged11-0.4.2 → c2imaged11-0.4.3}/setup.cfg +0 -0
- {c2imaged11-0.4.2 → c2imaged11-0.4.3}/setup.py +0 -0
- {c2imaged11-0.4.2 → c2imaged11-0.4.3}/tests/benchmark_timing.py +0 -0
- {c2imaged11-0.4.2 → c2imaged11-0.4.3}/tests/conftest.py +0 -0
- {c2imaged11-0.4.2 → c2imaged11-0.4.3}/tests/diag_format.py +0 -0
- {c2imaged11-0.4.2 → c2imaged11-0.4.3}/tests/test_buffer.py +0 -0
- {c2imaged11-0.4.2 → c2imaged11-0.4.3}/tests/test_geometry_precision.py +0 -0
- {c2imaged11-0.4.2 → c2imaged11-0.4.3}/tests/test_type_equivalence.py +0 -0
- {c2imaged11-0.4.2 → c2imaged11-0.4.3}/tests/test_typecheck.py +0 -0
- {c2imaged11-0.4.2 → c2imaged11-0.4.3}/tools/harvester.py +0 -0
- {c2imaged11-0.4.2 → c2imaged11-0.4.3}/tools/strip_c2py.py +0 -0
|
@@ -302,6 +302,9 @@ Files live in `lib/functions/score_and_refine/`:
|
|
|
302
302
|
- `score_and_refine_f32.cpp` — f32 instantiation (gv.type == float)
|
|
303
303
|
- `bench.py` — benchmarks f64 vs f32 at multiple problem sizes
|
|
304
304
|
- `test_data.py` — reproducible test data generator
|
|
305
|
+
- `sar_f{32,64}_{aos,soa}_avx{2,512}.c` — hand-written AVX2/AVX-512 kernels
|
|
306
|
+
(`sar_*.c` for score_and_refine, `score_f*_avx*.c` in `lib/functions/score/`
|
|
307
|
+
for score())
|
|
305
308
|
- `score_and_refine_f64_avx2.cpp` (future)
|
|
306
309
|
- `score_and_refine_f64_avx512.cpp` (future)
|
|
307
310
|
- `score_and_refine_f32_avx2.cpp` (future)
|
|
@@ -312,6 +315,19 @@ Variants share the same Python name `score_and_refine`. c2py23 dispatches via
|
|
|
312
315
|
variant `.cpp` files are prepended before the `.c` baseline in the
|
|
313
316
|
generated dispatch chain (first-match wins).
|
|
314
317
|
|
|
318
|
+
OpenMP dispatch is shared, not per-file: `lib/functions/common/omp_dispatch.hpp`
|
|
319
|
+
provides C++ templates `dispatch_score_aos/soa` (score) and
|
|
320
|
+
`dispatch_sar_aos/soa` (score_and_refine), parameterized by the gv element
|
|
321
|
+
type (float/double) and the kernel function. The parallelization cutoff is a
|
|
322
|
+
runtime value (default 10000), settable from Python via
|
|
323
|
+
`c2ImageD11.cimaged11_omp_set_min_ng()` / read via
|
|
324
|
+
`cimaged11_omp_get_min_ng()`. The AVX2/AVX-512 kernels' scalar
|
|
325
|
+
tails and hsum helpers live in `lib/functions/common/score_tail.hpp` and use
|
|
326
|
+
`nearbyint()` (NOT the `(x+MAGIC)-MAGIC` trick): those files are compiled
|
|
327
|
+
with `-ffast-math`, which folds the trick to identity and would silently
|
|
328
|
+
count every tail row (issue #33). The `-O2` baseline keeps the magic trick
|
|
329
|
+
and is guarded by `verify_rounding()` on import.
|
|
330
|
+
|
|
315
331
|
Harvester now scans `.cpp` files and merges `C2PY_BEGIN` blocks with the
|
|
316
332
|
same `py_sig` by prepending `c_overloads` from each variant.
|
|
317
333
|
|
|
@@ -10,7 +10,7 @@ Provides:
|
|
|
10
10
|
|
|
11
11
|
from __future__ import absolute_import, division, print_function, unicode_literals
|
|
12
12
|
|
|
13
|
-
__version__ = "0.4.
|
|
13
|
+
__version__ = "0.4.3"
|
|
14
14
|
|
|
15
15
|
import os
|
|
16
16
|
import platform
|
|
@@ -90,13 +90,6 @@ if _mod is not None:
|
|
|
90
90
|
_mod.blobproperties = blobproperties
|
|
91
91
|
_mod.sparse_blob2Dproperties = sparse_blob2Dproperties
|
|
92
92
|
|
|
93
|
-
# -----------------------------------------------------------------------
|
|
94
|
-
# OpenMP minimum ng threshold. Must match the `ng > 50000` guard in
|
|
95
|
-
# lib/functions/score_and_refine/score_and_refine.hpp. Measured cutoff:
|
|
96
|
-
# ng <= 10000 | single-thread; ng > 10000 | ~2x speedup on x86_64.
|
|
97
|
-
# -----------------------------------------------------------------------
|
|
98
|
-
OMP_MIN_NG = 10000
|
|
99
|
-
|
|
100
93
|
|
|
101
94
|
# -----------------------------------------------------------------------
|
|
102
95
|
# OpenMP safety
|
|
@@ -75,10 +75,26 @@
|
|
|
75
75
|
"../functions/score_and_refine/score_and_refine_f32_sse41.cpp",
|
|
76
76
|
"../functions/score_and_refine/score_and_refine_f64_soa_sse41.cpp",
|
|
77
77
|
"../functions/score_and_refine/score_and_refine_f64_sse41.cpp",
|
|
78
|
+
"../functions/score/score_f32_avx2.cpp",
|
|
79
|
+
"../functions/score/score_f32_soa_avx2.cpp",
|
|
80
|
+
"../functions/score/score_f64_avx2.cpp",
|
|
81
|
+
"../functions/score/score_f64_soa_avx2.cpp",
|
|
82
|
+
"../functions/score_and_refine/sar_f32_aos_avx2.cpp",
|
|
83
|
+
"../functions/score_and_refine/sar_f32_soa_avx2.cpp",
|
|
84
|
+
"../functions/score_and_refine/sar_f64_aos_avx2.cpp",
|
|
85
|
+
"../functions/score_and_refine/sar_f64_soa_avx2.cpp",
|
|
78
86
|
"../functions/score_and_refine/score_and_refine_f32_avx2.cpp",
|
|
79
87
|
"../functions/score_and_refine/score_and_refine_f32_soa_avx2.cpp",
|
|
80
88
|
"../functions/score_and_refine/score_and_refine_f64_avx2.cpp",
|
|
81
89
|
"../functions/score_and_refine/score_and_refine_f64_soa_avx2.cpp",
|
|
90
|
+
"../functions/score/score_f32_avx512.cpp",
|
|
91
|
+
"../functions/score/score_f32_soa_avx512.cpp",
|
|
92
|
+
"../functions/score/score_f64_avx512.cpp",
|
|
93
|
+
"../functions/score/score_f64_soa_avx512.cpp",
|
|
94
|
+
"../functions/score_and_refine/sar_f32_aos_avx512.cpp",
|
|
95
|
+
"../functions/score_and_refine/sar_f32_soa_avx512.cpp",
|
|
96
|
+
"../functions/score_and_refine/sar_f64_aos_avx512.cpp",
|
|
97
|
+
"../functions/score_and_refine/sar_f64_soa_avx512.cpp",
|
|
82
98
|
"../functions/score_and_refine/score_and_refine_f32_avx512.cpp",
|
|
83
99
|
"../functions/score_and_refine/score_and_refine_f32_soa_avx512.cpp",
|
|
84
100
|
"../functions/score_and_refine/score_and_refine_f64_avx512.cpp",
|
|
@@ -405,6 +421,31 @@
|
|
|
405
421
|
"doc": "Return the maximum number of OpenMP threads available.",
|
|
406
422
|
"py_sig": "cimaged11_omp_get_max_threads() -> int",
|
|
407
423
|
},
|
|
424
|
+
{
|
|
425
|
+
"c_overloads": [
|
|
426
|
+
{
|
|
427
|
+
"map": {},
|
|
428
|
+
"sig": "int cimaged11_omp_get_min_ng()",
|
|
429
|
+
},
|
|
430
|
+
],
|
|
431
|
+
"doc": "Return the minimum number of g-vectors before the score family\nparallelizes with OpenMP.",
|
|
432
|
+
"py_sig": "cimaged11_omp_get_min_ng() -> int",
|
|
433
|
+
},
|
|
434
|
+
{
|
|
435
|
+
"c_overloads": [
|
|
436
|
+
{
|
|
437
|
+
"map": {
|
|
438
|
+
"n": "n",
|
|
439
|
+
},
|
|
440
|
+
"sig": "void cimaged11_omp_set_min_ng(int n)",
|
|
441
|
+
},
|
|
442
|
+
],
|
|
443
|
+
"doc": "Set the minimum number of g-vectors before the score family\nparallelizes with OpenMP. Negative values are clamped to 0.",
|
|
444
|
+
"params": {
|
|
445
|
+
"n": "Minimum ng. Pass 0 to always parallelize (with >1 thread);\npass a huge value to force single-threaded.",
|
|
446
|
+
},
|
|
447
|
+
"py_sig": "cimaged11_omp_set_min_ng(n: int) -> void",
|
|
448
|
+
},
|
|
408
449
|
{
|
|
409
450
|
"c_overloads": [
|
|
410
451
|
{
|
|
@@ -2758,7 +2799,6 @@
|
|
|
2758
2799
|
"../functions/score/score_fallback.h",
|
|
2759
2800
|
"../functions/score/score_stubs.c",
|
|
2760
2801
|
"../functions/score_and_assign/score_and_assign.c",
|
|
2761
|
-
"../functions/score_and_refine/sar_omp.h",
|
|
2762
2802
|
"../functions/score_and_refine/sar_popcnt.h",
|
|
2763
2803
|
"../functions/score_and_refine/score_and_refine.c",
|
|
2764
2804
|
"../functions/score_gvec_z/score_gvec_z.c",
|
|
@@ -2770,22 +2810,6 @@
|
|
|
2770
2810
|
"../functions/splat/splat.c",
|
|
2771
2811
|
"../functions/uint16_to_float_darkflm/uint16_to_float_darkflm.c",
|
|
2772
2812
|
"../functions/uint16_to_float_darksub/uint16_to_float_darksub.c",
|
|
2773
|
-
"../functions/score/score_f32_avx2.c",
|
|
2774
|
-
"../functions/score/score_f32_soa_avx2.c",
|
|
2775
|
-
"../functions/score/score_f64_avx2.c",
|
|
2776
|
-
"../functions/score/score_f64_soa_avx2.c",
|
|
2777
|
-
"../functions/score_and_refine/sar_f32_aos_avx2.c",
|
|
2778
|
-
"../functions/score_and_refine/sar_f32_soa_avx2.c",
|
|
2779
|
-
"../functions/score_and_refine/sar_f64_aos_avx2.c",
|
|
2780
|
-
"../functions/score_and_refine/sar_f64_soa_avx2.c",
|
|
2781
|
-
"../functions/score/score_f32_avx512.c",
|
|
2782
|
-
"../functions/score/score_f32_soa_avx512.c",
|
|
2783
|
-
"../functions/score/score_f64_avx512.c",
|
|
2784
|
-
"../functions/score/score_f64_soa_avx512.c",
|
|
2785
|
-
"../functions/score_and_refine/sar_f32_aos_avx512.c",
|
|
2786
|
-
"../functions/score_and_refine/sar_f32_soa_avx512.c",
|
|
2787
|
-
"../functions/score_and_refine/sar_f64_aos_avx512.c",
|
|
2788
|
-
"../functions/score_and_refine/sar_f64_soa_avx512.c",
|
|
2789
2813
|
],
|
|
2790
2814
|
"timing": True,
|
|
2791
2815
|
}
|