Skip to content

Instantly share code, notes, and snippets.

@marty1885
Created October 19, 2017 23:43
Show Gist options
  • Save marty1885/0ff60ceaca6196ec0e096c650a893f7b to your computer and use it in GitHub Desktop.
Save marty1885/0ff60ceaca6196ec0e096c650a893f7b to your computer and use it in GitHub Desktop.
#include <iostream>
#include <algorithm>
#include <list>
#include <xtensor/xarray.hpp>
#include <xtensor/xio.hpp>
#include <hayai/hayai.hpp>
#include <hayai/hayai_main.hpp>
using namespace std;
xt::xarray<float> t;
xt::xarray<float> u;
BENCHMARK(xtensor, copy, 100, 100)
{
u = t;
}
BENCHMARK(xtensor, move, 100, 100)
{
u = std::move(t);
u[0] = 5;
}
int main()
{
hayai::MainRunner runner;
t = xt::zeros<float>({1024,1024});
u = xt::zeros<float>(t.shape());
u = t;
u = t;
u = t;
u = t;
runner.Run();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment