Unverified Commit a83371ca authored by Artur Wojcik's avatar Artur Wojcik Committed by GitHub
Browse files

fix compilation warnings causing build failures (-Werror) (#1889)

parent c45b34c3
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include <algorithm> #include <algorithm>
#include <cassert> #include <cassert>
#include <memory> #include <memory>
#include <cstdint>
#include <sstream> #include <sstream>
#include <type_traits> #include <type_traits>
#include <tuple> #include <tuple>
......
...@@ -30,7 +30,7 @@ void expect_equal(const char* x, const char* y) ...@@ -30,7 +30,7 @@ void expect_equal(const char* x, const char* y)
abort(); abort();
} }
int main() int main(void)
{ {
char name[1024]; char name[1024];
migraphx_operation_t op; migraphx_operation_t op;
......
...@@ -461,7 +461,7 @@ TEST_CASE(eval_context1) ...@@ -461,7 +461,7 @@ TEST_CASE(eval_context1)
mm->add_instruction(sum_op{}, one, two); mm->add_instruction(sum_op{}, one, two);
p.compile(t); p.compile(t);
EXPECT(is_shared(t.ctx, p.get_context())); EXPECT(is_shared(t.ctx, p.get_context()));
p.eval({}).back(); std::ignore = p.eval({}).back();
EXPECT(is_shared(t.ctx, p.get_context())); EXPECT(is_shared(t.ctx, p.get_context()));
} }
...@@ -476,7 +476,7 @@ TEST_CASE(eval_context2) ...@@ -476,7 +476,7 @@ TEST_CASE(eval_context2)
mm->add_instruction(id_ctx_op{}, one, two); mm->add_instruction(id_ctx_op{}, one, two);
p.compile(t); p.compile(t);
EXPECT(is_shared(t.ctx, p.get_context())); EXPECT(is_shared(t.ctx, p.get_context()));
p.eval({}).back(); std::ignore = p.eval({}).back();
// id_ctx_op will modify the context // id_ctx_op will modify the context
EXPECT(not is_shared(t.ctx, p.get_context())); EXPECT(not is_shared(t.ctx, p.get_context()));
} }
...@@ -493,8 +493,8 @@ TEST_CASE(eval_context3) ...@@ -493,8 +493,8 @@ TEST_CASE(eval_context3)
p.compile(t); p.compile(t);
// Finalizer will modify the context // Finalizer will modify the context
EXPECT(not is_shared(t.ctx, p.get_context())); EXPECT(not is_shared(t.ctx, p.get_context()));
auto ctx = p.get_context(); auto ctx = p.get_context();
p.eval({}).back(); std::ignore = p.eval({}).back();
EXPECT(is_shared(ctx, p.get_context())); EXPECT(is_shared(ctx, p.get_context()));
EXPECT(not is_shared(t.ctx, p.get_context())); EXPECT(not is_shared(t.ctx, p.get_context()));
} }
......
...@@ -7536,7 +7536,7 @@ TEST_CASE(select_module_not_found_error) ...@@ -7536,7 +7536,7 @@ TEST_CASE(select_module_not_found_error)
migraphx::parameter_map params; migraphx::parameter_map params;
migraphx::shape input_fixed_shape{migraphx::shape::float_type, {5, 2, 2}}; migraphx::shape input_fixed_shape{migraphx::shape::float_type, {5, 2, 2}};
params["data"] = migraphx::argument(input_fixed_shape, input_data.data()); params["data"] = migraphx::argument(input_fixed_shape, input_data.data());
EXPECT(test::throws([&] { p.eval(params).back(); })); EXPECT(test::throws([&] { std::ignore = p.eval(params).back(); }));
} }
TEST_CASE(scatternd_reduction_dyn_test) TEST_CASE(scatternd_reduction_dyn_test)
......
...@@ -49,7 +49,7 @@ std::future<typename std::result_of<Function()>::type> detach_async(Function&& f ...@@ -49,7 +49,7 @@ std::future<typename std::result_of<Function()>::type> detach_async(Function&& f
{ {
if(parallel) if(parallel)
{ {
using result_type = typename std::result_of<Function()>::type; using result_type = typename std::invoke_result<Function>::type;
std::packaged_task<result_type()> task(std::forward<Function>(f)); std::packaged_task<result_type()> task(std::forward<Function>(f));
auto fut = task.get_future(); auto fut = task.get_future();
std::thread(std::move(task)).detach(); std::thread(std::move(task)).detach();
......
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