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
17 changes: 13 additions & 4 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# ~~~~ General flags ~~~~

# Common flags
common --announce_rc
common --experimental_repo_remote_exec
Expand All @@ -28,8 +30,14 @@ test --test_output=errors
build:cuda --@local_config_cuda//:enable_cuda
build:cuda --define=using_cuda=true --define=using_cuda_nvcc=true

# Configs for verbose builds & tests
common:verbose --announce_rc
common:verbose --auto_output_filter=none
build:verbose --show_progress_rate_limit=1
test:verbose --test_summary=detailed


##### Sanitizers (choose one, or nosan for none) #####
# ~~~~ Sanitizers (choose one, or nosan for none) ~~~~

# Shared config for sanitizers
build:sanitizer --strip=never
Expand All @@ -50,7 +58,7 @@ build:msan --linkopt -fsanitize=leak
build:nosan --


##### Instruction set options (choose one) #####
# ~~~~ Instruction set options (choose one) ~~~~

# Build with AVX2 + FMA
build:avx --copt -O3
Expand All @@ -65,7 +73,7 @@ build:sse --copt -msse4
build:basic --copt -O3


##### Parallelization (choose one, or nopenmp for none) #####
# ~~~~ Parallelization (choose one, or nopenmp for none) ~~~~

# Build with OpenMP
build:openmp --copt -fopenmp
Expand All @@ -74,7 +82,8 @@ build:openmp --linkopt -lgomp
# No OpenMP
build:nopenmp --

##### Memory handler (choose one) #####

# ~~~~ Memory handler (choose one) ~~~~

# Build with tcmalloc
build:tcmalloc --linkopt="-ltcmalloc"
Expand Down
31 changes: 26 additions & 5 deletions docs/bazel.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,16 @@ requires the circuit file to be specified both on the command line and in the
bazel run --config=avx --config=openmp apps:qsim_base -- -c circuits/circuit_q24
```

## Build configs
## Build configurations

Depending on the optimizers available on your machine, different config flags
(such as `--config=avx`, above) can be set to control which optimizers are
included in a given build or test run.

Vector arithmetic optimizers (pick one at most):
### Vector arithmetic optimizers

Pick at most one of the following options:

```
# Use AVX instructions for vector arithmetic.
--config=avx
Expand All @@ -34,7 +37,10 @@ Vector arithmetic optimizers (pick one at most):
--config=basic
```

Parallelism optimizers (pick one at most):
### Parallelism optimizers

Pick at most one of the following options:

```
# Use OpenMP to run operations in parallel when possible.
--config=openmp
Expand All @@ -43,11 +49,26 @@ Parallelism optimizers (pick one at most):
--config=nopenmp
```

Memory allocation (pick one at most):
### Memory allocators


[TCMalloc](https://github.com/google/tcmalloc) is a fast, multithreaded
implementation of C's `malloc()` and C++'s `new` operator. It is an independent
open-source library developd by Google. TCMalloc can be used with qsim as an
alternative to the default `malloc()`. Pick at most one of the following
options:

```
# Use tcmalloc for memory allocation.
# Use TCMalloc for memory allocation.
--config=tcmalloc

# Use malloc for memory allocation (default).
--config=malloc
```

### Additional configuration options

To provide more information when building and testing qsim, you can add the
configuration option `--config=verbose` to any of the `bazel` commands above.

Other configuration options are described elsewhere in the qsim documentation.
Loading