Skip to content

Commit 24d9bbf

Browse files
author
peng.li24
committed
docs: mark svml_bridge.h & npy_math_float.h as INTERNAL headers
Add INTERNAL DO NOT INCLUDE DIRECTLY banner to both files. README: clearly label public vs internal headers in Project Structure and Usage sections. core.h/linalg.h/einsum.h are the only public API.
1 parent f45415b commit 24d9bbf

3 files changed

Lines changed: 22 additions & 7 deletions

File tree

README.md

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,18 @@ All APIs are tested against Python numpy under strict bit-level comparison: ever
2727

2828
### Usage
2929

30+
**Public headers** — these are the only files you should `#include`:
31+
3032
```cpp
31-
#include "numpy/core.h"
33+
#include "numpy/core.h" // numpy.* equivalents
34+
#include "numpy/linalg.h" // numpy.linalg.*
35+
#include "numpy/einsum.h" // numpy.einsum
36+
```
3237

38+
> `numpy/svml_bridge.h` and `numpy/npy_math_float.h` are **internal** — they are
39+
> automatically pulled in by `core.h`. Do not include them directly.
40+
41+
```cpp
3342
std::vector<double> data = {1.0, 4.0, 9.0};
3443
std::vector<double> result(data.size());
3544

@@ -168,12 +177,12 @@ All 460 tests pass under strict IEEE 754 bit comparison (float64 + float32).
168177

169178
```
170179
numpycpp/
171-
├── numpy/ # native C++ headers (zero dependency)
172-
│ ├── core.h # numpy.* equivalents (pairwise_sum, element-wise, reductions, etc.)
173-
│ ├── linalg.h # numpy.linalg.* (norm, norm_axis)
174-
│ ├── einsum.h # numpy.einsum (SSE SIMD xmm, OpenMP, stride-based fast path)
175-
│ ├── svml_bridge.h # runtime dlsym resolver for numpy's SVML vector functions
176-
│ └── npy_math_float.h # numpy's own float32 polynomial approximations
180+
├── numpy/ # native C++ headers
181+
│ ├── core.h # [PUBLIC] numpy.* equivalents
182+
│ ├── linalg.h # [PUBLIC] numpy.linalg.*
183+
│ ├── einsum.h # [PUBLIC] numpy.einsum
184+
│ ├── svml_bridge.h # [INTERNAL] do not include directly
185+
│ └── npy_math_float.h # [INTERNAL] do not include directly
177186
├── pycpp/ # pybind11 wrappers (optional)
178187
│ ├── core_py.h
179188
│ ├── linalg_py.h

numpy/npy_math_float.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// INTERNAL HEADER — DO NOT INCLUDE DIRECTLY.
2+
// Use #include "numpy/core.h" which pulls this in automatically.
3+
//
14
// Bit-exact float32 math matching numpy 1.23.5 SIMD polynomial approximations.
25
// Replicates numpy's simd_exp_FLOAT, simd_log_FLOAT, simd_sincos_f32 algorithms.
36

numpy/svml_bridge.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// INTERNAL HEADER — DO NOT INCLUDE DIRECTLY.
2+
// Use #include "numpy/core.h" which pulls this in automatically.
3+
//
14
// SVML/npy bridge — bit-exact math on every x86_64 architecture.
25
//
36
// numpy uses different math implementations depending on CPU features:

0 commit comments

Comments
 (0)