Skip to content

Commit

Permalink
remove native CPU default
Browse files Browse the repository at this point in the history
  • Loading branch information
d3v-null committed Aug 20, 2024
1 parent 6df8e82 commit 530a746
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 13 deletions.
2 changes: 0 additions & 2 deletions .cargo/config.toml

This file was deleted.

1 change: 1 addition & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
RUSTFLAGS: -C target-cpu=native
DEBIAN_FRONTEND: noninteractive
MWA_BEAM_FILE: mwa_full_embedded_element_pattern.h5

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
RUSTFLAGS: -C target-cpu=native
DEBIAN_FRONTEND: noninteractive
MWA_BEAM_FILE: mwa_full_embedded_element_pattern.h5

Expand Down
41 changes: 30 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,10 @@ their respective licenses are also distributed.

Clone the repo, and run:

cargo build --release
```bash
export RUSTFLAGS="-C target-cpu=native" # (optional) Use native CPU features (not portable!)
cargo build --release
```

For usage with other languages, an include file will be in the `include`
directory, along with C-compatible shared and static objects in the
Expand All @@ -137,13 +140,17 @@ directory, along with C-compatible shared and static objects in the
Are you running `hyperbeam` on a desktop GPU? Then you probably want to compile
with single-precision floats:

cargo build --release --features=cuda,gpu-single
cargo build --release --features=hip,gpu-single
```bash
cargo build --release --features=cuda,gpu-single
cargo build --release --features=hip,gpu-single
```

Otherwise, go ahead with double-precision floats:

cargo build --release --features=cuda
cargo build --release --features=hip
```bash
cargo build --release --features=cuda
cargo build --release --features=hip
```

Desktop GPUs (e.g. NVIDIA GeForce RTX 2070) have significantly less
double-precision compute capability than "data center" GPUs (e.g. NVIDIA V100).
Expand All @@ -152,7 +159,9 @@ between the performance and precision compromise.

`CUDA` can also be linked statically:

cargo build --release --features=cuda,cuda-static
```bash
cargo build --release --features=cuda,cuda-static
```

#### HIP
The situation with `HIP` is similar to that of `CUDA`; use the `hip` feature and
Expand All @@ -163,26 +172,34 @@ not appear to offer static libraries, so no static feature is provided.
To make `hyperbeam` without a dependence on a system `HDF5` library, give the
`build` command a feature flag:

cargo build --release --features=hdf5-static
```bash
cargo build --release --features=hdf5-static
```

This will automatically compile the HDF5 source code and "bake" it into the
`hyperbeam` products, meaning that HDF5 is not needed as a system dependency.
`CMake` version 3.10 or higher is needed to build the HDF5 source.

To compile all C libraries statically:

cargo build --release --features=all-static
```bash
cargo build --release --features=all-static
```

#### Python
To install `hyperbeam` to your currently-in-use virtualenv or conda environment,
you'll need the Python package `maturin` (can get it with `pip`), then run:
maturin develop --release -b pyo3 --features=python --strip
```bash
maturin develop --release -b pyo3 --features=python --strip
```
If you don't have or don't want to install HDF5 as a system dependency, include
the `hdf5-static` feature:
maturin develop --release -b pyo3 --features=python,hdf5-static --strip
```bash
maturin develop --release -b pyo3 --features=python,hdf5-static --strip
```
## Comparing with other FEE beam codes
Below is a table comparing other implementations of the FEE beam code. All
Expand Down Expand Up @@ -222,7 +239,9 @@ know.
Run your code with `hyperbeam` again, but this time with the debug build. This
should be as simple as running:
cargo build
```bash
cargo build
```
and then using the results in `./target/debug`.
Expand Down

0 comments on commit 530a746

Please sign in to comment.