Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion CLAUDE.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -205,8 +205,28 @@ pushpull's fully-static order×bound compile is nightly
which category a dependency is in, not about lookup.
`tools/normalise-include-delimiters.py --check` enforces it, and also checks
the converse: every quoted include must resolve beside its includer.
- **`#pragma once` on line 1 of every header — no `#ifndef` include guards.**
Line 1 with no exception, licence and provenance comments included; they keep
their text and sit one line lower. **`include/fastfields/core/dlpack.h` is
the one exception and must keep its upstream `DLPACK_DLPACK_H_` guard** — it
is a verbatim vendored copy, and that macro is what lets it and a *system*
DLPack header carrying the same guard collapse into one inclusion, which
`#pragma once` cannot do for two distinct files. Do not "finish the job" on
it. The seven other headers with third-party provenance (`impl/kernels/`'s
`atomic.h`, `parallel{,_impl}.h`, `threadpool.{h,inl}`, `distance/mesh.h`,
and `impl/cuda/utils.h`) are adaptations, not drop-in copies: each is
re-namespaced into `ff::` and none carries an upstream guard macro, so there
is nothing for a guard to interoperate with and the pragma applies to them.
A partial-file `#ifndef` is *not* a header guard and this rule leaves it
alone — `FF_LIB_BOUND_SPLINE_T` (eight `api/*.h` headers share it so they
co-include; `fastfields-dlpack`'s `ext.cpp` depends on that and says so) and
the `FF_*_MAX_NBATCH` / `FF_AUTOCAST_PINNED_HOST` build knobs all stay.
Enforced by `tools/normalise-header-guards.py --check`, which also applies
the convention and audits that no guard macro is tested from another file —
the one way deleting a `#define` could change what compiles.
- `include/fastfields/core/dlpack.h` is vendored upstream code: do not edit it,
and it is skipped by `codespell` (see `.codespellrc`).
and it is skipped by `codespell` (see `.codespellrc`). It is the only
verbatim third-party file in the tree.

## Pointers

Expand Down
5 changes: 1 addition & 4 deletions include/fastfields/api/checks.h
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
#ifndef FF_LIB_CHECKS
#define FF_LIB_CHECKS
#pragma once
#include <stdexcept>
#include <fastfields/core/dlpack.h>
#include <fastfields/core/defines.h>
Expand DownExpand Up@@ -56,5 +55,3 @@ inline void require_same_device(const DLTensor & ref, const DLTensor & t, const
}

FF_NAMESPACE_END(FF_NS)

#endif // FF_LIB_CHECKS
5 changes: 1 addition & 4 deletions include/fastfields/api/cpu/distance.h
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
#ifndef FF_CPU_DISTANCE
#define FF_CPU_DISTANCE
#pragma once
#include <fastfields/core/dlpack.h>
#include <cstdint>

Expand DownExpand Up@@ -62,5 +61,3 @@ void dt_mesh(

} // namespace cpu
} // namespace ff

#endif // FF_CPU_DISTANCE
5 changes: 1 addition & 4 deletions include/fastfields/api/cpu/posdef.h
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
#ifndef FF_CPU_POSDEF
#define FF_CPU_POSDEF
#pragma once
#include <fastfields/core/dlpack.h>
#include <cstdint>

Expand DownExpand Up@@ -80,5 +79,3 @@ void sym_invert_(

} // namespace cpu
} // namespace ff

#endif // FF_CPU_POSDEF
5 changes: 1 addition & 4 deletions include/fastfields/api/cpu/pushpull.h
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
#ifndef FF_CPU_PUSHPULL
#define FF_CPU_PUSHPULL
#pragma once
#include <fastfields/core/dlpack.h>
#include <cstdint>

Expand DownExpand Up@@ -199,5 +198,3 @@ void grad_backward(

} // namespace cpu
} // namespace ff

