Commit 9cd5cf4e authored by Paul's avatar Paul
Browse files

Formatting

parent 19ed10f0
......@@ -17,10 +17,9 @@ struct hip_device
{
hip_device() { add_stream(); }
hip_device(std::size_t id, std::size_t n)
: device_id(id)
hip_device(std::size_t id, std::size_t n) : device_id(id)
{
for(std::size_t i = 0;i< n;i++)
for(std::size_t i = 0; i < n; i++)
add_stream();
}
......@@ -123,7 +122,10 @@ struct hip_device
struct context
{
context(std::size_t device_id = 0, std::size_t n = 4) : current_device(std::make_shared<hip_device>(device_id, n)) {}
context(std::size_t device_id = 0, std::size_t n = 4)
: current_device(std::make_shared<hip_device>(device_id, n))
{
}
hip_device& get_current_device()
{
......
......@@ -33,16 +33,13 @@ struct wait_event
argument compute(context& ctx, const shape&, const std::vector<argument>&) const
{
assert(event != nullptr);
for(auto n:wait_for)
for(auto n : wait_for)
ctx.get_stream(n).record(event.get());
ctx.get_stream().wait(event.get());
return {};
}
void finalize(context& ctx, const shape&, std::vector<shape>)
{
event = create_event();
}
void finalize(context& ctx, const shape&, std::vector<shape>) { event = create_event(); }
};
struct set_stream
......@@ -79,7 +76,6 @@ void schedule_model::wait(program& p,
p.insert_instruction(ins, wait_event{wait_for});
}
static std::unordered_map<std::string, std::size_t> create_weight_map()
{
return {
......@@ -100,10 +96,9 @@ static const std::unordered_map<std::string, std::size_t>& weight_map()
return m;
}
std::size_t schedule_model::weight(const operation& op) const
{
if (weight_map().count(op.name()) == 0)
if(weight_map().count(op.name()) == 0)
return 0;
return weight_map().at(op.name());
}
......
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