Created
October 19, 2017 23:43
-
-
Save marty1885/0ff60ceaca6196ec0e096c650a893f7b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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