Commit df46bb45 authored by Scott Thornton's avatar Scott Thornton
Browse files

fixed cppcheck + clang formatting

parent cfbafecb
...@@ -431,7 +431,6 @@ struct broadcast ...@@ -431,7 +431,6 @@ struct broadcast
auto shape1 = inputs.at(1); auto shape1 = inputs.at(1);
auto shape0_lens = shape0.lens(); auto shape0_lens = shape0.lens();
auto shape1_lens = shape1.lens(); auto shape1_lens = shape1.lens();
const auto& shape0_strides = shape0.strides();
auto shape1_strides = shape1.strides(); auto shape1_strides = shape1.strides();
if(std::all_of(shape0_lens.cbegin(), shape1_lens.cend(), [&](auto x) { return x == 1; })) if(std::all_of(shape0_lens.cbegin(), shape1_lens.cend(), [&](auto x) { return x == 1; }))
{ {
......
...@@ -80,10 +80,10 @@ void add_test() ...@@ -80,10 +80,10 @@ void add_test()
void broadcast_test() void broadcast_test()
{ {
rtg::program p; rtg::program p;
rtg::shape a_shape{rtg::shape::int32_type, {2,2}}; rtg::shape a_shape{rtg::shape::int32_type, {2, 2}};
std::vector<int32_t> a_data{0,0,0,0}; std::vector<int32_t> a_data{0, 0, 0, 0};
rtg::shape b_shape{rtg::shape::int32_type, {2}}; rtg::shape b_shape{rtg::shape::int32_type, {2}};
std::vector<int32_t> b_data{-2,-3}; std::vector<int32_t> b_data{-2, -3};
uint64_t axis = 0; uint64_t axis = 0;
auto l1 = p.add_literal(rtg::literal{a_shape, a_data}); auto l1 = p.add_literal(rtg::literal{a_shape, a_data});
auto l2 = p.add_literal(rtg::literal{b_shape, b_data}); auto l2 = p.add_literal(rtg::literal{b_shape, b_data});
...@@ -102,10 +102,10 @@ void broadcast_test() ...@@ -102,10 +102,10 @@ void broadcast_test()
void add_broadcast_test() void add_broadcast_test()
{ {
rtg::program p; rtg::program p;
rtg::shape a_shape{rtg::shape::float_type, {2,2,3}}; rtg::shape a_shape{rtg::shape::float_type, {2, 2, 3}};
std::vector<float> a_data{0,1,2,3,4,5,6,7,8,9,10,11}; std::vector<float> a_data{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11};
rtg::shape b_shape{rtg::shape::float_type, {2,2}}; rtg::shape b_shape{rtg::shape::float_type, {2, 2}};
std::vector<float> b_data{0,-1,-2,-3}; std::vector<float> b_data{0, -1, -2, -3};
uint64_t axis = 0; uint64_t axis = 0;
auto l1 = p.add_literal(rtg::literal{a_shape, a_data}); auto l1 = p.add_literal(rtg::literal{a_shape, a_data});
auto l2 = p.add_literal(rtg::literal{b_shape, b_data}); auto l2 = p.add_literal(rtg::literal{b_shape, b_data});
...@@ -115,7 +115,7 @@ void add_broadcast_test() ...@@ -115,7 +115,7 @@ void add_broadcast_test()
auto result = p.eval({}); auto result = p.eval({});
std::vector<float> results_vector(12); std::vector<float> results_vector(12);
result.visit([&](auto output) { results_vector.assign(output.begin(), output.end()); }); result.visit([&](auto output) { results_vector.assign(output.begin(), output.end()); });
std::vector<float> gold = {0,1,2,2,3,4,4,5,6,6,7,8}; std::vector<float> gold = {0, 1, 2, 2, 3, 4, 4, 5, 6, 6, 7, 8};
EXPECT(test::verify_range(results_vector, gold)); EXPECT(test::verify_range(results_vector, gold));
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment