"...composable_kernel_rocm.git" did not exist on "839cf8974c0f351a0aa11e0c76f05f6eb14ffcb8"
Commit e4fc4d67 authored by Paul's avatar Paul
Browse files

Improve outputs of load

parent 62ab25fc
...@@ -1174,9 +1174,19 @@ struct load ...@@ -1174,9 +1174,19 @@ struct load
} }
argument compute(const shape&, const std::vector<argument>& args) const argument compute(const shape&, const std::vector<argument>& args) const
{ {
if ((offset + s.bytes()) > args[0].get_shape().bytes())
MIGRAPHX_THROW("Load access is out of bounds");
return {s, args[0].data() + offset}; return {s, args[0].data() + offset};
} }
int output_alias(const std::vector<shape>&) const { return 0; } int output_alias(const std::vector<shape>&) const { return 0; }
friend std::ostream& operator<<(std::ostream& os, const load& op)
{
os << op.name() << "[";
os << "offset=" << op.offset << ",";
os << "end=" << (op.offset + op.s.bytes()) << "]";
return os;
}
}; };
struct outline struct outline
......
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