Commit ef5d7092 authored by Shucai Xiao's avatar Shucai Xiao
Browse files

Merge branch 'develop' of https://github.com/ROCmSoftwarePlatform/AMDMIGraphX...

Merge branch 'develop' of https://github.com/ROCmSoftwarePlatform/AMDMIGraphX into refine_eliminate_contiguous
parents 2e04ea47 b2051bbc
...@@ -17,7 +17,10 @@ struct miopen_gemm ...@@ -17,7 +17,10 @@ struct miopen_gemm
shape compute_shape(const std::vector<shape>& inputs) const; shape compute_shape(const std::vector<shape>& inputs) const;
argument argument
compute(context& ctx, const shape& output_shape, const std::vector<argument>& args) const; compute(context& ctx, const shape& output_shape, const std::vector<argument>& args) const;
int output_alias(const std::vector<shape>& shapes) const { return shapes.size() - 1; } std::ptrdiff_t output_alias(const std::vector<shape>& shapes) const
{
return shapes.size() - 1;
}
}; };
} // namespace gpu } // namespace gpu
......
...@@ -73,7 +73,7 @@ struct hip_write ...@@ -73,7 +73,7 @@ struct hip_write
{ {
return to_gpu(args.front()); return to_gpu(args.front());
} }
int output_alias(const std::vector<shape>&) const { return 0; } std::ptrdiff_t output_alias(const std::vector<shape>&) const { return 0; }
}; };
struct hip_copy struct hip_copy
...@@ -89,7 +89,7 @@ struct hip_copy ...@@ -89,7 +89,7 @@ struct hip_copy
copy_to_gpu(args[0], args[1]); copy_to_gpu(args[0], args[1]);
return args[1]; return args[1];
} }
int output_alias(const std::vector<shape>&) const { return 1; } std::ptrdiff_t output_alias(const std::vector<shape>&) const { return 1; }
}; };
} // namespace gpu } // namespace gpu
......
...@@ -17,7 +17,10 @@ struct miopen_leaky_relu ...@@ -17,7 +17,10 @@ struct miopen_leaky_relu
shape compute_shape(const std::vector<shape>& inputs) const; shape compute_shape(const std::vector<shape>& inputs) const;
argument argument
compute(context& ctx, const shape& output_shape, const std::vector<argument>& args) const; compute(context& ctx, const shape& output_shape, const std::vector<argument>& args) const;
int output_alias(const std::vector<shape>& shapes) const { return shapes.size() - 1; } std::ptrdiff_t output_alias(const std::vector<shape>& shapes) const
{
return shapes.size() - 1;
}
}; };
} // namespace gpu } // namespace gpu
......
...@@ -29,7 +29,10 @@ struct hip_logsoftmax ...@@ -29,7 +29,10 @@ struct hip_logsoftmax
shape compute_shape(const std::vector<shape>& inputs) const; shape compute_shape(const std::vector<shape>& inputs) const;
argument argument
compute(context& ctx, const shape& output_shape, const std::vector<argument>& args) const; compute(context& ctx, const shape& output_shape, const std::vector<argument>& args) const;
int output_alias(const std::vector<shape>& shapes) const { return shapes.size() - 1; } std::ptrdiff_t output_alias(const std::vector<shape>& shapes) const
{
return shapes.size() - 1;
}
}; };
} // namespace gpu } // namespace gpu
......
...@@ -17,7 +17,10 @@ struct miopen_lrn ...@@ -17,7 +17,10 @@ struct miopen_lrn
shape compute_shape(const std::vector<shape>& inputs) const; shape compute_shape(const std::vector<shape>& inputs) const;
argument argument
compute(context& ctx, const shape& output_shape, const std::vector<argument>& args) const; compute(context& ctx, const shape& output_shape, const std::vector<argument>& args) const;
int output_alias(const std::vector<shape>& shapes) const { return shapes.size() - 1; } std::ptrdiff_t output_alias(const std::vector<shape>& shapes) const
{
return shapes.size() - 1;
}
}; };
} // namespace gpu } // namespace gpu
......
...@@ -61,7 +61,10 @@ struct unary_device : oper<Derived> ...@@ -61,7 +61,10 @@ struct unary_device : oper<Derived>
return args[1]; return args[1];
} }
int output_alias(const std::vector<shape>& shapes) const { return shapes.size() - 1; } std::ptrdiff_t output_alias(const std::vector<shape>& shapes) const
{
return shapes.size() - 1;
}
}; };
template <class Derived, void (*F)(hipStream_t, const argument&, const argument&, const argument&)> template <class Derived, void (*F)(hipStream_t, const argument&, const argument&, const argument&)>
...@@ -86,7 +89,10 @@ struct binary_device : oper<Derived> ...@@ -86,7 +89,10 @@ struct binary_device : oper<Derived>
return args[2]; return args[2];
} }
int output_alias(const std::vector<shape>& shapes) const { return shapes.size() - 1; } std::ptrdiff_t output_alias(const std::vector<shape>& shapes) const
{
return shapes.size() - 1;
}
}; };
} // namespace gpu } // namespace gpu
......
...@@ -18,7 +18,10 @@ struct hip_pad ...@@ -18,7 +18,10 @@ struct hip_pad
shape compute_shape(std::vector<shape> inputs) const; shape compute_shape(std::vector<shape> inputs) const;
argument argument
compute(context& ctx, const shape& output_shape, const std::vector<argument>& args) const; compute(context& ctx, const shape& output_shape, const std::vector<argument>& args) const;
int output_alias(const std::vector<shape>& shapes) const { return shapes.size() - 1; } std::ptrdiff_t output_alias(const std::vector<shape>& shapes) const
{
return shapes.size() - 1;
}
}; };
} // namespace gpu } // namespace gpu
......
...@@ -20,7 +20,10 @@ struct miopen_pooling ...@@ -20,7 +20,10 @@ struct miopen_pooling
shape compute_shape(const std::vector<shape>& inputs) const; shape compute_shape(const std::vector<shape>& inputs) const;
argument argument
compute(context& ctx, const shape& output_shape, const std::vector<argument>& args) const; compute(context& ctx, const shape& output_shape, const std::vector<argument>& args) const;
int output_alias(const std::vector<shape>& shapes) const { return shapes.size() - 1; } std::ptrdiff_t output_alias(const std::vector<shape>& shapes) const
{
return shapes.size() - 1;
}
}; };
} // namespace gpu } // namespace gpu
......
...@@ -17,7 +17,10 @@ struct miopen_relu ...@@ -17,7 +17,10 @@ struct miopen_relu
shape compute_shape(const std::vector<shape>& inputs) const; shape compute_shape(const std::vector<shape>& inputs) const;
argument argument
compute(context& ctx, const shape& output_shape, const std::vector<argument>& args) const; compute(context& ctx, const shape& output_shape, const std::vector<argument>& args) const;
int output_alias(const std::vector<shape>& shapes) const { return shapes.size() - 1; } std::ptrdiff_t output_alias(const std::vector<shape>& shapes) const
{
return shapes.size() - 1;
}
}; };
} // namespace gpu } // namespace gpu
......
...@@ -17,7 +17,10 @@ struct miopen_sigmoid ...@@ -17,7 +17,10 @@ struct miopen_sigmoid
shape compute_shape(const std::vector<shape>& inputs) const; shape compute_shape(const std::vector<shape>& inputs) const;
argument argument
compute(context& ctx, const shape& output_shape, const std::vector<argument>& args) const; compute(context& ctx, const shape& output_shape, const std::vector<argument>& args) const;
int output_alias(const std::vector<shape>& shapes) const { return shapes.size() - 1; } std::ptrdiff_t output_alias(const std::vector<shape>& shapes) const
{
return shapes.size() - 1;
}
}; };
} // namespace gpu } // namespace gpu
......
...@@ -17,7 +17,10 @@ struct miopen_softmax ...@@ -17,7 +17,10 @@ struct miopen_softmax
shape compute_shape(const std::vector<shape>& inputs) const; shape compute_shape(const std::vector<shape>& inputs) const;
argument argument
compute(context& ctx, const shape& output_shape, const std::vector<argument>& args) const; compute(context& ctx, const shape& output_shape, const std::vector<argument>& args) const;
int output_alias(const std::vector<shape>& shapes) const { return shapes.size() - 1; } std::ptrdiff_t output_alias(const std::vector<shape>& shapes) const
{
return shapes.size() - 1;
}
}; };
} // namespace gpu } // namespace gpu
......
...@@ -17,7 +17,10 @@ struct miopen_tanh ...@@ -17,7 +17,10 @@ struct miopen_tanh
shape compute_shape(const std::vector<shape>& inputs) const; shape compute_shape(const std::vector<shape>& inputs) const;
argument argument
compute(context& ctx, const shape& output_shape, const std::vector<argument>& args) const; compute(context& ctx, const shape& output_shape, const std::vector<argument>& args) const;
int output_alias(const std::vector<shape>& shapes) const { return shapes.size() - 1; } std::ptrdiff_t output_alias(const std::vector<shape>& shapes) const
{
return shapes.size() - 1;
}
}; };
} // namespace gpu } // namespace gpu
......
...@@ -153,7 +153,7 @@ struct tf_parser ...@@ -153,7 +153,7 @@ struct tf_parser
template <class T> template <class T>
void add_binary_op(std::string name, T x) void add_binary_op(std::string name, T x)
{ {
add_op(name, [this, x](attribute_map attributes, std::vector<instruction_ref> args) { add_op(name, [this, x](const attribute_map& attributes, std::vector<instruction_ref> args) {
if(args.size() != 2) if(args.size() != 2)
MIGRAPHX_THROW("binary operators should have 2 operands"); MIGRAPHX_THROW("binary operators should have 2 operands");
auto l0 = args[1]; auto l0 = args[1];
...@@ -215,7 +215,7 @@ struct tf_parser ...@@ -215,7 +215,7 @@ struct tf_parser
template <class T> template <class T>
void add_generic_op(std::string name, T x) void add_generic_op(std::string name, T x)
{ {
add_op(name, [this, x](attribute_map, std::vector<instruction_ref> args) { add_op(name, [this, x](const attribute_map&, std::vector<instruction_ref> args) {
return prog.add_instruction(x, args); return prog.add_instruction(x, args);
}); });
} }
...@@ -906,7 +906,7 @@ struct tf_parser ...@@ -906,7 +906,7 @@ struct tf_parser
std::transform(input_dims.begin(), std::transform(input_dims.begin(),
input_dims.end(), input_dims.end(),
std::back_inserter(dims), std::back_inserter(dims),
[](tensorflow::TensorShapeProto_Dim dim) { return dim.size(); }); [](const tensorflow::TensorShapeProto_Dim& dim) { return dim.size(); });
return dims; return dims;
} }
......
...@@ -49,7 +49,7 @@ struct operation ...@@ -49,7 +49,7 @@ struct operation
argument compute(context& ctx, const shape& output, const std::vector<argument>& input) const; argument compute(context& ctx, const shape& output, const std::vector<argument>& input) const;
/// An optional method to return which argument the output will alias. If /// An optional method to return which argument the output will alias. If
/// there is no aliased output then -1 can be returned. /// there is no aliased output then -1 can be returned.
int output_alias(const std::vector<shape>& input) const; std::ptrdiff_t output_alias(const std::vector<shape>& input) const;
/// An optional stream operator to print the operation. When this is not /// An optional stream operator to print the operation. When this is not
/// implemented, it will just print the operation's name. /// implemented, it will just print the operation's name.
friend std::ostream& operator<<(std::ostream& os, const operation& op); friend std::ostream& operator<<(std::ostream& os, const operation& op);
......
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