Commit 83b91229 authored by Paul's avatar Paul
Browse files

Formatting

parent 8e0fff81
......@@ -16,21 +16,25 @@ struct check_shapes
check_shapes(const std::vector<shape>& s) : shapes(&s) {}
template<class Op>
check_shapes(const std::vector<shape>& s, const Op& op) : shapes(&s), name(op.name()) {}
template <class Op>
check_shapes(const std::vector<shape>& s, const Op& op) : shapes(&s), name(op.name())
{
}
std::string prefix() const
{
if(name.empty()) return "";
else return name + ": ";
if(name.empty())
return "";
else
return name + ": ";
}
const check_shapes& has(std::size_t n) const
{
assert(shapes != nullptr);
if(shapes->size() != n)
RTG_THROW(prefix() + "Wrong number of arguments: expected " + std::to_string(n) + " but given " +
std::to_string(shapes->size()));
RTG_THROW(prefix() + "Wrong number of arguments: expected " + std::to_string(n) +
" but given " + std::to_string(shapes->size()));
return *this;
}
......@@ -508,14 +512,11 @@ struct outline
argument compute(context&, shape, std::vector<argument>) const { return {s, nullptr}; }
};
template<class T>
template <class T>
struct check_context
{
std::string name() const { return "check_context"; }
shape compute_shape(std::vector<shape>) const
{
return {};
}
shape compute_shape(std::vector<shape>) const { return {}; }
argument compute(context& ctx, shape, std::vector<argument>) const
{
T* x = any_cast<T>(&ctx);
......
......@@ -29,8 +29,7 @@ rtg::argument run_gpu(std::string file)
auto output = rtg::miopen::to_gpu(rtg::generate_argument(p.get_parameter_shape("output")));
auto handle = rtg::miopen::make_obj<rtg::miopen::miopen_handle>(&miopenCreate);
auto out = p.eval(
{{"Input3", input3}, {"output", output}});
auto out = p.eval({{"Input3", input3}, {"output", output}});
std::cout << p << std::endl;
return rtg::miopen::from_gpu(out);
}
......
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