Skip to content

Commit 79b4cf3

Browse files
authored
Merge branch 'main' into senyai-pip-install
2 parents b9cbf1b + 0d52283 commit 79b4cf3

File tree

8 files changed

+19
-17
lines changed

8 files changed

+19
-17
lines changed

.github/install_bazel.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ if ! bazel version; then
44
arch="arm64"
55
fi
66
echo "Downloading $arch Bazel binary from GitHub releases."
7-
curl -L -o $HOME/bin/bazel --create-dirs "https://github.com/bazelbuild/bazel/releases/download/7.1.1/bazel-7.1.1-linux-$arch"
7+
curl -L -o $HOME/bin/bazel --create-dirs "https://github.com/bazelbuild/bazel/releases/download/8.2.0/bazel-8.2.0-linux-$arch"
88
chmod +x $HOME/bin/bazel
99
else
1010
# Bazel is installed for the correct architecture

.github/workflows/wheels.yml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ jobs:
3535
runs-on: ${{ matrix.os }}
3636
strategy:
3737
matrix:
38-
os: [ubuntu-latest, macos-13, macos-14, windows-latest]
39-
38+
os: [ubuntu-latest, ubuntu-24.04-arm, macos-13, macos-14, windows-latest]
4039
steps:
4140
- name: Check out Google Benchmark
4241
uses: actions/checkout@v4
@@ -49,20 +48,13 @@ jobs:
4948
python-version: "3.12"
5049
- run: pip install --upgrade pip uv
5150

52-
- name: Set up QEMU
53-
if: runner.os == 'Linux'
54-
uses: docker/setup-qemu-action@v3
55-
with:
56-
platforms: all
57-
5851
- name: Build wheels on ${{ matrix.os }} using cibuildwheel
59-
uses: pypa/cibuildwheel@v2.22.0
52+
uses: pypa/cibuildwheel@v2.23.2
6053
env:
6154
CIBW_BUILD: "cp310-* cp311-* cp312-*"
6255
CIBW_BUILD_FRONTEND: "build[uv]"
6356
CIBW_SKIP: "*-musllinux_*"
64-
CIBW_ARCHS_LINUX: auto64 aarch64
65-
CIBW_ARCHS_WINDOWS: auto64
57+
CIBW_ARCHS: auto64
6658
CIBW_BEFORE_ALL_LINUX: bash .github/install_bazel.sh
6759
# Grab the rootless Bazel installation inside the container.
6860
CIBW_ENVIRONMENT_LINUX: PATH=$PATH:$HOME/bin

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Require CMake 3.10. If available, use the policies up to CMake 3.22.
22
cmake_minimum_required (VERSION 3.13...3.22)
33

4-
project (benchmark VERSION 1.9.3 LANGUAGES CXX)
4+
project (benchmark VERSION 1.9.4 LANGUAGES CXX)
55

66
option(BENCHMARK_ENABLE_TESTING "Enable testing of the benchmark library." ON)
77
option(BENCHMARK_ENABLE_EXCEPTIONS "Enable the use of exceptions in the benchmark library." ON)

MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module(
22
name = "google_benchmark",
3-
version = "1.9.3",
3+
version = "1.9.4",
44
)
55

66
bazel_dep(name = "bazel_skylib", version = "1.7.1")

bindings/python/google_benchmark/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def my_benchmark(state):
5050
oNSquared as oNSquared,
5151
)
5252

53-
__version__ = "1.9.3"
53+
__version__ = "1.9.4"
5454

5555

5656
class __OptionMaker:

bindings/python/google_benchmark/benchmark.cc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,15 @@ NB_MODULE(_benchmark, m) {
167167
.def_prop_rw("items_processed", &State::items_processed,
168168
&State::SetItemsProcessed)
169169
.def("set_label", &State::SetLabel)
170-
.def("range", &State::range, nb::arg("pos") = 0)
170+
.def(
171+
"range",
172+
[](const State& state, std::size_t pos = 0) -> int64_t {
173+
if (pos < state.range_size()) {
174+
return state.range(pos);
175+
}
176+
throw nb::index_error("pos is out of range");
177+
},
178+
nb::arg("pos") = 0)
171179
.def_prop_ro("iterations", &State::iterations)
172180
.def_prop_ro("name", &State::name)
173181
.def_rw("counters", &State::counters)

include/benchmark/benchmark.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -956,6 +956,8 @@ class BENCHMARK_EXPORT BENCHMARK_INTERNAL_CACHELINE_ALIGNED State {
956956
BENCHMARK_ALWAYS_INLINE
957957
std::string name() const { return name_; }
958958

959+
size_t range_size() const { return range_.size(); }
960+
959961
private:
960962
// items we expect on the first cache line (ie 64 bytes of the struct)
961963
// When total_iterations_ is 0, KeepRunning() and friends will return false.

src/sysinfo.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ std::vector<CPUInfo::CacheInfo> GetCacheSizes() {
439439
return GetCacheSizesWindows();
440440
#elif defined(BENCHMARK_OS_QNX)
441441
return GetCacheSizesQNX();
442-
#elif defined(BENCHMARK_OS_QURT)
442+
#elif defined(BENCHMARK_OS_QURT) || defined(__EMSCRIPTEN__)
443443
return std::vector<CPUInfo::CacheInfo>();
444444
#else
445445
return GetCacheSizesFromKVFS();

0 commit comments

Comments
 (0)