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
56 changes: 56 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: CMake Build and Test

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build-and-test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Create Build Directory
run: mkdir build

- name: Configure CMake
working-directory: ./build
run: cmake ..

- name: Build Project
working-directory: ./build
run: make -j

- name: Run Unittests
working-directory: ./build
run: ./unittests

build-and-test-with-SDE:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Create Build Directory
run: mkdir build

- name: Download and Unpack SDE
working-directory: ./build
run: |
wget https://downloadmirror.intel.com/859732/sde-external-9.58.0-2025-06-16-lin.tar.xz
tar xf sde-external-9.58.0-2025-06-16-lin.tar.xz

- name: Configure CMake
working-directory: ./build
run: cmake .. -DMARCH=icelake-client

- name: Build Project
working-directory: ./build
run: make -j

- name: Run Unittests
working-directory: ./build
run: sde-external-9.58.0-2025-06-16-lin/sde64 -icl -emu-xinuse 0 -- ./unittests
75 changes: 0 additions & 75 deletions .github/workflows/cmake-multi-platform.yml

This file was deleted.

8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
cmake_minimum_required(VERSION 3.12)
project(pixie)

set(CMAKE_CXX_FLAGS "-march=native")
set(MARCH "native" CACHE STRING "march compilier flag")
set(CMAKE_CXX_FLAGS "-march=${MARCH} -O3 -DNDEBUG")
set(BENCHMARK_ENABLE_GTEST_TESTS OFF)

include(FetchContent)
FetchContent_Declare(
googletest
GIT+REPOSITORY https://github.com/google/googletest.git
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG v1.17.0
)
include(GoogleTest)
Expand Down Expand Up @@ -44,5 +45,4 @@ target_link_libraries(unittests
gtest
gtest_main)

enable_testing()
gtest_discover_tests(unittests)
Comment thread
Malkovsky marked this conversation as resolved.
enable_testing()
4 changes: 2 additions & 2 deletions include/bitvector.h
Original file line number Diff line number Diff line change
Expand Up @@ -436,13 +436,13 @@ class BitVectorInterleaved {

for (size_t j = 0; j < 7 && kWordSize * (i + j) < num_bits; ++j) {
bits_interleaved[i * (kWordsPerBlock) + j] = bit_reader.ReadBits64(
std::min(64ull, num_bits - i * kBasicBlockSize + j * kWordSize));
std::min<uint64_t>(64ull, num_bits - i * kBasicBlockSize + j * kWordSize));
basic_block_sum +=
std::popcount(bits_interleaved[i * (kWordsPerBlock) + j]);
}
if ((i + 7) * kWordSize < num_bits) {
auto v = bit_reader.ReadBits64(
std::min(48ull, num_bits - (i * kBasicBlockSize + 7 * kWordSize)));
std::min<uint64_t>(48ull, num_bits - (i * kBasicBlockSize + 7 * kWordSize)));
bits_interleaved[i * (kWordsPerBlock) + 7] ^= v;
basic_block_sum += std::popcount(v);
}
Expand Down
24 changes: 0 additions & 24 deletions src/unittests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,31 +246,7 @@ TEST(BitVectorTest, MainSelectTest) {
}
}

TEST(BitVectorTest, BenchmarkSelectTest) {
Comment thread
Malkovsky marked this conversation as resolved.
for (size_t n = 4; n <= (1ull << 34); n <<= 2) {
std::mt19937_64 rng(42);

std::vector<uint64_t> bits(1 + n / 64);
for (auto &x : bits) {
x = rng();
}
pixie::BitVector bv(bits, n);

auto max_rank = bv.rank(bv.size());
// size_t rank = 0;
auto r = bv.rank(bv.size());
auto s = bv.select(r);

// for (size_t i = 0; i < 10000 && r - i > 0; ++i) {
// s = bv.select(r - i);
// }

for (size_t i = 0; i < 20000000; ++i) {
uint64_t rank = rng() % max_rank;
bv.select(rank);
}
}
}

TEST(BitVectorInterleavedTest, AtTest) {
std::mt19937_64 rng(42);
Expand Down