@@ -12,24 +12,25 @@ using namespace bparser;
1212int main () {
1313
1414 const uint max_vec_size = 2000 ;
15- const size_t buffer_size = sizeof (double ) * max_vec_size + 50000 ;
15+ const size_t buffer_size = sizeof (double ) * max_vec_size + 500000 ;
1616
17- const uint N = 2048U ;
17+ const uint N = 1073741824U ; // 2^30
1818
1919 void * buffer = ::operator new (buffer_size);
2020 ExprCase exprcase (max_vec_size, (void *)buffer, buffer_size);
2121
2222 def (exprcase);
2323
24- if (exprcase.get_query ().empty ()) {
24+ if (exprcase.get_expression ().empty ()) {
2525 Throw () << " No expression was set!" ;
2626 }
2727
28- std::vector<uint> subset = { 0 , 1 , 2 , 3 }; // ctverice doubluu //TODO: autocreate from vec_size
28+ std::vector<uint> subset = { 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 }; // ctverice doubluu //TODO: autocreate from vec_size
2929 std::vector<uint> vec_sizes ({ 16U , 64U , 256U , 1024U });
3030
3131 PatchArenaPtr arena = exprcase.get_patch_arena ();
3232 for (uint vec_size : vec_sizes) {
33+
3334 uint n_repeats = N / vec_size;
3435 std::cout << " Running \" " << exprcase.get_query () << " \" " << n_repeats << " x for vec_size: " << vec_size << std::endl;
3536 exprcase.allocate (vec_size);
@@ -38,7 +39,6 @@ int main() {
3839 ExpressionDAG se = gen (exprcase.get_node_map ());
3940
4041 ProcessorBase* processor = ProcessorBase::create_processor (se, max_vec_size, bparser::get_simd_size (), arena); // get arena from ExprCase
41- // ProcessorBase* processor = ProcessorBase::create_processor(se, max_vec_size, bparser::get_simd_size(), nullptr);
4242 processor->set_subset (subset);
4343
4444 auto start_time = std::chrono::high_resolution_clock::now ();
@@ -49,17 +49,18 @@ int main() {
4949
5050 double time = std::chrono::duration_cast<std::chrono::duration<double >>(end_time - start_time).count ();
5151 std::cout << " Finished in " << time << std::endl;
52- // processor.get_arena();
53- delete processor;
5452
55- exprcase.deallocate ();
56- }
57- // auto start_time = std::chrono::high_resolution_clock::now();
5853
59- // TODO:
54+ exprcase.deallocate (); // processor is allocated in arena
55+ } // for
56+
57+
58+ // TODO: have result
6059 // std::cout << "Result: \n";
6160
6261 // Result in the 'vres' value space.
6362 // std::cout << print_vec(vres, vres_size);
63+
6464 ::operator delete (buffer);
65- }
65+
66+ } // main
0 commit comments