-
Notifications
You must be signed in to change notification settings - Fork 584
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3bdae8c
commit bf129ae
Showing
2 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2019 The IREE Authors | ||
# | ||
# Licensed under the Apache License v2.0 with LLVM Exceptions. | ||
# See https://llvm.org/LICENSE.txt for license information. | ||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
|
||
# Build benchmark suites for IREE using an *already built* build directory. | ||
# Designed for CI, but can be run locally. | ||
# TODO(#4662): this should just allow passing in host tools. | ||
|
||
set -xeuo pipefail | ||
|
||
ROOT_DIR="${ROOT_DIR:-$(git rev-parse --show-toplevel)}" | ||
cd "${ROOT_DIR}" | ||
|
||
BUILD_DIR="${1:-${IREE_BUILD_DIR:-build}}" | ||
CMAKE_BIN=${CMAKE_BIN:-$(which cmake)} | ||
IREE_TF_BINARIES_DIR="${IREE_TF_BINARIES_DIR:-integrations/tensorflow/bazel-bin/iree_tf_compiler}" | ||
|
||
"$CMAKE_BIN" --version | ||
ninja --version | ||
|
||
if ! [[ -d "${BUILD_DIR}" ]]; then | ||
echo "Build directory '${BUILD_DIR}' does not exist. Aborting" | ||
exit 1 | ||
fi | ||
|
||
echo "Reconfiguring to enable benchmarks" | ||
# Note that we're relying on CMake caching here | ||
"${CMAKE_BIN}" -B "${BUILD_DIR}" \ | ||
-DIREE_BUILD_BENCHMARKS=ON \ | ||
-DIREE_BUILD_MICROBENCHMARKS=ON \ | ||
-DIREE_IMPORT_TFLITE_PATH="${IREE_TF_BINARIES_DIR}/iree-import-tflite" \ | ||
-DIREE_IMPORT_TF_PATH="${IREE_TF_BINARIES_DIR}/iree-import-tf" | ||
|
||
echo "Building benchmark artifacts" | ||
"${CMAKE_BIN}" --build . --target \ | ||
iree-benchmark-suites \ | ||
iree-microbenchmark-suites \ | ||
-- -k 0 |