diff --git a/src/include/migraphx/argument.hpp b/src/include/migraphx/argument.hpp index 0326e460b0d..6f78d952d5c 100644 --- a/src/include/migraphx/argument.hpp +++ b/src/include/migraphx/argument.hpp @@ -46,7 +46,7 @@ struct MIGRAPHX_EXPORT argument : raw_data { argument() = default; - argument(const shape& s); + explicit argument(const shape& s); template ()())>{})> argument(shape s, F d) diff --git a/src/include/migraphx/op/allocate.hpp b/src/include/migraphx/op/allocate.hpp index 33ea6bb2260..e2670c64c11 100644 --- a/src/include/migraphx/op/allocate.hpp +++ b/src/include/migraphx/op/allocate.hpp @@ -88,13 +88,13 @@ struct allocate { if(args.empty()) { - return {output_shape}; + return argument{output_shape}; } else { std::vector output_dims(output_shape.ndim()); args.at(0).visit([&](auto a) { output_dims.assign(a.begin(), a.end()); }); - return {shape{buf_type, output_dims}}; + return argument{shape{buf_type, output_dims}}; } } }; diff --git a/src/include/migraphx/op/pooling.hpp b/src/include/migraphx/op/pooling.hpp index 276ad3295fe..7bfe456f3a0 100644 --- a/src/include/migraphx/op/pooling.hpp +++ b/src/include/migraphx/op/pooling.hpp @@ -411,7 +411,7 @@ struct pooling // for dynamic GlobalPooling, there's no padding kernel_dims.insert(kernel_dims.end(), input_lens.begin() + 2, input_lens.end()); output_shape = dyn_out.computed_shape; - result = dyn_out.computed_shape; + result = argument{dyn_out.computed_shape}; } else if((padding_mode != op::padding_mode_t::default_)) { @@ -439,7 +439,7 @@ struct pooling { kernel_dims = this->lengths; output_shape = dyn_out.computed_shape; - result = dyn_out.computed_shape; + result = argument{dyn_out.computed_shape}; } // Perform the computation and populate result diff --git a/src/targets/gpu/include/migraphx/gpu/convolution.hpp b/src/targets/gpu/include/migraphx/gpu/convolution.hpp index d6680f17ec8..f88cee86855 100644 --- a/src/targets/gpu/include/migraphx/gpu/convolution.hpp +++ b/src/targets/gpu/include/migraphx/gpu/convolution.hpp @@ -199,9 +199,9 @@ struct miopen_convolution // MIOpen has APIs to pass pre-allocated buffers starting from rocm-5.6 preallocate = true; #endif - auto x = preallocate ? to_gpu(generate_argument(x_shape)) : inputs[0]; - auto w = preallocate ? to_gpu(generate_argument(w_shape)) : inputs[1]; - auto y = preallocate ? allocate_gpu(output_shape) : inputs[2]; + auto x = preallocate ? to_gpu(generate_argument(x_shape)) : argument{inputs[0]}; + auto w = preallocate ? to_gpu(generate_argument(w_shape)) : argument{inputs[1]}; + auto y = preallocate ? allocate_gpu(output_shape) : argument{inputs[2]}; auto workspace = preallocate ? allocate_gpu(workspace_shape) : migraphx::argument(workspace_shape); diff --git a/test/eliminate_allocation_test.cpp b/test/eliminate_allocation_test.cpp index 2bfc7a54809..ba1179d1be7 100644 --- a/test/eliminate_allocation_test.cpp +++ b/test/eliminate_allocation_test.cpp @@ -55,7 +55,7 @@ struct allocate const migraphx::shape& output_shape, const std::vector&) const { - return {output_shape}; + return migraphx::argument{output_shape}; } }; diff --git a/test/eliminate_concat_test.cpp b/test/eliminate_concat_test.cpp index 13984e98645..dc2834bfa91 100644 --- a/test/eliminate_concat_test.cpp +++ b/test/eliminate_concat_test.cpp @@ -60,7 +60,7 @@ struct concat const migraphx::shape& output_shape, const std::vector&) const { - return {output_shape}; + return migraphx::argument{output_shape}; } }; @@ -104,7 +104,7 @@ struct allocate const migraphx::shape& output_shape, const std::vector&) const { - return {output_shape}; + return migraphx::argument{output_shape}; } }; diff --git a/test/memory_coloring_test.cpp b/test/memory_coloring_test.cpp index 7716c8b89a8..7cbb3efdec6 100644 --- a/test/memory_coloring_test.cpp +++ b/test/memory_coloring_test.cpp @@ -55,7 +55,7 @@ struct allocate const migraphx::shape& output_shape, const std::vector&) const { - return {output_shape}; + return migraphx::argument{output_shape}; } }; diff --git a/test/normalize_ops_test.cpp b/test/normalize_ops_test.cpp index f9ec2f033c2..a48223dd5fe 100644 --- a/test/normalize_ops_test.cpp +++ b/test/normalize_ops_test.cpp @@ -57,7 +57,7 @@ struct normalize_test_op const migraphx::shape& output_shape, const std::vector&) const { - return {output_shape}; + return migraphx::argument{output_shape}; } }; diff --git a/test/replace_allocate.cpp b/test/replace_allocate.cpp index 90b8a943973..68e3cfd5d37 100644 --- a/test/replace_allocate.cpp +++ b/test/replace_allocate.cpp @@ -54,7 +54,7 @@ struct allocate_no_out : migraphx::auto_register_op const migraphx::shape& output_shape, const std::vector&) const { - return {output_shape}; + return migraphx::argument{output_shape}; } }; @@ -78,7 +78,7 @@ struct allocate_with_out : migraphx::auto_register_op const migraphx::shape& output_shape, const std::vector&) const { - return {output_shape}; + return migraphx::argument{output_shape}; } };