#endif // FF_CPU_PUSHPULL
5 changes: 1 addition & 4 deletions include/fastfields/api/cpu/pushpull_dispatch.h
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
#ifndef FF_CPU_PUSHPULL_DISPATCH
#define FF_CPU_PUSHPULL_DISPATCH
#pragma once
/**
* Private (not installed) header: the argument-marshalling helpers, the
* argument checks and the ndim x order x bound x dtype dispatch matrix
Expand DownExpand Up@@ -103,5 +102,3 @@ typedef double reduce_t;

FF_NAMESPACE_END(FF_DEVICE)
FF_NAMESPACE_END(FF_NS)

#endif // FF_CPU_PUSHPULL_DISPATCH
5 changes: 1 addition & 4 deletions include/fastfields/api/cpu/reg_field.h
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
#ifndef FF_CPU_REG_FIELD
#define FF_CPU_REG_FIELD
#pragma once
#include <fastfields/core/dlpack.h>
#include <cstdint>

Expand DownExpand Up@@ -368,5 +367,3 @@ void field_relax_rls(

} // namespace cpu
} // namespace ff

#endif // FF_CPU_REG_FIELD
5 changes: 1 addition & 4 deletions include/fastfields/api/cpu/reg_flow.h
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
#ifndef FF_CPU_REG_FLOW
#define FF_CPU_REG_FLOW
#pragma once
#include <fastfields/core/dlpack.h>
#include <cstdint>

Expand DownExpand Up@@ -404,5 +403,3 @@ void flow_relax_rls(

} // namespace cpu
} // namespace ff

#endif // FF_CPU_REG_FLOW
5 changes: 1 addition & 4 deletions include/fastfields/api/cpu/resize.h
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
#ifndef FF_CPU_RESIZE
#define FF_CPU_RESIZE
#pragma once
#include <fastfields/core/dlpack.h>
#include <cstdint>

Expand DownExpand Up@@ -38,5 +37,3 @@ void resample(

} // namespace cpu
} // namespace ff

#endif // FF_CPU_RESIZE
5 changes: 1 addition & 4 deletions include/fastfields/api/cpu/restrict.h
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
#ifndef FF_CPU_RESTRICT
#define FF_CPU_RESTRICT
#pragma once
#include <fastfields/core/dlpack.h>
#include <cstdint>

Expand DownExpand Up@@ -40,5 +39,3 @@ void restriction(

} // namespace cpu
} // namespace ff

#endif // FF_CPU_RESTRICT
5 changes: 1 addition & 4 deletions include/fastfields/api/cpu/solve_field.h
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
#ifndef FF_CPU_SOLVE_FIELD
#define FF_CPU_SOLVE_FIELD
#pragma once
#include <fastfields/core/dlpack.h>
#include <cstdint>

Expand DownExpand Up@@ -66,5 +65,3 @@ void field_cg(

} // namespace cpu
} // namespace ff

#endif // FF_CPU_SOLVE_FIELD
5 changes: 1 addition & 4 deletions include/fastfields/api/cpu/splinc.h
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
#ifndef FF_CPU_SPLINC
#define FF_CPU_SPLINC
#pragma once
#include <fastfields/core/dlpack.h>
#include <cstdint>

Expand DownExpand Up@@ -28,5 +27,3 @@ void spline_coeff(

} // namespace cpu
} // namespace ff

#endif // FF_CPU_SPLINC
5 changes: 1 addition & 4 deletions include/fastfields/api/cuda/distance.h
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
#ifndef FF_CUDA_DISTANCE
#define FF_CUDA_DISTANCE
#pragma once
#include <fastfields/core/dlpack.h>
#include <cstdint>

Expand DownExpand Up@@ -62,5 +61,3 @@ void dt_mesh(

} // namespace cuda
} // namespace ff

#endif // FF_CUDA_DISTANCE
5 changes: 1 addition & 4 deletions include/fastfields/api/cuda/posdef.h
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
#ifndef FF_CUDA_POSDEF
#define FF_CUDA_POSDEF
#pragma once
#include <fastfields/core/dlpack.h>
#include <cstdint>

Expand DownExpand Up@@ -80,5 +79,3 @@ void sym_invert_(

} // namespace cuda
} // namespace ff

#endif // FF_CUDA_POSDEF
5 changes: 1 addition & 4 deletions include/fastfields/api/cuda/pushpull.h
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
#ifndef FF_CUDA_PUSHPULL
#define FF_CUDA_PUSHPULL
#pragma once
#include <fastfields/core/dlpack.h>
#include <cstdint>

Expand DownExpand Up@@ -199,5 +198,3 @@ void grad_backward(

} // namespace cuda
} // namespace ff

#endif // FF_CUDA_PUSHPULL
5 changes: 1 addition & 4 deletions include/fastfields/api/cuda/pushpull_dispatch.h
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
#ifndef FF_CUDA_PUSHPULL_DISPATCH
#define FF_CUDA_PUSHPULL_DISPATCH
#pragma once
/**
* Private (not installed) header: the argument-marshalling helpers, the
* argument checks and the ndim x order x bound x dtype dispatch matrix
Expand DownExpand Up@@ -92,5 +91,3 @@ typedef double reduce_t;

FF_NAMESPACE_END(FF_DEVICE)
FF_NAMESPACE_END(FF_NS)

#endif // FF_CUDA_PUSHPULL_DISPATCH
5 changes: 1 addition & 4 deletions include/fastfields/api/cuda/reg_field.h
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
#ifndef FF_CUDA_REG_FIELD
#define FF_CUDA_REG_FIELD
#pragma once
#include <fastfields/core/dlpack.h>
#include <cstdint>

Expand DownExpand Up@@ -332,5 +331,3 @@ void field_relax_rls(

} // namespace cuda
} // namespace ff

#endif // FF_CUDA_REG_FIELD
5 changes: 1 addition & 4 deletions include/fastfields/api/cuda/reg_flow.h
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
#ifndef FF_CUDA_REG_FLOW
#define FF_CUDA_REG_FLOW
#pragma once
#include <fastfields/core/dlpack.h>
#include <cstdint>

Expand DownExpand Up@@ -359,5 +358,3 @@ void flow_relax_rls(

} // namespace cuda
} // namespace ff

#endif // FF_CUDA_REG_FLOW
5 changes: 1 addition & 4 deletions include/fastfields/api/cuda/resize.h
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
#ifndef FF_CUDA_RESIZE
#define FF_CUDA_RESIZE
#pragma once
#include <fastfields/core/dlpack.h>
#include <cstdint>

Expand DownExpand Up@@ -38,5 +37,3 @@ void resample(

} // namespace cuda
} // namespace ff

#endif // FF_CUDA_RESIZE
5 changes: 1 addition & 4 deletions include/fastfields/api/cuda/restrict.h
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
#ifndef FF_CUDA_RESTRICT
#define FF_CUDA_RESTRICT
#pragma once
#include <fastfields/core/dlpack.h>
#include <cstdint>

Expand DownExpand Up@@ -40,5 +39,3 @@ void restriction(

} // namespace cuda
} // namespace ff

#endif // FF_CUDA_RESTRICT
5 changes: 1 addition & 4 deletions include/fastfields/api/cuda/splinc.h
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
#ifndef FF_CUDA_SPLINC
#define FF_CUDA_SPLINC
#pragma once
#include <fastfields/core/dlpack.h>
#include <cstdint>

Expand DownExpand Up@@ -28,5 +27,3 @@ void spline_coeff(

} // namespace cuda
} // namespace ff

#endif // FF_CUDA_SPLINC
5 changes: 0 additions & 5 deletions include/fastfields/api/cuda/stream.h
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
#pragma once
#ifndef FF_CUDA_STREAM
#define FF_CUDA_STREAM

/**
* The public ABI carries a CUDA stream as an `intptr_t` (no CUDA types leak
* into the exported signatures); the cuda-impl launchers take a real
Expand DownExpand Up@@ -29,5 +26,3 @@ static inline cudaStream_t _reg_stream(intptr_t stream)

FF_NAMESPACE_END(FF_DEVICE)
FF_NAMESPACE_END(FF_NS)

#endif // FF_CUDA_STREAM
5 changes: 1 addition & 4 deletions include/fastfields/api/distance.h
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
#ifndef FF_LIB_DISTANCE
#define FF_LIB_DISTANCE
#pragma once
#include <fastfields/core/dlpack.h>
#include <cstdint>
#include <fastfields/core/defines.h>
Expand DownExpand Up@@ -176,5 +175,3 @@ void dt_mesh(
);

FF_NAMESPACE_END(FF_NS)

#endif // FF_LIB_DISTANCE
5 changes: 1 addition & 4 deletions include/fastfields/api/posdef.h
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
#ifndef FF_LIB_POSDEF
#define FF_LIB_POSDEF
#pragma once
#include <fastfields/core/dlpack.h>
#include <cstdint>
#include <fastfields/core/defines.h>
Expand DownExpand Up@@ -80,5 +79,3 @@ void sym_invert_(
);

FF_NAMESPACE_END(FF_NS)

#endif // FF_LIB_POSDEF
5 changes: 1 addition & 4 deletions include/fastfields/api/pushpull.h
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
#ifndef FF_LIB_PUSHPULL
#define FF_LIB_PUSHPULL
#pragma once
#include <fastfields/core/dlpack.h>
#include <cstdint>
#include <fastfields/core/defines.h>
Expand DownExpand Up@@ -228,5 +227,3 @@ void grad_backward(
);

FF_NAMESPACE_END(FF_NS)

#endif // FF_LIB_PUSHPULL
5 changes: 1 addition & 4 deletions include/fastfields/api/reg_field.h
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
#ifndef FF_LIB_REG_FIELD
#define FF_LIB_REG_FIELD
#pragma once
#include <fastfields/core/dlpack.h>
#include <cstdint>
#include <fastfields/core/defines.h>
Expand DownExpand Up@@ -376,5 +375,3 @@ void field_relax_rls(
);

FF_NAMESPACE_END(FF_NS)

#endif // FF_LIB_REG_FIELD
5 changes: 1 addition & 4 deletions include/fastfields/api/reg_flow.h
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
#ifndef FF_LIB_REG_FLOW
#define FF_LIB_REG_FLOW
#pragma once
#include <fastfields/core/dlpack.h>
#include <cstdint>
#include <fastfields/core/defines.h>
Expand DownExpand Up@@ -397,5 +396,3 @@ void flow_relax_rls(
);

FF_NAMESPACE_END(FF_NS)

#endif // FF_LIB_REG_FLOW
5 changes: 1 addition & 4 deletions include/fastfields/api/resize.h
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
#ifndef FF_LIB_RESIZE
#define FF_LIB_RESIZE
#pragma once
#include <fastfields/core/dlpack.h>
#include <cstdint>
#include <fastfields/core/defines.h>
Expand DownExpand Up@@ -68,5 +67,3 @@ void resample(
);

FF_NAMESPACE_END(FF_NS)

#endif // FF_LIB_RESIZE
5 changes: 1 addition & 4 deletions include/fastfields/api/restrict.h
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
#ifndef FF_LIB_RESTRICT
#define FF_LIB_RESTRICT
#pragma once
#include <fastfields/core/dlpack.h>
#include <cstdint>
#include <fastfields/core/defines.h>
Expand DownExpand Up@@ -67,5 +66,3 @@ void restriction(
);

FF_NAMESPACE_END(FF_NS)

#endif // FF_LIB_RESTRICT
Loading
Loading