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
8 changes: 6 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ target/
*.md
!README*.md
.github/
benches/
examples/
scripts/
# NB: benches/ and examples/ are intentionally NOT ignored. Cargo.toml declares
# explicit [[bench]] and [[example]] targets, and cargo validates that every
# declared target's source file exists when it parses the manifest — even for a
# lib-only build. Excluding these dirs makes `cargo build` fail at manifest
# parse with "can't find <name> example/bench". They are not compiled by the
# default build, so the cost of shipping them in the context is just their size.
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ COPY crates/ crates/
COPY src/ src/
COPY ndarray-rand/src/ ndarray-rand/src/

# Cargo.toml (root) and ndarray-rand/Cargo.toml (a workspace member) declare
# explicit [[example]]/[[bench]] targets. Cargo validates that every declared
# target's source file exists while parsing the manifest — even for a lib-only
# build — so these dirs must be in the context or `cargo build` fails at parse
# with "can't find <name> example/bench". They are NOT compiled here (the default
# build skips examples/benches), so this only adds source bytes, not build time.
COPY examples/ examples/
COPY benches/ benches/
COPY ndarray-rand/benches/ ndarray-rand/benches/

# Default target: x86-64-v3 (AVX2) — runs on GitHub CI and most servers.
# Use Dockerfile.avx512 for x86-64-v4 (AVX-512). ndarray's simd.rs polyfill
# detects AVX-512 at runtime via LazyLock<Tier> even when compiled for v3;
Expand Down
10 changes: 10 additions & 0 deletions Dockerfile.avx512
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@ COPY crates/ crates/
COPY src/ src/
COPY ndarray-rand/src/ ndarray-rand/src/

# Cargo.toml (root) and ndarray-rand/Cargo.toml (a workspace member) declare
# explicit [[example]]/[[bench]] targets. Cargo validates that every declared
# target's source file exists while parsing the manifest — even for a lib-only
# build — so these dirs must be in the context or `cargo build` fails at parse
# with "can't find <name> example/bench". They are NOT compiled here (the default
# build skips examples/benches), so this only adds source bytes, not build time.
COPY examples/ examples/
COPY benches/ benches/
COPY ndarray-rand/benches/ ndarray-rand/benches/

# AVX-512 pinned: compile-time dispatch, everything inlined
ENV RUSTFLAGS="-C target-cpu=x86-64-v4"

Expand Down
Loading