main.cpp 576 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
#include <pls/pls.h>
#include <pls/internal/helpers/profiler.h>
#include <pls/internal/helpers/mini_benchmark.h>

#include <iostream>
#include <vector>
#include <functional>

static constexpr int INPUT_SIZE = 1000000;

int main() {
  PROFILE_ENABLE
  std::vector<double> vec(INPUT_SIZE, 1);
  std::vector<double> out(INPUT_SIZE);

  for (int i = 0; i < INPUT_SIZE; i++) {
    vec[i] = i;
  }

  pls::internal::helpers::run_mini_benchmark([&] {
21
    pls::scan(vec.begin(), vec.end(), out.begin(), std::plus<double>(), 0.0);
22 23 24 25
  }, 8, 1000);

  PROFILE_SAVE("test_profile.prof")
}