Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
0bc8d7a
Listing options on cmdline
elshize Sep 28, 2020
782fb66
Refactor + test + fix benchmark
elshize Sep 28, 2020
32983f6
Merge branch 'master' into list-options
amallia Oct 2, 2020
c97fbdf
Merge branch 'master' into list-options
elshize Oct 6, 2020
6a2067f
Use template functions to load index
elshize Oct 7, 2020
11135b2
Fix noexcept move constructor
elshize Oct 7, 2020
749288d
Remove noexcept due to boost::function not having it
elshize Oct 7, 2020
4cb2cfd
Remove unnecessary forwards
elshize Oct 7, 2020
81ecfd5
Remove noexcept from wand_data_raw
elshize Oct 7, 2020
2e6c3c5
Merge branch 'master' into list-options
elshize Oct 7, 2020
ccbb3b1
Merge branch 'master' into list-options
amallia Nov 11, 2020
a24f55b
Merge branch 'master' into list-options
elshize Feb 4, 2021
79acb79
Merge branch 'master' into list-options
elshize Feb 9, 2021
8533672
Merge branch 'master' into list-options
elshize Feb 9, 2021
ab75185
Merge branch 'master' into list-options
elshize Feb 12, 2021
2a40ce4
Merge branch 'master' into list-options
elshize May 1, 2021
32ceef7
Refactor type resolver.
elshize May 2, 2021
1969acf
Refactor names
elshize May 2, 2021
5bcc2bc
conxtexpr encoding list
elshize May 2, 2021
86940ac
Merge branch 'master' into list-options
elshize May 3, 2021
b4ae74e
Add missing header
elshize May 3, 2021
ca4f978
Merge branch 'list-options' of github.com:pisa-engine/pisa into list-…
elshize May 3, 2021
e386f58
Remove var name from capture
elshize May 3, 2021
5613b23
Extract lambda outside of template param pack
elshize May 3, 2021
2fb0d30
Document type index code
elshize May 3, 2021
f6283e1
CI: use testing PPA for gcc
elshize May 3, 2021
b529854
Add bionic-updates repository
elshize May 3, 2021
950200d
Install from bionic-updates
elshize May 3, 2021
e7b2253
Merge branch 'master' into list-options
elshize May 31, 2021
9969a8c
Merge branch 'master' into list-options
elshize Jun 8, 2021
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
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,12 @@ jobs:
sudo apt-get remove libstdc++-10-dev libgcc-10-dev cpp-10
sudo apt-get remove libstdc++-11-dev libgcc-11-dev cpp-11
fi
sudo add-apt-repository -y 'deb http://mirror.plusserver.com/ubuntu/ubuntu/ bionic-updates main restricted universe multiverse'
sudo apt-get update
sudo apt-get install -y libtool m4 autoconf
if [ "${{ matrix.compiler }}" = "gcc" ]; then
if [ "${cc}" = "gcc" ]; then
sudo apt-get install -y g++-7/bionic-updates
elif [ "${{ matrix.compiler }}" = "gcc" ]; then
sudo apt-get install -y "${cxx}"
else
echo "TOOLCHAIN=-DCMAKE_TOOLCHAIN_FILE=clang.cmake" >> $GITHUB_ENV
Expand Down
36 changes: 10 additions & 26 deletions benchmarks/index_perftest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
using pisa::do_not_optimize_away;
using pisa::get_time_usecs;

template <typename IndexType, bool with_freqs>
void perftest(IndexType const& index, std::string const& type)
template <bool with_freqs, typename IndexType>
void perftest(IndexType&& index, std::string const& type)
{
std::string freqs_log = with_freqs ? "+freq()" : "";
{
Expand Down Expand Up @@ -103,18 +103,6 @@ void perftest(IndexType const& index, std::string const& type)
}
}

template <typename IndexType>
void perftest(const char* index_filename, std::string const& type)
{
spdlog::info("Loading index from {}", index_filename);
IndexType index;
mio::mmap_source m(index_filename);
pisa::mapper::map(index, m, pisa::mapper::map_flags::warmup);

perftest<IndexType, false>(index, type);
perftest<IndexType, true>(index, type);
}

int main(int argc, const char** argv)
{
using namespace pisa;
Expand All @@ -127,17 +115,13 @@ int main(int argc, const char** argv)
std::string type = argv[1];
const char* index_filename = argv[2];

if (false) {
#define LOOP_BODY(R, DATA, T) \
} \
else if (type == BOOST_PP_STRINGIZE(T)) \
{ \
perftest<BOOST_PP_CAT(T, _index)>(index_filename, type); \
/**/

BOOST_PP_SEQ_FOR_EACH(LOOP_BODY, _, PISA_INDEX_TYPES);
#undef LOOP_BODY
} else {
spdlog::error("Unknown type {}", type);
try {
IndexType::resolve(type).load_and_execute(index_filename, [&](auto&& index) {
perftest<false>(index, type);
perftest<true>(index, type);
});
} catch (std::exception const& err) {
spdlog::error("{}", err.what());
return 1;
}
}
32 changes: 11 additions & 21 deletions include/pisa/compress.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,27 +246,17 @@ void compress(
binary_freq_collection input(input_basename.c_str());
global_parameters params;

if (false) {
#define LOOP_BODY(R, DATA, T) \
} \
else if (index_encoding == BOOST_PP_STRINGIZE(T)) \
{ \
compress_index<pisa::BOOST_PP_CAT(T, _index), wand_data<wand_data_raw>>( \
input, \
params, \
output_filename, \
check, \
index_encoding, \
wand_data_filename, \
scorer_params, \
quantize); \
/**/
BOOST_PP_SEQ_FOR_EACH(LOOP_BODY, _, PISA_INDEX_TYPES);
#undef LOOP_BODY
} else {
spdlog::error("Unknown type {}", index_encoding);
std::abort();
}
IndexType::resolve(index_encoding).execute([&](auto type_marker) {
compress_index<typename decltype(type_marker)::type, wand_data<wand_data_raw>>(
input,
params,
output_filename,
check,
index_encoding,
wand_data_filename,
scorer_params,
quantize);
});
}

} // namespace pisa
Loading